Skip to content

Commit 02a481f

Browse files
ConradIrwingitster
authored andcommitted
Test atomic git-commit --interactive
Signed-off-by: Conrad Irwin <[email protected]> Helped-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e6b57a8 commit 02a481f

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

t/t7501-commit.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,16 @@ test_expect_success PERL \
133133
"interactive add" \
134134
"echo 7 | git commit --interactive | grep 'What now'"
135135

136+
test_expect_success PERL \
137+
"commit --interactive doesn't change index if editor aborts" \
138+
"echo zoo >file &&
139+
test_must_fail git diff --exit-code >diff1 &&
140+
(echo u ; echo '*' ; echo q) |
141+
(EDITOR=: && export EDITOR &&
142+
test_must_fail git commit --interactive) &&
143+
git diff >diff2 &&
144+
test_cmp diff1 diff2"
145+
136146
test_expect_success \
137147
"showing committed revisions" \
138148
"git rev-list HEAD >current"

0 commit comments

Comments
 (0)