Skip to content

Commit 1f2d5dc

Browse files
phillipwoodgitster
authored andcommitted
rebase --merge: fix reflog message after skipping
The reflog message for every pick after running "rebase --skip" looks like rebase (skip) (pick): commit subject line Fix this by not appending " (skip)" to the reflog action. Signed-off-by: Phillip Wood <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent da1d633 commit 1f2d5dc

File tree

2 files changed

+24
-2
lines changed

2 files changed

+24
-2
lines changed

builtin/rebase.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,8 +1297,6 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
12971297
struct string_list merge_rr = STRING_LIST_INIT_DUP;
12981298

12991299
options.action = "skip";
1300-
set_reflog_action(&options);
1301-
13021300
rerere_clear(the_repository, &merge_rr);
13031301
string_list_clear(&merge_rr, 1);
13041302
ropts.flags = RESET_HEAD_HARD;

t/t3406-rebase-message.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,30 @@ test_reflog () {
163163
# check there is only one new entry in the branch reflog
164164
test_cmp_rev fast-forward@{1} X
165165
'
166+
167+
test_expect_success "rebase $mode --skip reflog${reflog_action:+ GIT_REFLOG_ACTION=$reflog_action}" '
168+
git checkout conflicts &&
169+
test_when_finished "git reset --hard Q" &&
170+
171+
(
172+
if test -n "$reflog_action"
173+
then
174+
GIT_REFLOG_ACTION="$reflog_action" &&
175+
export GIT_REFLOG_ACTION
176+
fi &&
177+
test_must_fail git rebase $mode main &&
178+
git rebase --skip
179+
) &&
180+
181+
git log -g --format=%gs -4 >actual &&
182+
write_reflog_expect <<-EOF &&
183+
${reflog_action:-rebase} (finish): returning to refs/heads/conflicts
184+
${reflog_action:-rebase} (pick): Q
185+
${reflog_action:-rebase} (pick): P
186+
${reflog_action:-rebase} (start): checkout main
187+
EOF
188+
test_cmp expect actual
189+
'
166190
}
167191

168192
test_reflog --merge

0 commit comments

Comments
 (0)