summaryrefslogtreecommitdiff
path: root/src/index.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2014-02-04 10:33:30 -0800
committerRussell Belfer <rb@github.com>2014-02-04 10:33:30 -0800
commit43709ca87811efc3c237eb719611f025502f3928 (patch)
tree60d959aefc7bee941e8090f45e3ee0e9ef634583 /src/index.c
parent882c7742711199f757305687c257ac97262a3a30 (diff)
downloadlibgit2-43709ca87811efc3c237eb719611f025502f3928.tar.gz
Fix typo setting sorted flag when reloading index
This fixes a typo I made for setting the sorted flag on the index after a reload. That typo didn't actually cause any test failures so I'm also adding a test that explicitly checks that the index is correctly sorted after a reload when ignoring case and when not.
Diffstat (limited to 'src/index.c')
-rw-r--r--src/index.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/index.c b/src/index.c
index 1ab126c87..42eb5fd49 100644
--- a/src/index.c
+++ b/src/index.c
@@ -1811,8 +1811,10 @@ static int parse_index(git_index *index, const char *buffer, size_t buffer_size)
#undef seek_forward
- /* Entries are stored case-sensitively on disk. */
- git_vector_set_sorted(&index->entries, index->ignore_case);
+ /* Entries are stored case-sensitively on disk, so re-sort now if
+ * in-memory index is supposed to be case-insensitive
+ */
+ git_vector_set_sorted(&index->entries, !index->ignore_case);
git_vector_sort(&index->entries);
return 0;