]>
Commit | Line | Data |
---|---|---|
772d8a3b SP |
1 | #!/bin/sh |
2 | # | |
3 | # Copyright (c) 2006 Shawn Pearce | |
4 | # | |
5 | ||
d592b315 | 6 | test_description='git reset should cull empty subdirs' |
772d8a3b SP |
7 | . ./test-lib.sh |
8 | ||
e166fe36 CM |
9 | test_expect_success 'creating initial files' ' |
10 | mkdir path0 && | |
bfdbee98 | 11 | cp "$TEST_DIRECTORY"/../COPYING path0/COPYING && |
5be60078 | 12 | git add path0/COPYING && |
e166fe36 CM |
13 | git commit -m add -a |
14 | ' | |
772d8a3b | 15 | |
e166fe36 CM |
16 | test_expect_success 'creating second files' ' |
17 | mkdir path1 && | |
772d8a3b | 18 | mkdir path1/path2 && |
bfdbee98 JH |
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 && | |
5be60078 JH |
23 | git add path1/path2/COPYING && |
24 | git add path1/COPYING && | |
25 | git add COPYING && | |
26 | git add path0/COPYING-TOO && | |
e166fe36 CM |
27 | git commit -m change -a |
28 | ' | |
772d8a3b | 29 | |
e166fe36 CM |
30 | test_expect_success 'resetting tree HEAD^' ' |
31 | git reset --hard HEAD^ | |
32 | ' | |
772d8a3b | 33 | |
e166fe36 CM |
34 | test_expect_success 'checking initial files exist after rewind' ' |
35 | test -d path0 && | |
36 | test -f path0/COPYING | |
37 | ' | |
772d8a3b | 38 | |
e166fe36 CM |
39 | test_expect_success 'checking lack of path1/path2/COPYING' ' |
40 | ! test -f path1/path2/COPYING | |
41 | ' | |
772d8a3b | 42 | |
e166fe36 CM |
43 | test_expect_success 'checking lack of path1/COPYING' ' |
44 | ! test -f path1/COPYING | |
45 | ' | |
772d8a3b | 46 | |
e166fe36 CM |
47 | test_expect_success 'checking lack of COPYING' ' |
48 | ! test -f COPYING | |
49 | ' | |
772d8a3b | 50 | |
e166fe36 CM |
51 | test_expect_success 'checking checking lack of path1/COPYING-TOO' ' |
52 | ! test -f path0/COPYING-TOO | |
53 | ' | |
772d8a3b | 54 | |
e166fe36 CM |
55 | test_expect_success 'checking lack of path1/path2' ' |
56 | ! test -d path1/path2 | |
57 | ' | |
772d8a3b | 58 | |
e166fe36 CM |
59 | test_expect_success 'checking lack of path1' ' |
60 | ! test -d path1 | |
61 | ' | |
772d8a3b SP |
62 | |
63 | test_done |