Git fork
at reftables-rust 36 lines 750 B view raw
1#!/bin/sh 2# 3# Copyright (c) 2007 Johannes E. Schindelin 4# 5 6test_description='Test fsck --lost-found' 7 8. ./test-lib.sh 9 10test_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 25test_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 test 2 = $(ls .git/lost-found/*/* | wc -l) && 32 test -f .git/lost-found/commit/$(cat lost-commit) && 33 test -f .git/lost-found/other/$(cat lost-other) 34' 35 36test_done