3 # Copyright (c) 2006 Shawn Pearce
6 test_description
='git reset should cull empty subdirs'
8 TEST_PASSES_SANITIZE_LEAK
=true
10 .
"$TEST_DIRECTORY"/lib-diff-data.sh
12 test_expect_success
'creating initial files' '
14 COPYING_test_data >path0/COPYING &&
15 git add path0/COPYING &&
19 test_expect_success
'creating second files' '
22 COPYING_test_data >path1/path2/COPYING &&
23 COPYING_test_data >path1/COPYING &&
24 COPYING_test_data >COPYING &&
25 COPYING_test_data >path0/COPYING-TOO &&
26 git add path1/path2/COPYING &&
27 git add path1/COPYING &&
29 git add path0/COPYING-TOO &&
30 git commit -m change -a
33 test_expect_success
'resetting tree HEAD^' '
34 git reset --hard HEAD^
37 test_expect_success
'checking initial files exist after rewind' '
42 test_expect_success
'checking lack of path1/path2/COPYING' '
43 ! test -f path1/path2/COPYING
46 test_expect_success
'checking lack of path1/COPYING' '
47 ! test -f path1/COPYING
50 test_expect_success
'checking lack of COPYING' '
54 test_expect_success
'checking checking lack of path1/COPYING-TOO' '
55 ! test -f path0/COPYING-TOO
58 test_expect_success
'checking lack of path1/path2' '
62 test_expect_success
'checking lack of path1' '