summaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2018-11-20 06:12:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-11-21 04:43:06 (GMT)
commit429160544db9cc0cf748cdc98b21bd3533ec85a3 (patch)
tree8164f91fe7bbe0989a899521560d34c1fe867592 /read-cache.c
parentd8465500c3d5ced194585eea05b2a6dccfaa6366 (diff)
downloadgit-429160544db9cc0cf748cdc98b21bd3533ec85a3.zip
git-429160544db9cc0cf748cdc98b21bd3533ec85a3.tar.gz
git-429160544db9cc0cf748cdc98b21bd3533ec85a3.tar.bz2
ieot: default to not writing IEOT section
As with EOIE, popular versions of Git do not support the new IEOT extension yet. When accessing a Git repository written by a more modern version of Git, they correctly ignore the unrecognized section, but in the process they loudly warn ignoring IEOT extension resulting in confusion for users. Introduce the index extension more gently by not writing it yet in this first version with support for it. Soon, once sufficiently many users are running a modern version of Git, we can flip the default so users benefit from this index extension by default. Introduce a '[index] recordOffsetTable' configuration variable to control whether the new index extension is written. Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/read-cache.c b/read-cache.c
index 1e9c772..f3d5638 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -2698,6 +2698,15 @@ static int record_eoie(void)
return 0;
}
+static int record_ieot(void)
+{
+ int val;
+
+ if (!git_config_get_bool("index.recordoffsettable", &val))
+ return val;
+ return 0;
+}
+
/*
* On success, `tempfile` is closed. If it is the temporary file
* of a `struct lock_file`, we will therefore effectively perform
@@ -2761,7 +2770,7 @@ static int do_write_index(struct index_state *istate, struct tempfile *tempfile,
else
nr_threads = 1;
- if (nr_threads != 1) {
+ if (nr_threads != 1 && record_ieot()) {
int ieot_blocks, cpus;
/*