Skip to content

Commit

Permalink
rev-list: disable object/refname ambiguity check with --stdin
Browse files Browse the repository at this point in the history
This is the "rev-list" analogue to 25fba78 (cat-file:
disable object/refname ambiguity check for batch mode,
2013-07-12).  Like cat-file, "rev-list --stdin" may read a
large number of sha1 object names, and the warning check
introduces a significant slow-down.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Mar 13, 2014
1 parent a42fcd1 commit 4c30d50
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions revision.c
Original file line number Diff line number Diff line change
Expand Up @@ -1541,6 +1541,10 @@ static void read_revisions_from_stdin(struct rev_info *revs,
{
struct strbuf sb;
int seen_dashdash = 0;
int save_warning;

save_warning = warn_on_object_refname_ambiguity;
warn_on_object_refname_ambiguity = 0;

strbuf_init(&sb, 1000);
while (strbuf_getwholeline(&sb, stdin, '\n') != EOF) {
Expand All @@ -1562,7 +1566,9 @@ static void read_revisions_from_stdin(struct rev_info *revs,
}
if (seen_dashdash)
read_pathspec_from_stdin(revs, &sb, prune);

strbuf_release(&sb);
warn_on_object_refname_ambiguity = save_warning;
}

static void add_grep(struct rev_info *revs, const char *ptn, enum grep_pat_token what)
Expand Down

0 comments on commit 4c30d50

Please sign in to comment.