Skip to content

Commit

Permalink
blame: read custom grafts given by -S before calling setup_revisions()
Browse files Browse the repository at this point in the history
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 <gitster@pobox.com>
  • Loading branch information
Junio C Hamano committed Mar 18, 2009
1 parent ea02eef commit aa9ea77
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions builtin-blame.c
Original file line number Diff line number Diff line change
Expand Up @@ -2346,6 +2346,10 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
parse_done:
argc = parse_options_end(&ctx);

if (revs_file && read_ancestry(revs_file))
die("reading graft file %s failed: %s",
revs_file, strerror(errno));

if (DIFF_OPT_TST(&revs.diffopt, FIND_COPIES_HARDER))
opt |= (PICKAXE_BLAME_COPY | PICKAXE_BLAME_MOVE |
PICKAXE_BLAME_COPY_HARDER);
Expand Down Expand Up @@ -2484,10 +2488,6 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
sb.ent = ent;
sb.path = path;

if (revs_file && read_ancestry(revs_file))
die("reading graft file %s failed: %s",
revs_file, strerror(errno));

read_mailmap(&mailmap, ".mailmap", NULL);

if (!incremental)
Expand Down

0 comments on commit aa9ea77

Please sign in to comment.