merge: fix save_state() to work when there are stat-dirty files
commit1369f1475b998b0022f9bdf3a084ef6e590800aa
authorElijah Newren <newren@gmail.com>
Sat, 23 Jul 2022 01:53:15 +0000 (23 01:53 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sat, 23 Jul 2022 04:45:23 +0000 (22 21:45 -0700)
tree5f3a52677ecca8fa030cf3c09a5c156b2da03717
parent8f240b8bbb63591f15c10e43debaf564e63a66bd
merge: fix save_state() to work when there are stat-dirty files

When there are stat-dirty files, but no files are modified,
`git stash create` exits with unsuccessful status.  This causes merge
to fail.  Copy some code from sequencer.c's create_autostash to refresh
the index first to avoid this problem.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/merge.c
t/t6424-merge-unrelated-index-changes.sh