Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2018-11-29 22:09:21 +0300
committerJunio C Hamano <gitster@pobox.com>2018-11-30 07:49:20 +0300
commit13a5a9f0fdcf36270dcc2dcb7752c281bbea06f1 (patch)
tree2700447a42ead46b95d3bb849ab4db8944296f75 /t/t3406-rebase-message.sh
parent7068cbc4abac53d9c3675dfba81c1e97d25e8eeb (diff)
rebase: fix GIT_REFLOG_ACTION regression
The scripted version of "rebase" honored the `GIT_REFLOG_ACTION`, and some automation scripts expected the reflog entries to be prefixed with "rebase -i", not "rebase", after running "rebase -i". This regressed in the reimplementation in C. Fix that, and add a regression test, both with `GIT_REFLOG_ACTION` set and unset. Note: the reflog message for "rebase finished" did *not* honor GIT_REFLOG_ACTION, and as we are very late in the v2.20.0-rcN phase, we leave that bug for later (as it seems that that bug has been with us from the very beginning). Reported by Ian Jackson. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3406-rebase-message.sh')
-rwxr-xr-xt/t3406-rebase-message.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/t/t3406-rebase-message.sh b/t/t3406-rebase-message.sh
index 38bd876cab..db8505eb86 100755
--- a/t/t3406-rebase-message.sh
+++ b/t/t3406-rebase-message.sh
@@ -91,4 +91,30 @@ test_expect_success 'error out early upon -C<n> or --whitespace=<bad>' '
test_i18ngrep "Invalid whitespace option" err
'
+test_expect_success 'GIT_REFLOG_ACTION' '
+ git checkout start &&
+ test_commit reflog-onto &&
+ git checkout -b reflog-topic start &&
+ test_commit reflog-to-rebase &&
+
+ git rebase reflog-onto &&
+ git log -g --format=%gs -3 >actual &&
+ cat >expect <<-\EOF &&
+ rebase finished: returning to refs/heads/reflog-topic
+ rebase: reflog-to-rebase
+ rebase: checkout reflog-onto
+ EOF
+ test_cmp expect actual &&
+
+ git checkout -b reflog-prefix reflog-to-rebase &&
+ GIT_REFLOG_ACTION=change-the-reflog git rebase reflog-onto &&
+ git log -g --format=%gs -3 >actual &&
+ cat >expect <<-\EOF &&
+ rebase finished: returning to refs/heads/reflog-prefix
+ change-the-reflog: reflog-to-rebase
+ change-the-reflog: checkout reflog-onto
+ EOF
+ test_cmp expect actual
+'
+
test_done