summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-02-05 22:26:17 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-02-05 22:26:17 (GMT)
commit69dd6e57374f4aa5dcda0736529be47b16a08afe (patch)
tree580c5fd6f1360d82a911ac18108a2afd1b9d649a /t
parent5d2710bd3c706c3375991972b630f9419551f24e (diff)
parent891d4a0313edc03f7e2ecb96edec5d30dc182294 (diff)
downloadgit-69dd6e57374f4aa5dcda0736529be47b16a08afe.zip
git-69dd6e57374f4aa5dcda0736529be47b16a08afe.tar.gz
git-69dd6e57374f4aa5dcda0736529be47b16a08afe.tar.bz2
Merge branch 'pw/no-editor-in-rebase-i-implicit'
When GIT_SEQUENCE_EDITOR is set, the command was incorrectly started when modes of "git rebase" that implicitly uses the machinery for the interactive rebase are run, which has been corrected. * pw/no-editor-in-rebase-i-implicit: implicit interactive rebase: don't run sequence editor
Diffstat (limited to 't')
-rwxr-xr-xt/t3404-rebase-interactive.sh5
-rwxr-xr-xt/t3430-rebase-merges.sh2
-rwxr-xr-xt/t7505-prepare-commit-msg-hook.sh10
3 files changed, 11 insertions, 6 deletions
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 7a440e0..2b96174 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -156,6 +156,11 @@ test_expect_success 'rebase -i with exec of inexistent command' '
! grep "Maybe git-rebase is broken" actual
'
+test_expect_success 'implicit interactive rebase does not invoke sequence editor' '
+ test_when_finished "git rebase --abort ||:" &&
+ GIT_SEQUENCE_EDITOR="echo bad >" git rebase -x"echo one" @^
+'
+
test_expect_success 'no changes are a nop' '
git checkout branch2 &&
set_fake_editor &&
diff --git a/t/t3430-rebase-merges.sh b/t/t3430-rebase-merges.sh
index cc56468..4c69255 100755
--- a/t/t3430-rebase-merges.sh
+++ b/t/t3430-rebase-merges.sh
@@ -125,7 +125,7 @@ test_expect_success '`reset` refuses to overwrite untracked files' '
: >dont-overwrite-untracked.t &&
echo "reset refs/tags/dont-overwrite-untracked" >script-from-scratch &&
test_config sequence.editor \""$PWD"/replace-editor.sh\" &&
- test_must_fail git rebase -r HEAD &&
+ test_must_fail git rebase -ir HEAD &&
git rebase --abort
'
diff --git a/t/t7505-prepare-commit-msg-hook.sh b/t/t7505-prepare-commit-msg-hook.sh
index ebfcad9..ba8bd1b 100755
--- a/t/t7505-prepare-commit-msg-hook.sh
+++ b/t/t7505-prepare-commit-msg-hook.sh
@@ -215,7 +215,7 @@ test_expect_success 'with hook and editor (merge)' '
test_rebase () {
expect=$1 &&
mode=$2 &&
- test_expect_$expect C_LOCALE_OUTPUT "with hook (rebase $mode)" '
+ test_expect_$expect C_LOCALE_OUTPUT "with hook (rebase ${mode:--i})" '
test_when_finished "\
git rebase --abort
git checkout -f master
@@ -225,7 +225,7 @@ test_rebase () {
GIT_EDITOR="\"$FAKE_EDITOR\"" &&
(
export GIT_SEQUENCE_EDITOR GIT_EDITOR &&
- test_must_fail git rebase $mode b &&
+ test_must_fail git rebase -i $mode b &&
echo x >a &&
git add a &&
test_must_fail git rebase --continue &&
@@ -241,18 +241,18 @@ test_rebase () {
git add b &&
git rebase --continue
) &&
- if test $mode = -p # reword amended after pick
+ if test "$mode" = -p # reword amended after pick
then
n=18
else
n=17
fi &&
git log --pretty=%s -g -n$n HEAD@{1} >actual &&
- test_cmp "$TEST_DIRECTORY/t7505/expected-rebase$mode" actual
+ test_cmp "$TEST_DIRECTORY/t7505/expected-rebase${mode:--i}" actual
'
}
-test_rebase success -i
+test_rebase success
test_have_prereq !REBASE_P || test_rebase success -p
test_expect_success 'with hook (cherry-pick)' '