summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2019-01-17 16:27:11 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-01-17 21:40:21 (GMT)
commit9e5da3d055c558fc6492d3b996736ff7e8d115c3 (patch)
tree926b700c6e2b8af1d0a206be0c5e27e88b2f739c /cache.h
parent98cdfbb84ad2ed6a2eb43dafa357a70a4b0a0fad (diff)
downloadgit-9e5da3d055c558fc6492d3b996736ff7e8d115c3.zip
git-9e5da3d055c558fc6492d3b996736ff7e8d115c3.tar.gz
git-9e5da3d055c558fc6492d3b996736ff7e8d115c3.tar.bz2
add: use separate ADD_CACHE_RENORMALIZE flag
Commit 9472935d81 (add: introduce "--renormalize", 2017-11-16) taught git-add to pass HASH_RENORMALIZE to add_to_index(), which then passes the flag along to index_path(). However, the flags taken by add_to_index() and the ones taken by index_path() are distinct namespaces. We cannot take HASH_* flags in add_to_index(), because they overlap with the ADD_CACHE_* flags we already take (in this case, HASH_RENORMALIZE conflicts with ADD_CACHE_IGNORE_ERRORS). We can solve this by adding a new ADD_CACHE_RENORMALIZE flag, and using it to set HASH_RENORMALIZE within add_to_index(). In order to make it clear that these two flags come from distinct sets, let's also change the name "newflags" in the function to "hash_flags". Reported-by: Dmitriy Smirnov <dmitriy.smirnov@jetbrains.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index 3f419b6..18ecbe7 100644
--- a/cache.h
+++ b/cache.h
@@ -738,6 +738,7 @@ extern int index_name_pos(const struct index_state *, const char *name, int name
#define ADD_CACHE_JUST_APPEND 8 /* Append only; tree.c::read_tree() */
#define ADD_CACHE_NEW_ONLY 16 /* Do not replace existing ones */
#define ADD_CACHE_KEEP_CACHE_TREE 32 /* Do not invalidate cache-tree */
+#define ADD_CACHE_RENORMALIZE 64 /* Pass along HASH_RENORMALIZE */
extern int add_index_entry(struct index_state *, struct cache_entry *ce, int option);
extern void rename_index_entry_at(struct index_state *, int pos, const char *new_name);