Re: [PATCH v12 09/20] read-cache: add watchman 'WAMA' extension
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Jun 25, 2016, 14:59 UTC
- Message-ID
- <CACsJy8CG3y3VM-RgzV8G46BP5POqEV7vBa5uN-5GJq4gSEKx3A@mail.gmail.com>
- In-Reply-To
- <1463694357-6503-10-git-send-email-dturner@twopensource.com>
On Thu, May 19, 2016 at 11:45 PM, David Turner <dturner@twopensource.com> wrote:
Show 7 quoted lines
> @@ -1222,8 +1225,13 @@ int refresh_index(struct index_state *istate, unsigned int flags,
> continue;
>
> new = refresh_cache_ent(istate, ce, options, &cache_errno, &changed);
> - if (new == ce)
> + if (new == ce) {
> + if (ce->ce_flags & CE_WATCHMAN_DIRTY) {I would add a note here since it took me a bit of time to understand why we cleared this. Maybe something like this?
"The rule is index-helper sets watchman-dirty when a file is changed, then git clears it when it has verified that in-index entry now matches the worktree version. index-helper does not clear the bit and git does not set it. We have verified here that stat info (and even content) matches, so it's safe to clear watchman-dirty now"
-- Duy