Merge branch 'ta/docfix-index-format-tech'
[gitweb.git] / t / t3701-add-interactive.sh
index b63b9d4c8e60dd1bf8d8591469c533c7d87ad380..deae948c76bd12f9b3ef6b54568717b21d641d8a 100755 (executable)
@@ -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 &&