From: Duy Nguyen Date: Wed, 09 Jul 2014 01:58:31 GMT Subject: Re: [PATCH v4 4/4] cache-tree: Write updated cache-tree after commit Message-ID: In-Reply-To: On Wed, Jul 9, 2014 at 12:05 AM, Junio C Hamano wrote: > Duy Nguyen writes: > >> I wonder if we need to update_main_cache_tree() so many times in this >> function. If I read the code correctly, all roads must lead to >> update_main_cache_tree(0) in prepare_to_commit(). > > I think prepare-to-commit is too late; it does not want to know if > the index it was given to create a tree out of is the one that the > user will keep using after this invocation of "git commit" or just a > temporary one used for partial commit. The cache-tree rebuilt there > is what is recorded with commit_tree_extended() in cmd_commit(), but > if you are doing a partial commit, these generic code paths are > given a temporary index file on the filesystem to work on, and > cache-tree in that will not help user's later operation. Right. Thanks for checking. -- Duy