Merge branch 'ar/submodule-add-config'
[git/debian.git] / t / t7101-reset-empty-subdirs.sh
blobbfce05ac5dea71559e09f6023df2e5b6e1abdcbd
1 #!/bin/sh
3 # Copyright (c) 2006 Shawn Pearce
6 test_description='git reset should cull empty subdirs'
7 . ./test-lib.sh
9 test_expect_success 'creating initial files' '
10 mkdir path0 &&
11 cp "$TEST_DIRECTORY"/../COPYING path0/COPYING &&
12 git add path0/COPYING &&
13 git commit -m add -a
16 test_expect_success 'creating second files' '
17 mkdir path1 &&
18 mkdir path1/path2 &&
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 &&
25 git add 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' '
35 test -d path0 &&
36 test -f path0/COPYING
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' '
48 ! test -f 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' '
56 ! test -d path1/path2
59 test_expect_success 'checking lack of path1' '
60 ! test -d path1
63 test_done