]> git.ipfire.org Git - thirdparty/git.git/blobdiff - fsmonitor.h
fetch: teach independent negotiation (no packfile)
[thirdparty/git.git] / fsmonitor.h
index 7f1794b90b001cbc07991fd12e8cd7aaebe6cdfd..f20d72631d76b4b5e7d7cff75a833215a5d57a71 100644 (file)
@@ -49,6 +49,17 @@ void refresh_fsmonitor(struct index_state *istate);
  */
 int fsmonitor_is_trivial_response(const struct strbuf *query_result);
 
+/*
+ * Check if refresh_fsmonitor has been called at least once.
+ * refresh_fsmonitor is idempotent. Returns true if fsmonitor is
+ * not enabled (since the state will be "fresh" w/ CE_FSMONITOR_VALID unset)
+ * This version is useful for assertions
+ */
+static inline int is_fsmonitor_refreshed(const struct index_state *istate)
+{
+       return !core_fsmonitor || istate->fsmonitor_has_run_once;
+}
+
 /*
  * Set the given cache entries CE_FSMONITOR_VALID bit. This should be
  * called any time the cache entry has been updated to reflect the