rev-list: disable object/refname ambiguity check with --stdin
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>
Jeff King committed
Mar 12, 2014 at 16:06 UTC
4c30d50402c17d2569151820b92cea110ad1d240
1 file changed
+6
revision.c
+6
@@ -1541,6 +1541,10 @@ static void read_revisions_from_stdin(struct rev_info *revs,
1541
{
1542
struct strbuf sb;
1543
int seen_dashdash = 0;
1544
+ int save_warning;
1545
+
1546
+ save_warning = warn_on_object_refname_ambiguity;
1547
+ warn_on_object_refname_ambiguity = 0;
1548
1549
strbuf_init(&sb, 1000);
1550
while (strbuf_getwholeline(&sb, stdin, '\n') != EOF) {
@@ -1562,7 +1566,9 @@ static void read_revisions_from_stdin(struct rev_info *revs,
1566
}
1567
if (seen_dashdash)
1568
read_pathspec_from_stdin(revs, &sb, prune);
1569
+
1570
strbuf_release(&sb);
1571
+ warn_on_object_refname_ambiguity = save_warning;
1572
}
1573
1574
static void add_grep(struct rev_info *revs, const char *ptn, enum grep_pat_token what)