Re: [PATCH v2 2/9] index_has_changes(): avoid assuming operating on the_index
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 3, 2018, 19:44 UTC
- Message-ID
- <xmqq601wqf3u.fsf@gitster-ct.c.googlers.com>
- In-Reply-To
- <20180701012503.14382-3-newren@gmail.com>
Elijah Newren <newren@gmail.com> writes:
Show 6 quoted lines
> Modify index_has_changes() to take a struct istate* instead of just > operating on the_index. This is only a partial conversion, though, > because we call do_diff_cache() which implicitly assumes work is to be > done on the_index. Ongoing work is being done elsewhere to do the > remainder of the conversion, and thus is not duplicated here. Instead, > a simple check is put in place until that work is complete.
Yeah, that is an unfortunate but necessary compromise until we create do_diff_index() that can take an istate, and optionally turn do_diff_cache() into
#define do_diff_cache(...) do_diff_index(&the_index, ...)
if there are many callers that want to work on the default in-core istate.