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>
This commit is contained in:
Phillip Wood
2022-01-26 13:05:44 +00:00
committed by Junio C Hamano
parent 1526d0fcfd
commit b7de153bd9
4 changed files with 9 additions and 13 deletions

View File

@ -4100,8 +4100,7 @@ static enum todo_command peek_command(struct todo_list *todo_list, int offset)
return -1;
}
void create_autostash(struct repository *r, const char *path,
const char *default_reflog_action)
void create_autostash(struct repository *r, const char *path)
{
struct strbuf buf = STRBUF_INIT;
struct lock_file lock_file = LOCK_INIT;
@ -4138,7 +4137,7 @@ void create_autostash(struct repository *r, const char *path,
write_file(path, "%s", oid_to_hex(&oid));
printf(_("Created autostash: %s\n"), buf.buf);
if (reset_head(r, NULL, NULL, RESET_HEAD_HARD, NULL, NULL,
default_reflog_action) < 0)
NULL) < 0)
die(_("could not reset --hard"));
if (discard_index(r->index) < 0 ||