summaryrefslogtreecommitdiff
path: root/t/t3701-add-interactive.sh
diff options
context:
space:
mode:
authorMatthieu Moy <Matthieu.Moy@imag.fr>2015-04-16 07:02:28 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-04-16 21:14:10 (GMT)
commit1bf01040f0c1101f410f9caa5e715460cdd0cbe0 (patch)
treee955c98fcd4619b12b733af93b0b0b09bea4caee /t/t3701-add-interactive.sh
parent416145f07acd6985fd45f993984fd6c8727a7a0b (diff)
downloadgit-1bf01040f0c1101f410f9caa5e715460cdd0cbe0.zip
git-1bf01040f0c1101f410f9caa5e715460cdd0cbe0.tar.gz
git-1bf01040f0c1101f410f9caa5e715460cdd0cbe0.tar.bz2
add -p: demonstrate failure when running 'edit' after a split
The test passes if one replaces the 'e' command with a 'y' command in the 'add -p' session. Reported-by: Tanky Woo <wtq1990@gmail.com> Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3701-add-interactive.sh')
-rwxr-xr-xt/t3701-add-interactive.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/t/t3701-add-interactive.sh b/t/t3701-add-interactive.sh
index b63b9d4..deae948 100755
--- a/t/t3701-add-interactive.sh
+++ b/t/t3701-add-interactive.sh
@@ -332,6 +332,28 @@ test_expect_success 'split hunk "add -p (edit)"' '
! grep "^+15" actual
'
+test_expect_failure 'split hunk "add -p (no, yes, edit)"' '
+ cat >test <<-\EOF &&
+ 5
+ 10
+ 20
+ 21
+ 30
+ 31
+ 40
+ 50
+ 60
+ EOF
+ git reset &&
+ # test sequence is s(plit), n(o), y(es), e(dit)
+ # q n q q is there to make sure we exit at the end.
+ printf "%s\n" s n y e q n q q |
+ EDITOR=: git add -p 2>error &&
+ test_must_be_empty error &&
+ git diff >actual &&
+ ! grep "^+31" actual
+'
+
test_expect_success 'patch mode ignores unmerged entries' '
git reset --hard &&
test_commit conflict &&