]> git.ipfire.org Git - thirdparty/git.git/blame - t/t7101-reset-empty-subdirs.sh
The third batch
[thirdparty/git.git] / t / t7101-reset-empty-subdirs.sh
CommitLineData
772d8a3b
SP
1#!/bin/sh
2#
3# Copyright (c) 2006 Shawn Pearce
4#
5
d592b315 6test_description='git reset should cull empty subdirs'
d96fb140
ÆAB
7
8TEST_PASSES_SANITIZE_LEAK=true
772d8a3b 9. ./test-lib.sh
1c720357 10. "$TEST_DIRECTORY"/lib-diff-data.sh
772d8a3b 11
e166fe36 12test_expect_success 'creating initial files' '
3b8724bc
JC
13 mkdir path0 &&
14 COPYING_test_data >path0/COPYING &&
15 git add path0/COPYING &&
16 git commit -m add -a
e166fe36 17'
772d8a3b 18
e166fe36 19test_expect_success 'creating second files' '
3b8724bc
JC
20 mkdir path1 &&
21 mkdir path1/path2 &&
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 &&
28 git add COPYING &&
29 git add path0/COPYING-TOO &&
30 git commit -m change -a
e166fe36 31'
772d8a3b 32
e166fe36 33test_expect_success 'resetting tree HEAD^' '
3b8724bc 34 git reset --hard HEAD^
e166fe36 35'
772d8a3b 36
e166fe36 37test_expect_success 'checking initial files exist after rewind' '
3b8724bc
JC
38 test -d path0 &&
39 test -f path0/COPYING
e166fe36 40'
772d8a3b 41
e166fe36 42test_expect_success 'checking lack of path1/path2/COPYING' '
3b8724bc 43 ! test -f path1/path2/COPYING
e166fe36 44'
772d8a3b 45
e166fe36 46test_expect_success 'checking lack of path1/COPYING' '
3b8724bc 47 ! test -f path1/COPYING
e166fe36 48'
772d8a3b 49
e166fe36 50test_expect_success 'checking lack of COPYING' '
3b8724bc 51 ! test -f COPYING
e166fe36 52'
772d8a3b 53
e166fe36 54test_expect_success 'checking checking lack of path1/COPYING-TOO' '
3b8724bc 55 ! test -f path0/COPYING-TOO
e166fe36 56'
772d8a3b 57
e166fe36 58test_expect_success 'checking lack of path1/path2' '
3b8724bc 59 ! test -d path1/path2
e166fe36 60'
772d8a3b 61
e166fe36 62test_expect_success 'checking lack of path1' '
3b8724bc 63 ! test -d path1
e166fe36 64'
772d8a3b
SP
65
66test_done