From: Junio C Hamano Date: Wed, 08 Jan 2020 15:41:39 GMT Subject: Re: [PATCH] restore: invalidate cache-tree when removing entries with --staged Message-ID: In-Reply-To: <20200108114344.GA3380580@coredump.intra.peff.net> Jeff King writes: > 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); Ah, I was wondering why we were seeing breakages on cache-tree, which is fairly old and stable part of the system---even though it had caused us quite a lot of pain while it was growing---all of a sudden. No wonder---this codepath is a fairly new one, introduced when "restore" was added X-<. And the fix looks right, of course. Thanks for extracting a reproducible recipe out of the original reporter and quickly diagnosing it. Very much appreciated.