On Wed, Jul 9, 2014 at 12:05 AM, Junio C Hamano <gits...@pobox.com> wrote:
> Duy Nguyen <pclo...@gmail.com> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to