Skip to content

Commit 33f2b61

Browse files
phillipwoodgitster
authored andcommitted
rebase --apply: respect GIT_REFLOG_ACTION
The reflog messages when finishing a rebase hard code "rebase" rather than using GIT_REFLOG_ACTION. Signed-off-by: Phillip Wood <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1f2d5dc commit 33f2b61

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

builtin/rebase.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -582,10 +582,11 @@ static int move_to_original_branch(struct rebase_options *opts)
582582
if (!opts->onto)
583583
BUG("move_to_original_branch without onto");
584584

585-
strbuf_addf(&branch_reflog, "rebase finished: %s onto %s",
585+
strbuf_addf(&branch_reflog, "%s finished: %s onto %s",
586+
getenv(GIT_REFLOG_ACTION_ENVIRONMENT),
586587
opts->head_name, oid_to_hex(&opts->onto->object.oid));
587-
strbuf_addf(&head_reflog, "rebase finished: returning to %s",
588-
opts->head_name);
588+
strbuf_addf(&head_reflog, "%s finished: returning to %s",
589+
getenv(GIT_REFLOG_ACTION_ENVIRONMENT), opts->head_name);
589590
ropts.branch = opts->head_name;
590591
ropts.flags = RESET_HEAD_REFS_ONLY;
591592
ropts.branch_msg = branch_reflog.buf;

t/t3406-rebase-message.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ test_expect_success 'error out early upon -C<n> or --whitespace=<bad>' '
8888
write_reflog_expect () {
8989
if test $mode = --apply
9090
then
91-
sed 's/.*(finish)/rebase finished/; s/ ([^)]*)//'
91+
sed 's/(finish)/finished/; s/ ([^)]*)//'
9292
else
9393
cat
9494
fi >expect

0 commit comments

Comments
 (0)