mirror of
https://github.com/git/git.git
synced 2024-12-29 11:44:13 +08:00
15048f8a9a
Don't change git environment: move the GIT_EDITOR=":" override to the hook command subprocess, like it's already done for GIT_INDEX_FILE. Signed-off-by: Benoit Pierre <benoit.pierre@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
35 lines
855 B
Bash
Executable File
35 lines
855 B
Bash
Executable File
#!/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_success '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_success '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
|