]> git.ipfire.org Git - thirdparty/git.git/commitdiff
rebase --apply: respect GIT_REFLOG_ACTION
authorPhillip Wood <phillip.wood@dunelm.org.uk>
Wed, 12 Oct 2022 09:35:09 +0000 (09:35 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 17 Oct 2022 19:55:03 +0000 (12:55 -0700)
The reflog messages when finishing a rebase hard code "rebase" rather
than using GIT_REFLOG_ACTION.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/rebase.c
t/t3406-rebase-message.sh

index c1e68173b5ffcd9834f8238d6e7d6b8a0ac2cf61..ea246c6bb3ab52652095abc263bb4f7196936d8c 100644 (file)
@@ -582,10 +582,11 @@ static int move_to_original_branch(struct rebase_options *opts)
        if (!opts->onto)
                BUG("move_to_original_branch without onto");
 
-       strbuf_addf(&branch_reflog, "rebase finished: %s onto %s",
+       strbuf_addf(&branch_reflog, "%s finished: %s onto %s",
+                   getenv(GIT_REFLOG_ACTION_ENVIRONMENT),
                    opts->head_name, oid_to_hex(&opts->onto->object.oid));
-       strbuf_addf(&head_reflog, "rebase finished: returning to %s",
-                   opts->head_name);
+       strbuf_addf(&head_reflog, "%s finished: returning to %s",
+                   getenv(GIT_REFLOG_ACTION_ENVIRONMENT), opts->head_name);
        ropts.branch = opts->head_name;
        ropts.flags = RESET_HEAD_REFS_ONLY;
        ropts.branch_msg = branch_reflog.buf;
index 8aa6a79acc13fef1eb7951d65e6259d1c9c06633..bb2a4949abcc8852b50f57bd826d0e4091823cb0 100755 (executable)
@@ -88,7 +88,7 @@ test_expect_success 'error out early upon -C<n> or --whitespace=<bad>' '
 write_reflog_expect () {
        if test $mode = --apply
        then
-               sed 's/.*(finish)/rebase finished/; s/ ([^)]*)//'
+               sed 's/(finish)/finished/; s/ ([^)]*)//'
        else
                cat
        fi >expect