3 # Copyright (c) 2007 Johannes E. Schindelin
6 test_description
='Test fsck --lost-found'
8 TEST_PASSES_SANITIZE_LEAK
=true
11 test_expect_success setup
'
12 git config core.logAllRefUpdates 0 &&
16 git commit -m initial &&
19 git add file1 file2 &&
21 git commit -m second &&
26 test_expect_success
'lost and found something' '
27 git rev-parse HEAD > lost-commit &&
28 git rev-parse :file3 > lost-other &&
30 git reset --hard HEAD^ &&
31 git fsck --lost-found &&
32 test 2 = $(ls .git/lost-found/*/* | wc -l) &&
33 test -f .git/lost-found/commit/$(cat lost-commit) &&
34 test -f .git/lost-found/other/$(cat lost-other)