2014-03-18 10:00:52 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
test_description='hunk edit with "commit -p -m"'
|
2024-04-22 22:54:18 +00:00
|
|
|
|
|
|
|
TEST_PASSES_SANITIZE_LEAK=true
|
2014-03-18 10:00:52 +00:00
|
|
|
. ./test-lib.sh
|
|
|
|
|
|
|
|
test_expect_success 'setup (initial)' '
|
|
|
|
echo line1 >file &&
|
|
|
|
git add file &&
|
|
|
|
git commit -m commit1
|
|
|
|
'
|
|
|
|
|
2014-03-18 10:00:53 +00:00
|
|
|
test_expect_success 'edit hunk "commit -p -m message"' '
|
2014-03-18 10:00:52 +00:00
|
|
|
test_when_finished "rm -f editor_was_started" &&
|
|
|
|
rm -f editor_was_started &&
|
|
|
|
echo more >>file &&
|
|
|
|
echo e | env GIT_EDITOR=": >editor_was_started" git commit -p -m commit2 file &&
|
|
|
|
test -r editor_was_started
|
|
|
|
'
|
|
|
|
|
2014-03-18 10:00:53 +00:00
|
|
|
test_expect_success 'edit hunk "commit --dry-run -p -m message"' '
|
2014-03-18 10:00:52 +00:00
|
|
|
test_when_finished "rm -f editor_was_started" &&
|
|
|
|
rm -f editor_was_started &&
|
|
|
|
echo more >>file &&
|
|
|
|
echo e | env GIT_EDITOR=": >editor_was_started" git commit -p -m commit3 file &&
|
|
|
|
test -r editor_was_started
|
|
|
|
'
|
|
|
|
|
|
|
|
test_done
|