]> git.ipfire.org Git - thirdparty/git.git/commitdiff
rev-list: disable object/refname ambiguity check with --stdin
authorJeff King <peff@peff.net>
Wed, 12 Mar 2014 20:06:17 +0000 (16:06 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 13 Mar 2014 18:56:29 +0000 (11:56 -0700)
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>
revision.c

index a8adb3fc8891a73fb4017d18b00020bca790c766..d9cefd9a7974ae63eb1231cece2de1df1cbeaa79 100644 (file)
@@ -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)