From 8e1957dae51172ed71f84624340d1140e091327e Mon Sep 17 00:00:00 2001 From: Tyrie Vella Date: Tue, 9 Sep 2025 07:53:06 -0700 Subject: [PATCH] Set updated_skipworktree on restore --staged --- builtin/checkout.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/builtin/checkout.c b/builtin/checkout.c index c4b4f36a03a022..8384988424c81d 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -641,6 +641,10 @@ static int checkout_paths(const struct checkout_opts *opts, checkout_index = opts->checkout_index; if (checkout_index) { + /* Some scenarios may update skipworktree bits, such as + * `restore --staged` after `cherry-pick -n` or `reset --soft` + */ + the_repository->index->updated_skipworktree = 1; if (write_locked_index(the_repository->index, &lock_file, COMMIT_LOCK)) die(_("unable to write new index file")); } else {