From: Junio C Hamano Date: Fri, 01 Oct 2021 21:03:06 GMT Subject: Re: [PATCH 06/11] reset_head(): make default_reflog_action optional Message-ID: In-Reply-To: <4503defe5912aecc4e6a50ac82a31aa7b230456b.1633082702.git.gitgitgadget@gmail.com> "Phillip Wood via GitGitGadget" writes: > From: Phillip Wood > > This parameter is only needed when a ref is going to be updated and > the caller does not pass an explicit reflog message. Callers that are > just discarding changes in the working tree like create_autostash() do > not update any refs so should not have to worry about passing this > parameter. > > Signed-off-by: Phillip Wood > --- > builtin/merge.c | 6 ++---- > builtin/rebase.c | 14 ++++++-------- > reset.c | 16 ++++++++++++---- > sequencer.c | 6 +++--- > sequencer.h | 3 +-- > 5 files changed, 24 insertions(+), 21 deletions(-) > > diff --git a/builtin/merge.c b/builtin/merge.c > index d2c52b6e971..35833a963fc 100644 > --- a/builtin/merge.c > +++ b/builtin/merge.c > @@ -1561,8 +1561,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix) > > if (autostash) > create_autostash(the_repository, > - git_path_merge_autostash(the_repository), > - "merge"); > + git_path_merge_autostash(the_repository)); > if (checkout_fast_forward(the_repository, > &head_commit->object.oid, > &commit->object.oid, The title talks about an optional change to reset_head(); perhaps a change to create_autostash() should be a separate preliminary step.