Skip to content

Commit df995c7

Browse files
tobiasugitster
authored andcommitted
silence git gc --auto --quiet output
When --quiet is requested, gc --auto should not display messages unless there is an error. Signed-off-by: Tobias Ulmer <[email protected]> Acked-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b5d156c commit df995c7

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

builtin/gc.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,7 @@ int cmd_gc(int argc, const char **argv, const char *prefix)
217217
*/
218218
if (!need_to_gc())
219219
return 0;
220-
if (quiet)
221-
fprintf(stderr, _("Auto packing the repository for optimum performance.\n"));
222-
else
220+
if (!quiet)
223221
fprintf(stderr,
224222
_("Auto packing the repository for optimum performance. You may also\n"
225223
"run \"git gc\" manually. See "

t/t5400-send-pack.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,7 @@ test_expect_success 'receive-pack runs auto-gc in remote repo' '
174174
cd parent &&
175175
echo "Even more text" >>file.txt &&
176176
git commit -a -m "Third commit" &&
177-
git send-pack ../child HEAD:refs/heads/test_auto_gc >output 2>&1 &&
178-
grep "Auto packing the repository for optimum performance." output
177+
git send-pack ../child HEAD:refs/heads/test_auto_gc
179178
) &&
180179
test ! -e child/.git/objects/tmp_test_object
181180
'

0 commit comments

Comments
 (0)