| 1 | #!/bin/sh |
| 2 | |
| 3 | test_description='hunk edit with "commit -p -m"' |
| 4 | |
| 5 | . ./test-lib.sh |
| 6 | |
| 7 | test_expect_success 'setup (initial)' ' |
| 8 | echo line1 >file && |
| 9 | git add file && |
| 10 | git commit -m commit1 |
| 11 | ' |
| 12 | |
| 13 | test_expect_success 'edit hunk "commit -p -m message"' ' |
| 14 | test_when_finished "rm -f editor_was_started" && |
| 15 | rm -f editor_was_started && |
| 16 | echo more >>file && |
| 17 | echo e | env GIT_EDITOR=": >editor_was_started" git commit -p -m commit2 file && |
| 18 | test -r editor_was_started |
| 19 | ' |
| 20 | |
| 21 | test_expect_success 'edit hunk "commit --dry-run -p -m message"' ' |
| 22 | test_when_finished "rm -f editor_was_started" && |
| 23 | rm -f editor_was_started && |
| 24 | echo more >>file && |
| 25 | echo e | env GIT_EDITOR=": >editor_was_started" git commit -p -m commit3 file && |
| 26 | test -r editor_was_started |
| 27 | ' |
| 28 | |
| 29 | test_done |