3 # Copyright (c) 2006 Shawn Pearce
6 test_description='git reset should cull empty subdirs'
9 test_expect_success 'creating initial files' '
11 cp "$TEST_DIRECTORY"/../COPYING path0/COPYING &&
12 git add path0/COPYING &&
16 test_expect_success 'creating second files' '
19 cp "$TEST_DIRECTORY"/../COPYING path1/path2/COPYING &&
20 cp "$TEST_DIRECTORY"/../COPYING path1/COPYING &&
21 cp "$TEST_DIRECTORY"/../COPYING COPYING &&
22 cp "$TEST_DIRECTORY"/../COPYING path0/COPYING-TOO &&
23 git add path1/path2/COPYING &&
24 git add path1/COPYING &&
26 git add path0/COPYING-TOO &&
27 git commit -m change -a
30 test_expect_success 'resetting tree HEAD^' '
31 git reset --hard HEAD^
34 test_expect_success 'checking initial files exist after rewind' '
39 test_expect_success 'checking lack of path1/path2/COPYING' '
40 ! test -f path1/path2/COPYING
43 test_expect_success 'checking lack of path1/COPYING' '
44 ! test -f path1/COPYING
47 test_expect_success 'checking lack of COPYING' '
51 test_expect_success 'checking checking lack of path1/COPYING-TOO' '
52 ! test -f path0/COPYING-TOO
55 test_expect_success 'checking lack of path1/path2' '
59 test_expect_success 'checking lack of path1' '