[PATCH v4 18/24] update-index.c: rewrite index when index-version is given
- From
Thomas Gummerer <t.gummerer@gmail.com>
- Date
- Nov 27, 2013, 12:00 UTC
- Message-ID
- <1385553659-9928-19-git-send-email-t.gummerer@gmail.com>
- In-Reply-To
- <1385553659-9928-1-git-send-email-t.gummerer@gmail.com>
Make update-index always rewrite the index when a index-version is given, even if the index already has the right version. This option is used for performance testing the writer and reader.
Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> --- builtin/update-index.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/builtin/update-index.c b/builtin/update-index.c index c5bb889..8b3f7a0 100644 --- a/builtin/update-index.c +++ b/builtin/update-index.c @@ -6,6 +6,7 @@ #include "cache.h" #include "quote.h" #include "cache-tree.h" +#include "read-cache.h" #include "tree-walk.h" #include "builtin.h" #include "refs.h" @@ -861,8 +862,7 @@ int cmd_update_index(int argc, const char **argv, const char *prefix) preferred_index_format, INDEX_FORMAT_LB, INDEX_FORMAT_UB); - if (the_index.version != preferred_index_format) - active_cache_changed = 1; + active_cache_changed = 1; change_cache_version(preferred_index_format); }
-- 1.8.4.2