summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2020-01-22 15:07:32 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-01-22 15:07:32 -0800
commit09e393d913072d7765b02aba1210d843a83cfbae (patch)
treeafb7a732a76346f4c3c9451c446c696326fa104d /builtin
parentMerge branch 'jk/no-flush-upon-disconnecting-slrpc-transport' (diff)
parentrestore: invalidate cache-tree when removing entries with --staged (diff)
downloadtgif-09e393d913072d7765b02aba1210d843a83cfbae.tar.xz
Merge branch 'nd/switch-and-restore'
"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 b52c490c8f..18ef5fb975 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.