[PATCH 09/32] update-index: be specific what part of the index has changed
From: Nguyễn Thái Ngọc Duy <hidden>
Date: 2016-06-15 23:00:52
Subsystem:
the rest · Maintainer:
Linus Torvalds
Signed-off-by: Nguyễn Thái Ngọc Duy <redacted> --- builtin/update-index.c | 6 +++--- cache.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/builtin/update-index.c b/builtin/update-index.c
index 42cbe4b..e0e881b 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c@@ -56,7 +56,7 @@ static int mark_ce_flags(const char *path, int flag, int mark) else active_cache[pos]->ce_flags &= ~flag; cache_tree_invalidate_path(active_cache_tree, path); - active_cache_changed = 1; + active_cache_changed |= CE_ENTRY_CHANGED; return 0; } return -1;
@@ -268,7 +268,7 @@ static void chmod_path(int flip, const char *path) goto fail; } cache_tree_invalidate_path(active_cache_tree, path); - active_cache_changed = 1; + active_cache_changed |= CE_ENTRY_CHANGED; report("chmod %cx '%s'", flip, path); return; fail:
@@ -889,7 +889,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix) INDEX_FORMAT_LB, INDEX_FORMAT_UB); if (the_index.version != preferred_index_format) - active_cache_changed = 1; + active_cache_changed |= SOMETHING_CHANGED; the_index.version = preferred_index_format; }
diff --git a/cache.h b/cache.h
index d692b74..4133797 100644
--- a/cache.h
+++ b/cache.h@@ -271,6 +271,7 @@ static inline unsigned int canon_mode(unsigned int mode) #define CE_ENTRY_CHANGED (1 << 0) #define CE_ENTRY_REMOVED (1 << 1) #define CE_ENTRY_ADDED (1 << 2) +#define SOMETHING_CHANGED (1 << 3) /* unclassified changes go here */ struct index_state { struct cache_entry **cache;
--
1.9.1.346.ga2b5940