silence git gc --auto --quiet output
authorTobias Ulmer <tobiasu@tmux.org>
Mon, 24 Sep 2012 02:40:24 +0000 (04:40 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 28 Sep 2012 00:57:26 +0000 (17:57 -0700)
When --quiet is requested, gc --auto should not display messages unless
there is an error.

Signed-off-by: Tobias Ulmer <tobiasu@tmux.org>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/gc.c
t/t5400-send-pack.sh

index 6d46608fc9ffe45a9ebb7ebb4570e0b163455411..6be6c8d65b26c9149aac2b6c1de6e3217c6ceea7 100644 (file)
@@ -217,9 +217,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
                 */
                if (!need_to_gc())
                        return 0;
-               if (quiet)
-                       fprintf(stderr, _("Auto packing the repository for optimum performance.\n"));
-               else
+               if (!quiet)
                        fprintf(stderr,
                                        _("Auto packing the repository for optimum performance. You may also\n"
                                        "run \"git gc\" manually. See "
index 250c720c14602bdf21e6a7200437b13fe6feaca3..78ab17793894ed902468e1f7af5841b67eeef2ff 100755 (executable)
@@ -174,8 +174,7 @@ test_expect_success 'receive-pack runs auto-gc in remote repo' '
            cd parent &&
            echo "Even more text" >>file.txt &&
            git commit -a -m "Third commit" &&
-           git send-pack ../child HEAD:refs/heads/test_auto_gc >output 2>&1 &&
-           grep "Auto packing the repository for optimum performance." output
+           git send-pack ../child HEAD:refs/heads/test_auto_gc
        ) &&
        test ! -e child/.git/objects/tmp_test_object
 '