builtin-apply: stronger indent-with-on-tab fixing
[git/jbf-maint.git] / t / t1420-lost-found.sh
blobdc9e402c55574d981e161d4e38e74617c411f46d
1 #!/bin/sh
3 # Copyright (c) 2007 Johannes E. Schindelin
6 test_description='Test fsck --lost-found'
7 . ./test-lib.sh
9 test_expect_success setup '
10 git config core.logAllRefUpdates 0 &&
11 : > file1 &&
12 git add file1 &&
13 test_tick &&
14 git commit -m initial &&
15 echo 1 > file1 &&
16 echo 2 > file2 &&
17 git add file1 file2 &&
18 test_tick &&
19 git commit -m second &&
20 echo 3 > file3 &&
21 git add file3
24 test_expect_success 'lost and found something' '
25 git rev-parse HEAD > lost-commit &&
26 git rev-parse :file3 > lost-other &&
27 test_tick &&
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)
35 test_done