summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2021-11-29 12:53:56 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2021-11-29 12:53:56 -0800
commitea6ae410bedd6eee1968d24aa267b22ce7a0305a (patch)
treec7944281eb3c1f4f63de7d0ca05058166b5e1628 /cache.h
parentThirteenth batch (diff)
parentunpack-trees: improve performance of next_cache_entry (diff)
downloadtgif-ea6ae410bedd6eee1968d24aa267b22ce7a0305a.tar.xz
Merge branch 'vd/sparse-reset' into ld/sparse-diff-blame
* vd/sparse-reset: unpack-trees: improve performance of next_cache_entry reset: make --mixed sparse-aware reset: make sparse-aware (except --mixed) reset: integrate with sparse index reset: expand test coverage for sparse checkouts sparse-index: update command for expand/collapse test reset: preserve skip-worktree bit in mixed reset reset: rename is_missing to !is_in_reset_tree
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index d092820c94..517859d8b8 100644
--- a/cache.h
+++ b/cache.h
@@ -817,6 +817,16 @@ struct cache_entry *index_file_exists(struct index_state *istate, const char *na
int index_name_pos(struct index_state *, const char *name, int namelen);
/*
+ * Determines whether an entry with the given name exists within the
+ * given index. The return value is 1 if an exact match is found, otherwise
+ * it is 0. Note that, unlike index_name_pos, this function does not expand
+ * the index if it is sparse. If an item exists within the full index but it
+ * is contained within a sparse directory (and not in the sparse index), 0 is
+ * returned.
+ */
+int index_entry_exists(struct index_state *, const char *name, int namelen);
+
+/*
* Some functions return the negative complement of an insert position when a
* precise match was not found but a position was found where the entry would
* need to be inserted. This helper protects that logic from any integer