3 # Copyright (c) 2007 Johannes E. Schindelin
6 test_description
='Test fsck --lost-found'
9 test_expect_success setup
'
10 git config core.logAllRefUpdates 0 &&
14 git commit -m initial &&
17 git add file1 file2 &&
19 git commit -m second &&
24 test_expect_success
'lost and found something' '
25 git rev-parse HEAD > lost-commit &&
26 git rev-parse :file3 > lost-other &&
28 git reset --hard HEAD^ &&
29 git fsck --lost-found &&
30 test 2 = $(ls .git/lost-found/*/* | wc -l) &&
31 test -f .git/lost-found/commit/$(cat lost-commit) &&
32 test -f .git/lost-found/other/$(cat lost-other)