]> git.ipfire.org Git - thirdparty/git.git/commitdiff
mktag: use default strbuf_read() hint
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Tue, 5 Jan 2021 19:42:43 +0000 (20:42 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 5 Jan 2021 22:58:29 +0000 (14:58 -0800)
Change the hardcoded hint of 2^12 to 0. The default strbuf hint is
perfectly fine here, and the only reason we were hardcoding it is
because it survived migration from a pre-strbuf fixed-sized buffer.

See fd17f5b5f77 (Replace all read_fd use with strbuf_read, and get rid
of it., 2007-09-10) for that migration.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/mktag.c

index 4982d3a93efb4b5fce3a2cb5ebc3199238f65fb0..ff7ac8e0e5dbfe77ca16d2304b944a30c14ca408 100644 (file)
@@ -161,7 +161,7 @@ int cmd_mktag(int argc, const char **argv, const char *prefix)
        if (argc != 1)
                usage("git mktag");
 
-       if (strbuf_read(&buf, 0, 4096) < 0) {
+       if (strbuf_read(&buf, 0, 0) < 0) {
                die_errno("could not read from stdin");
        }