Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/t1420-lost-found.sh # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / t / t1420-lost-found.sh` 39 lines ยท 771 bytes Raw Blame History 1 #!/bin/sh 2 # 3 # Copyright (c) 2007 Johannes E. Schindelin 4 # 5 6 test_description='Test fsck --lost-found' 7 8 . ./test-lib.sh 9 10 test_expect_success setup ' 11 git config core.logAllRefUpdates 0 && 12 : > file1 && 13 git add file1 && 14 test_tick && 15 git commit -m initial && 16 echo 1 > file1 && 17 echo 2 > file2 && 18 git add file1 file2 && 19 test_tick && 20 git commit -m second && 21 echo 3 > file3 && 22 git add file3 23 ' 24 25 test_expect_success 'lost and found something' ' 26 git rev-parse HEAD > lost-commit && 27 git rev-parse :file3 > lost-other && 28 test_tick && 29 git reset --hard HEAD^ && 30 git fsck --lost-found && 31 ls .git/lost-found/*/* >actual && 32 cat >expect <<-EOF && 33 .git/lost-found/commit/$(cat lost-commit) 34 .git/lost-found/other/$(cat lost-other) 35 EOF 36 test_cmp expect actual 37 ' 38 39 test_done