提交 91c9c869 编写于 作者: B Benoit Pierre 提交者: Junio C Hamano

test patch hunk editing with "commit -p -m"

Add (failing) tests: with commit changing the environment to let hooks
know that no editor will be used (by setting GIT_EDITOR to ":"), the
"edit hunk" functionality does not work (no editor is launched and the
whole hunk is committed).
Signed-off-by: NBenoit Pierre <benoit.pierre@gmail.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 b7ae1414
#!/bin/sh
test_description='hunk edit with "commit -p -m"'
. ./test-lib.sh
if ! test_have_prereq PERL
then
skip_all="skipping '$test_description' tests, perl not available"
test_done
fi
test_expect_success 'setup (initial)' '
echo line1 >file &&
git add file &&
git commit -m commit1
'
test_expect_failure 'edit hunk "commit -p -m message"' '
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
'
test_expect_failure 'edit hunk "commit --dry-run -p -m message"' '
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
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册