Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH 1/2] diff-lib: simplify do_diff_cache()

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:51:37

Jeff King [off-list ref] writes:
On Tue, Jul 19, 2011 at 11:13:05AM -0700, Junio C Hamano wrote:
quoted
Since 34110cd (Make 'unpack_trees()' have a separate source and
destination index, 2008-03-06), we can run unpack_trees() without munging
the index at all, but do_diff_cache() tried ever so carefully to work
around the old behaviour of the function.

We can just tell unpack_trees() not to touch the original index and there
is no need to clean-up whatever the previous round has done.
Can we drop the calls to discard_cache in reset.c now?
Possibly, along with "index-was-discarded" flag bit.
$ git grep -B1 discard_cache builtin/reset.c
builtin/reset.c-        /* do_diff_cache() mangled the index */
builtin/reset.c:        discard_cache();
--
builtin/reset.c-                /* The index is still clobbered from do_diff_cache() */
builtin/reset.c:                discard_cache();

-Peff
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help