3 test_description
='more git add -u'
16 _z40
=0000000000000000000000000000000000000000
18 test_expect_success setup
'
20 _empty=$(git hash-object --stdin <xyzzy) &&
26 git add caskly xyzzy yomin nitfol rezrov/bozbar &&
33 test_expect_success modify
'
34 rm -f xyzzy yomin nitfol caskly &&
35 # caskly disappears (not a submodule)
37 # nitfol changes from symlink to regular
39 # rezrov/bozbar disappears
42 # xyzzy disappears (not a submodule)
44 echo gnusto >xyzzy/bozbar &&
45 # yomin gets replaced with a submodule
52 git commit -m "sub initial"
54 yomin=$(GIT_DIR=yomin/.git git rev-parse HEAD) &&
55 # yonk is added and then turned into a submodule
56 # this should appear as T in diff-files and as A in diff-index
66 git commit -m "sub initial"
68 yonk=$(GIT_DIR=yonk/.git git rev-parse HEAD) &&
69 # zifmia is added and then removed
70 # this should appear in diff-files but not in diff-index.
83 s/ nitfol/ $_z40 $symlink_change&/
87 s/ rezrov.bozbar/ $_z40 D&/
102 echo ":100644 160000 $_empty $_z40 T yonk"
103 echo ":100644 000000 $_empty $_z40 D zifmia"
107 echo ":000000 160000 $_z40 $_z40 A yonk"
110 echo "100644 $_empty 0 nitfol"
111 echo "160000 $yomin 0 yomin"
112 echo "160000 $yonk 0 yonk"
116 test_expect_success diff-files
'
117 git diff-files --raw >actual &&
118 test_cmp expect-files actual
121 test_expect_success diff-index
'
122 git diff-index --raw HEAD -- >actual &&
123 test_cmp expect-index actual
126 test_expect_success
'add -u' '
127 rm -f ".git/saved-index" &&
128 cp -p ".git/index" ".git/saved-index" &&
130 git ls-files -s >actual &&
131 test_cmp expect-final actual
134 test_expect_success
'commit -a' '
135 if test -f ".git/saved-index"
137 rm -f ".git/index" &&
138 mv ".git/saved-index" ".git/index"
140 git commit -m "second" -a &&
141 git ls-files -s >actual &&
142 test_cmp expect-final actual &&
144 git read-tree HEAD &&
145 git ls-files -s >actual &&
146 test_cmp expect-final actual