Skip to content

Commit

Permalink
silence git gc --auto --quiet output
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tobias Ulmer authored and Junio C Hamano committed Sep 28, 2012
1 parent b5d156c commit df995c7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 1 addition & 3 deletions builtin/gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 "
Expand Down
3 changes: 1 addition & 2 deletions t/t5400-send-pack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
'
Expand Down

0 comments on commit df995c7

Please sign in to comment.