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>
This commit is contained in:

committed by
Junio C Hamano

parent
3dcec76d9d
commit
6974765352
@ -29,6 +29,14 @@ test_expect_success setup '
|
||||
git gc
|
||||
'
|
||||
|
||||
test_expect_success 'bare repo prune is quiet without $GIT_DIR/objects/pack' '
|
||||
git clone -q --shared --template= --bare . bare.git &&
|
||||
rmdir bare.git/objects/pack &&
|
||||
git --git-dir=bare.git prune --no-progress 2>prune.err &&
|
||||
test_must_be_empty prune.err &&
|
||||
rm -r bare.git prune.err
|
||||
'
|
||||
|
||||
test_expect_success 'prune stale packs' '
|
||||
orig_pack=$(echo .git/objects/pack/*.pack) &&
|
||||
>.git/objects/tmp_1.pack &&
|
||||
|
Reference in New Issue
Block a user