diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-11-10 12:02:12 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-11-10 12:02:12 +0300 |
commit | 5c8c0a0d78b0e0ee50ba13823f0cfbee05334461 (patch) | |
tree | 8b4ebc4676440e47f24351824e16a072796772d1 /t/lib-rebase.sh | |
parent | b75ba9bbd13877ff3351e150d3d053baec81f0db (diff) | |
parent | 4627bc777e9ade5e3a85d6b8e8630fc4b6e2f8f6 (diff) |
Merge branch 'pw/post-commit-from-sequencer'
"rebase -i" ceased to run post-commit hook by mistake in an earlier
update, which has been corrected.
* pw/post-commit-from-sequencer:
sequencer: run post-commit hook
move run_commit_hook() to libgit and use it there
sequencer.h fix placement of #endif
t3404: remove uneeded calls to set_fake_editor
t3404: set $EDITOR in subshell
t3404: remove unnecessary subshell
Diffstat (limited to 't/lib-rebase.sh')
-rw-r--r-- | t/lib-rebase.sh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/t/lib-rebase.sh b/t/lib-rebase.sh index 6d87961e41..b72c051f47 100644 --- a/t/lib-rebase.sh +++ b/t/lib-rebase.sh @@ -119,3 +119,31 @@ make_empty () { git commit --allow-empty -m "$1" && git tag "$1" } + +# Call this (inside test_expect_success) at the end of a test file to +# check that no tests have changed editor related environment +# variables or config settings +test_editor_unchanged () { + # We're only interested in exported variables hence 'sh -c' + sh -c 'cat >actual <<-EOF + EDITOR=$EDITOR + FAKE_COMMIT_AMEND=$FAKE_COMMIT_AMEND + FAKE_COMMIT_MESSAGE=$FAKE_COMMIT_MESSAGE + FAKE_LINES=$FAKE_LINES + GIT_EDITOR=$GIT_EDITOR + GIT_SEQUENCE_EDITOR=$GIT_SEQUENCE_EDITOR + core.editor=$(git config core.editor) + sequence.editor=$(git config sequence.editor) + EOF' + cat >expect <<-\EOF + EDITOR=: + FAKE_COMMIT_AMEND= + FAKE_COMMIT_MESSAGE= + FAKE_LINES= + GIT_EDITOR= + GIT_SEQUENCE_EDITOR= + core.editor= + sequence.editor= + EOF + test_cmp expect actual +} |