Skip to content

Commit 811929f

Browse files
Martin von Zweigbergkgitster
authored andcommitted
remove unnecessary parameter from get_patch_ids()
get_patch_ids() takes an already initialized rev_info and a prefix. The prefix is used when initalizing a second rev_info. Since the initialized rev_info already has a prefix and the prefix never changes, we can use the prefix from the initialized rev_info to initialize the second rev_info. Signed-off-by: Martin von Zweigbergk <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent cdd159b commit 811929f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

builtin/log.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -696,7 +696,7 @@ static int reopen_stdout(struct commit *commit, const char *subject,
696696
return 0;
697697
}
698698

699-
static void get_patch_ids(struct rev_info *rev, struct patch_ids *ids, const char *prefix)
699+
static void get_patch_ids(struct rev_info *rev, struct patch_ids *ids)
700700
{
701701
struct rev_info check_rev;
702702
struct commit *commit;
@@ -717,7 +717,7 @@ static void get_patch_ids(struct rev_info *rev, struct patch_ids *ids, const cha
717717
init_patch_ids(ids);
718718

719719
/* given a range a..b get all patch ids for b..a */
720-
init_revisions(&check_rev, prefix);
720+
init_revisions(&check_rev, rev->prefix);
721721
o1->flags ^= UNINTERESTING;
722722
o2->flags ^= UNINTERESTING;
723723
add_pending_object(&check_rev, o1, "o1");
@@ -1306,7 +1306,7 @@ int cmd_format_patch(int argc, const char **argv, const char *prefix)
13061306
if (hashcmp(o[0].item->sha1, o[1].item->sha1) == 0)
13071307
return 0;
13081308
}
1309-
get_patch_ids(&rev, &ids, prefix);
1309+
get_patch_ids(&rev, &ids);
13101310
}
13111311

13121312
if (!use_stdout)
@@ -1525,7 +1525,7 @@ int cmd_cherry(int argc, const char **argv, const char *prefix)
15251525
return 0;
15261526
}
15271527

1528-
get_patch_ids(&revs, &ids, prefix);
1528+
get_patch_ids(&revs, &ids);
15291529

15301530
if (limit && add_pending_commit(limit, &revs, UNINTERESTING))
15311531
die(_("Unknown commit %s"), limit);

0 commit comments

Comments
 (0)