diff --git a/builtin/merge.c b/builtin/merge.c index 5900b81729..a6698adbfd 100644 --- a/builtin/merge.c +++ b/builtin/merge.c @@ -1794,5 +1794,6 @@ done: } strbuf_release(&buf); free(branch_to_free); + discard_index(&the_index); return ret; } diff --git a/builtin/reset.c b/builtin/reset.c index fdce6f8c85..69f18a248e 100644 --- a/builtin/reset.c +++ b/builtin/reset.c @@ -481,5 +481,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix) if (!pathspec.nr) remove_branch_state(the_repository, 0); + discard_index(&the_index); + return update_ref_status; }