diff options
author | Philippe Blain <levraiphilippeblain@gmail.com> | 2021-07-23 12:14:30 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-07-23 15:45:40 -0700 |
commit | e082631e51ebe2c7ee6756a3b45d10732a6480df (patch) | |
tree | f70a246b2fa63ba5518d0e1fe75578992aaa1d18 /Documentation/config/man.txt | |
parent | merge: apply autostash if fast-forward fails (diff) | |
download | tgif-e082631e51ebe2c7ee6756a3b45d10732a6480df.tar.xz |
merge: apply autostash if merge strategy fails
Since 'git merge' learned '--autostash' in a03b55530a (merge: teach
--autostash option, 2020-04-07), 'cmd_merge', once it is determined that
we have to create a merge commit, calls 'create_autostash' if
'--autostash' is given.
As explained in a03b55530a, and made more abvious by the tests added in
that commit, the autostash is then applied if the merge succeeds, either
directly or by committing (after conflict resolution or if '--no-commit'
was given), or if the merge is aborted with 'git merge --abort'. In some
other cases, like the user calling 'git reset --merge' or 'git merge
--quit', the autostash is not applied, but saved in the stash list.
However, there exists a scenario that creates an autostash but does not
apply nor save it to the stash list: if the chosen merge strategy
completely fails to handle the merge, i.e. 'try_merge_strategy' returns
2.
Apply the autostash in that case also. An easy way to test that is to
try to merge more than two commits but explicitely ask for the 'recursive'
merge strategy.
Signed-off-by: Philippe Blain <levraiphilippeblain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation/config/man.txt')
0 files changed, 0 insertions, 0 deletions