summaryrefslogtreecommitdiffstats
path: root/builtin
diff options
context:
space:
mode:
authorPhillip Wood <phillip.wood@dunelm.org.uk>2022-01-26 14:05:44 +0100
committerJunio C Hamano <gitster@pobox.com>2022-01-26 21:08:53 +0100
commitb7de153bd9332a992baa6f937372f0b1833f61e5 (patch)
tree6e240d23a6a0d2a85262d9588f52994276f3c241 /builtin
parentreset_head(): make default_reflog_action optional (diff)
downloadgit-b7de153bd9332a992baa6f937372f0b1833f61e5.tar.xz
git-b7de153bd9332a992baa6f937372f0b1833f61e5.zip
create_autostash(): remove unneeded parameter
The default_reflog parameter of create_autostash() is passed to reset_head(). However as creating a stash does not involve updating any refs the parameter is not used by reset_head(). Removing the parameter from create_autostash() simplifies the callers. Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/merge.c6
-rw-r--r--builtin/rebase.c8
2 files changed, 6 insertions, 8 deletions
diff --git a/builtin/merge.c b/builtin/merge.c
index ea3112e0c0..cb0e4e2225 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -1565,8 +1565,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,
@@ -1637,8 +1636,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));
/* We are going to make a new commit. */
git_committer_info(IDENT_STRICT);
diff --git a/builtin/rebase.c b/builtin/rebase.c
index 82be965915..3d78b5c8be 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -1657,10 +1657,10 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
if (repo_read_index(the_repository) < 0)
die(_("could not read index"));
- if (options.autostash) {
- create_autostash(the_repository, state_dir_path("autostash", &options),
- DEFAULT_REFLOG_ACTION);
- }
+ if (options.autostash)
+ create_autostash(the_repository,
+ state_dir_path("autostash", &options));
+
if (require_clean_work_tree(the_repository, "rebase",
_("Please commit or stash them."), 1, 1)) {