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:
authorPhillip Wood <phillip.wood@dunelm.org.uk>2022-01-26 16:05:47 +0300
committerJunio C Hamano <gitster@pobox.com>2022-01-26 23:08:53 +0300
commit7700ab087b82f71d19134141045b95063e407344 (patch)
tree2d62f412b26cc08708c9fe6d633b5bf64e05b10d /t/t3406-rebase-message.sh
parent6ae8086161d81a707ff36dfdc07f57e4f473e0fd (diff)
rebase --apply: fix reflog
move_to_original_branch() passes the message intended for the branch reflog as `orig_head_msg`. Fix this by adding a `branch_msg` member to struct reset_head_opts and add a regression test. Note that these reflog messages do not respect GIT_REFLOG_ACTION. They are not alone in that and will be fixed in a future series. The "merge" backend already has tests that check both the branch and HEAD reflogs. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3406-rebase-message.sh')
-rwxr-xr-xt/t3406-rebase-message.sh23
1 files changed, 23 insertions, 0 deletions
diff --git a/t/t3406-rebase-message.sh b/t/t3406-rebase-message.sh
index 77a313f62e..d17b450e81 100755
--- a/t/t3406-rebase-message.sh
+++ b/t/t3406-rebase-message.sh
@@ -105,6 +105,29 @@ test_expect_success 'GIT_REFLOG_ACTION' '
test_cmp expect actual
'
+test_expect_success 'rebase --apply reflog' '
+ git checkout -b reflog-apply start &&
+ old_head_reflog="$(git log -g --format=%gs -1 HEAD)" &&
+
+ git rebase --apply Y &&
+
+ git log -g --format=%gs -4 HEAD >actual &&
+ cat >expect <<-EOF &&
+ rebase finished: returning to refs/heads/reflog-apply
+ rebase: Z
+ rebase: checkout Y
+ $old_head_reflog
+ EOF
+ test_cmp expect actual &&
+
+ git log -g --format=%gs -2 reflog-apply >actual &&
+ cat >expect <<-EOF &&
+ rebase finished: refs/heads/reflog-apply onto $(git rev-parse Y)
+ branch: Created from start
+ EOF
+ test_cmp expect actual
+'
+
test_expect_success 'rebase -i onto unrelated history' '
git init unrelated &&
test_commit -C unrelated 1 &&