summaryrefslogtreecommitdiff
path: root/test-dump-split-index.c
diff options
context:
space:
mode:
authorDavid Turner <dturner@twopensource.com>2015-08-27 17:07:54 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-08-31 15:41:07 (GMT)
commit475a34451f86d1b954c5da37f04ed044544cf6e4 (patch)
tree4e41cc4a71da24cfd4a40260b05d2f45b8949299 /test-dump-split-index.c
parent52f6893d356fd04ba350e5b7dd468b2181844521 (diff)
downloadgit-475a34451f86d1b954c5da37f04ed044544cf6e4.zip
git-475a34451f86d1b954c5da37f04ed044544cf6e4.tar.gz
git-475a34451f86d1b954c5da37f04ed044544cf6e4.tar.bz2
commit: don't rewrite shared index unnecessarily
Remove a cache invalidation which would cause the shared index to be rewritten on as-is commits. When the cache-tree has changed, we need to update it. But we don't necessarily need to update the shared index. So setting active_cache_changed to SOMETHING_CHANGED is unnecessary. Instead, we let update_main_cache_tree just update the CACHE_TREE_CHANGED bit. In order to test this, make test-dump-split-index not segfault on missing replace_bitmap/delete_bitmap. This new codepath is not called now that the test passes, but is necessary to avoid a segfault when the new test is run with the old builtin/commit.c code. Signed-off-by: David Turner <dturner@twopensource.com> Acked-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'test-dump-split-index.c')
-rw-r--r--test-dump-split-index.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/test-dump-split-index.c b/test-dump-split-index.c
index 9cf3112..861d28c 100644
--- a/test-dump-split-index.c
+++ b/test-dump-split-index.c
@@ -26,9 +26,11 @@ int main(int ac, char **av)
sha1_to_hex(ce->sha1), ce_stage(ce), ce->name);
}
printf("replacements:");
- ewah_each_bit(si->replace_bitmap, show_bit, NULL);
+ if (si->replace_bitmap)
+ ewah_each_bit(si->replace_bitmap, show_bit, NULL);
printf("\ndeletions:");
- ewah_each_bit(si->delete_bitmap, show_bit, NULL);
+ if (si->delete_bitmap)
+ ewah_each_bit(si->delete_bitmap, show_bit, NULL);
printf("\n");
return 0;
}