diff options
author | Jeff King <peff@peff.net> | 2014-03-12 16:06:17 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-03-13 11:56:29 -0700 |
commit | 4c30d50402c17d2569151820b92cea110ad1d240 (patch) | |
tree | 4dc9f246aba5263fc8ae3392ccee12ea1b6161ba | |
parent | a42fcd15d82b6660377749064e0ad25742ccc6f7 (diff) | |
download | git-4c30d50402c17d2569151820b92cea110ad1d240.tar.gz |
rev-list: disable object/refname ambiguity check with --stdinjk/warn-on-object-refname-ambiguity
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>
-rw-r--r-- | revision.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/revision.c b/revision.c index a8adb3fc88..d9cefd9a79 100644 --- a/revision.c +++ b/revision.c @@ -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) { @@ -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) |