Thread (19 messages) read the whole thread 19 messages, 2 authors, 2016-07-25
STALE3659d

Revision rfc of 6 in this series.

Revisions (6)
  1. rfc current
  2. v1 [diff vs current]
  3. v2 [diff vs current]
  4. v3 [diff vs current]
  5. v4 [diff vs current]
  6. v5 [diff vs current]

[RFC/PATCH 3/8] read-cache: add and then use tweak_split_index()

From: Christian Couder <hidden>
Date: 2016-07-11 17:23:33
Subsystem: the rest · Maintainer: Linus Torvalds

This will make us use the split-index feature or not depending
on the value of the core.splitIndex config variable.

Signed-off-by: Christian Couder <redacted>
---
 read-cache.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
diff --git a/read-cache.c b/read-cache.c
index db27766..ae292d6 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -1538,10 +1538,27 @@ static void tweak_untracked_cache(struct index_state *istate)
 	}
 }
 
+static void tweak_split_index(struct index_state *istate)
+{
+	switch (git_config_get_split_index()) {
+	case -1: /* unset: do nothing */
+		break;
+	case 0: /* false */
+		remove_split_index(istate);
+		break;
+	case 1: /* true */
+		add_split_index(istate);
+		break;
+	default: /* unknown value: do nothing */
+		break;
+	}
+}
+
 static void post_read_index_from(struct index_state *istate)
 {
 	check_ce_order(istate);
 	tweak_untracked_cache(istate);
+	tweak_split_index(istate);
 }
 
 /* remember to discard_cache() before reading a different cache! */
-- 
2.9.0.250.g7087ccc.dirty
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help