Skip to content

Commit aa9ea77

Browse files
committed
blame: read custom grafts given by -S before calling setup_revisions()
setup_revisions() while getting the command line arguments parses the given commits from the command line, which means their direct parents will not be rewritten by the custom graft file. Call read_ancestry() early to work around this issue. Signed-off-by: Junio C Hamano <[email protected]>
1 parent ea02eef commit aa9ea77

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

builtin-blame.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2346,6 +2346,10 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
23462346
parse_done:
23472347
argc = parse_options_end(&ctx);
23482348

2349+
if (revs_file && read_ancestry(revs_file))
2350+
die("reading graft file %s failed: %s",
2351+
revs_file, strerror(errno));
2352+
23492353
if (DIFF_OPT_TST(&revs.diffopt, FIND_COPIES_HARDER))
23502354
opt |= (PICKAXE_BLAME_COPY | PICKAXE_BLAME_MOVE |
23512355
PICKAXE_BLAME_COPY_HARDER);
@@ -2484,10 +2488,6 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
24842488
sb.ent = ent;
24852489
sb.path = path;
24862490

2487-
if (revs_file && read_ancestry(revs_file))
2488-
die("reading graft file %s failed: %s",
2489-
revs_file, strerror(errno));
2490-
24912491
read_mailmap(&mailmap, ".mailmap", NULL);
24922492

24932493
if (!incremental)

0 commit comments

Comments
 (0)