aboutsummaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-08-26 11:13:12 -0700
committerJunio C Hamano <gitster@pobox.com>2022-08-26 11:13:13 -0700
commit7be9f3f3353acc1e9478aaed5afe2b0778388a69 (patch)
tree34f13edbcf701407c834abba4ab944f774c71493 /cache.h
parente5cb51d3aa2e522a571a74a9664a538a40fc7d64 (diff)
parentb15207b8cf1a1930fe5eb076c08c6ddc92d9282d (diff)
downloadgit-7be9f3f3353acc1e9478aaed5afe2b0778388a69.tar.xz
Merge branch 'vd/sparse-reset-checkout-fixes' into maint
Fixes to sparse index compatibility work for "reset" and "checkout" commands. source: <pull.1312.v3.git.1659985672.gitgitgadget@gmail.com> * vd/sparse-reset-checkout-fixes: unpack-trees: unpack new trees as sparse directories cache.h: create 'index_name_pos_sparse()' oneway_diff: handle removed sparse directories checkout: fix nested sparse directory diff in sparse index
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index ac5ab4ef9d..33fc8337c6 100644
--- a/cache.h
+++ b/cache.h
@@ -831,6 +831,15 @@ 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);
/*
+ * Like index_name_pos, returns the position of an entry of the given name in
+ * the index if one exists, otherwise returns a negative value where the negated
+ * value minus 1 is the position where the index entry would be inserted. Unlike
+ * index_name_pos, however, a sparse index is not expanded to find an entry
+ * inside a sparse directory.
+ */
+int index_name_pos_sparse(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