]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/update-index.c
Merge branch 'en/fetch-negotiation-default-fix'
[thirdparty/git.git] / builtin / update-index.c
index 187203e8bb53cbeaf80d2f4b89c04134a2a5c95f..7e0a0d9bf80916ceb8509af5b914a5649676ef8a 100644 (file)
@@ -787,6 +787,17 @@ static int refresh(struct refresh_params *o, unsigned int flag)
        setup_work_tree();
        read_cache();
        *o->has_errors |= refresh_cache(o->flags | flag);
+       if (has_racy_timestamp(&the_index)) {
+               /*
+                * Even if nothing else has changed, updating the file
+                * increases the chance that racy timestamps become
+                * non-racy, helping future run-time performance.
+                * We do that even in case of "errors" returned by
+                * refresh_cache() as these are no actual errors.
+                * cmd_status() does the same.
+                */
+               active_cache_changed |= SOMETHING_CHANGED;
+       }
        return 0;
 }