diff options
author | Eric Wong <e@80x24.org> | 2022-11-19 23:12:13 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-11-21 09:58:54 +0300 |
commit | 69747653523afa3322e0f8dd6a5a7d30184694c3 (patch) | |
tree | a3836ca846693306242a4153040180b84f3e806f /builtin/prune.c | |
parent | 3dcec76d9df911ed8321007b1d197c1a206dc164 (diff) |
prune: quiet ENOENT on missing directories
$GIT_DIR/objects/pack may be removed to save inodes in shared
repositories. Quiet down prune in cases where either
$GIT_DIR/objects or $GIT_DIR/objects/pack is non-existent,
but emit the system error in other cases to help users diagnose
permissions problems or resource constraints.
Signed-off-by: Eric Wong <e@80x24.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/prune.c')
-rw-r--r-- | builtin/prune.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin/prune.c b/builtin/prune.c index df376b2ed1..2719220108 100644 --- a/builtin/prune.c +++ b/builtin/prune.c @@ -127,7 +127,9 @@ static void remove_temporary_files(const char *path) dir = opendir(path); if (!dir) { - fprintf(stderr, "Unable to open directory %s\n", path); + if (errno != ENOENT) + fprintf(stderr, "Unable to open directory %s: %s\n", + path, strerror(errno)); return; } while ((de = readdir(dir)) != NULL) |