Commit 27fe6efe85ef11a3a765640065aa08156f130874

Philip Kelley 2013-01-04T13:48:08

Fix git_index sorting with core.ignorecase in git_index_read

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/src/index.c b/src/index.c
index d4568aa..c047968 100644
--- a/src/index.c
+++ b/src/index.c
@@ -1359,9 +1359,10 @@ static int parse_index(git_index *index, const char *buffer, size_t buffer_size)
 
 #undef seek_forward
 
-	/* force sorting in the vector: the entries are
-	 * assured to be sorted on the index */
-	index->entries.sorted = 1;
+	/* Entries are stored case-sensitively on disk. */
+	index->entries.sorted = !index->ignore_case;
+	git_vector_sort(&index->entries);
+
 	return 0;
 }