summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-02-14 20:42:29 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-02-14 20:42:29 (GMT)
commite361f36f61b664a36db1d34c3f9e3427ac42656d (patch)
tree3a34e8dbb31faa251fd7865a8b0aebef76dd3ff7 /builtin
parent4a60c63a75e546005b1c1222ae85ea504a0ee852 (diff)
parente701bab3e95f7029e59717eab610a544821b2213 (diff)
downloadgit-e361f36f61b664a36db1d34c3f9e3427ac42656d.zip
git-e361f36f61b664a36db1d34c3f9e3427ac42656d.tar.gz
git-e361f36f61b664a36db1d34c3f9e3427ac42656d.tar.bz2
Merge branch 'nd/switch-and-restore' into maint
"git restore --staged" did not correctly update the cache-tree structure, resulting in bogus trees to be written afterwards, which has been corrected. * nd/switch-and-restore: restore: invalidate cache-tree when removing entries with --staged
Diffstat (limited to 'builtin')
-rw-r--r--builtin/checkout.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/checkout.c b/builtin/checkout.c
index b52c490..18ef5fb 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -524,6 +524,8 @@ static int checkout_paths(const struct checkout_opts *opts,
/* Now we are committed to check them out */
if (opts->checkout_worktree)
errs |= checkout_worktree(opts);
+ else
+ remove_marked_cache_entries(&the_index, 1);
/*
* Allow updating the index when checking out from the index.