Skip to content

Commit 3bd326c

Browse files
author
Tyrie Vella
committed
Set updated_skipworktree on restore --staged
1 parent 336bf91 commit 3bd326c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

builtin/checkout.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -641,6 +641,10 @@ static int checkout_paths(const struct checkout_opts *opts,
641641
checkout_index = opts->checkout_index;
642642

643643
if (checkout_index) {
644+
/* Some scenarios may update skipworktree bits, such as
645+
* `restore --staged` after `cherry-pick -n` or `reset --soft`
646+
*/
647+
the_repository->index->updated_skipworktree = 1;
644648
if (write_locked_index(the_repository->index, &lock_file, COMMIT_LOCK))
645649
die(_("unable to write new index file"));
646650
} else {

0 commit comments

Comments
 (0)