diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-09-13 12:21:11 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-09-13 12:21:11 -0700 |
commit | 2c75b3255b1d1f525c7c61b540b99af1ad84e8f8 (patch) | |
tree | 34494132932eb5d43799c67a4cd9e087b72df58a /builtin/merge.c | |
parent | 4f06dfde7aa55a444600c804559b44bf9bf764d2 (diff) | |
parent | d3a9295ada961012bfe8582540e40a02e772aa09 (diff) |
Merge branch 'en/merge-unstash-only-on-clean-merge' into maint
The auto-stashed local changes created by "git merge --autostash"
was mixed into a conflicted state left in the working tree, which
has been corrected.
* en/merge-unstash-only-on-clean-merge:
merge: only apply autostash when appropriate
Diffstat (limited to 'builtin/merge.c')
-rw-r--r-- | builtin/merge.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/builtin/merge.c b/builtin/merge.c index d9784d4891..fcd87a2a09 100644 --- a/builtin/merge.c +++ b/builtin/merge.c @@ -493,7 +493,8 @@ static void finish(struct commit *head_commit, /* Run a post-merge hook */ run_hooks_l("post-merge", squash ? "1" : "0", NULL); - apply_autostash(git_path_merge_autostash(the_repository)); + if (new_head) + apply_autostash(git_path_merge_autostash(the_repository)); strbuf_release(&reflog_message); } @@ -1756,6 +1757,8 @@ int cmd_merge(int argc, const char **argv, const char *prefix) "stopped before committing as requested\n")); else ret = suggest_conflicts(); + if (autostash) + printf(_("When finished, apply stashed changes with `git stash pop`\n")); done: if (!automerge_was_ok) { |