diff options
Diffstat (limited to 'builtin/prune.c')
-rw-r--r-- | builtin/prune.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/builtin/prune.c b/builtin/prune.c index 58d7cb8324..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; @@ -85,9 +86,9 @@ static int prune_dir(int i, char *path) } fprintf(stderr, "bad sha1 file: %s/%s\n", path, de->d_name); } + closedir(dir); if (!show_only) rmdir(path); - closedir(dir); return 0; } |