Merge branch 'bc/prune-info' into maint
authorJunio C Hamano <gitster@pobox.com>
Mon, 10 Sep 2012 22:37:37 +0000 (15:37 -0700)
committerJunio C Hamano <gitster@pobox.com>
Mon, 10 Sep 2012 22:37:37 +0000 (15:37 -0700)
"git prune" without "-v" used to warn about leftover temporary
files (which is an indication of an earlier aborted operation).

* bc/prune-info:
prune.c: only print informational message in show_only or verbose mode

builtin/prune.c
index b99b635e44f6145395b5c761505099c0a0f5b6cc..6cb99443c1a1773b6a8207dfbcc6d1e053e70ce4 100644 (file)
@@ -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;