summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2012-08-29 14:49:39 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2012-08-29 14:49:39 -0700
commitb49203ba02aab745024ed2558e3448bc946ba029 (patch)
treeb5f9a2863b3727346d1469dc9a47e8af32cb1a27
parentMerge branch 'mz/cherry-code-cleanup' (diff)
parentprune.c: only print informational message in show_only or verbose mode (diff)
downloadtgif-b49203ba02aab745024ed2558e3448bc946ba029.tar.xz
Merge branch 'bc/prune-info'
Teach "git prune" without "-v" to be silent about leftover temporary files. * bc/prune-info: prune.c: only print informational message in show_only or verbose mode
-rw-r--r--builtin/prune.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/prune.c b/builtin/prune.c
index b99b635e44..6cb99443c1 100644
--- a/builtin/prune.c
+++ b/builtin/prune.c
@@ -25,7 +25,8 @@ static int prune_tmp_object(const char *path, const char *filename)
return error("Could not stat '%s'", fullpath);
if (st.st_mtime > expire)
return 0;
- printf("Removing stale temporary file %s\n", fullpath);
+ if (show_only || verbose)
+ printf("Removing stale temporary file %s\n", fullpath);
if (!show_only)
unlink_or_warn(fullpath);
return 0;