]>
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 | ||
9 | test_expect_success \ | |
10 | 'creating initial files' \ | |
11 | 'mkdir path0 && | |
bfdbee98 | 12 | cp "$TEST_DIRECTORY"/../COPYING path0/COPYING && |
5be60078 | 13 | git add path0/COPYING && |
d592b315 | 14 | git commit -m add -a' |
772d8a3b SP |
15 | |
16 | test_expect_success \ | |
17 | 'creating second files' \ | |
18 | 'mkdir path1 && | |
19 | mkdir path1/path2 && | |
bfdbee98 JH |
20 | cp "$TEST_DIRECTORY"/../COPYING path1/path2/COPYING && |
21 | cp "$TEST_DIRECTORY"/../COPYING path1/COPYING && | |
22 | cp "$TEST_DIRECTORY"/../COPYING COPYING && | |
23 | cp "$TEST_DIRECTORY"/../COPYING path0/COPYING-TOO && | |
5be60078 JH |
24 | git add path1/path2/COPYING && |
25 | git add path1/COPYING && | |
26 | git add COPYING && | |
27 | git add path0/COPYING-TOO && | |
d592b315 | 28 | git commit -m change -a' |
772d8a3b SP |
29 | |
30 | test_expect_success \ | |
31 | 'resetting tree HEAD^' \ | |
d592b315 | 32 | 'git reset --hard HEAD^' |
772d8a3b SP |
33 | |
34 | test_expect_success \ | |
35 | 'checking initial files exist after rewind' \ | |
36 | 'test -d path0 && | |
37 | test -f path0/COPYING' | |
38 | ||
41ac414e | 39 | test_expect_success \ |
772d8a3b | 40 | 'checking lack of path1/path2/COPYING' \ |
41ac414e | 41 | '! test -f path1/path2/COPYING' |
772d8a3b | 42 | |
41ac414e | 43 | test_expect_success \ |
772d8a3b | 44 | 'checking lack of path1/COPYING' \ |
41ac414e | 45 | '! test -f path1/COPYING' |
772d8a3b | 46 | |
41ac414e | 47 | test_expect_success \ |
772d8a3b | 48 | 'checking lack of COPYING' \ |
41ac414e | 49 | '! test -f COPYING' |
772d8a3b | 50 | |
41ac414e | 51 | test_expect_success \ |
772d8a3b | 52 | 'checking checking lack of path1/COPYING-TOO' \ |
41ac414e | 53 | '! test -f path0/COPYING-TOO' |
772d8a3b | 54 | |
41ac414e | 55 | test_expect_success \ |
772d8a3b | 56 | 'checking lack of path1/path2' \ |
41ac414e | 57 | '! test -d path1/path2' |
772d8a3b | 58 | |
41ac414e | 59 | test_expect_success \ |
772d8a3b | 60 | 'checking lack of path1' \ |
41ac414e | 61 | '! test -d path1' |
772d8a3b SP |
62 | |
63 | test_done |