Commit 18e71e6d597abe6c7feb666429c921bd19dc0ba8

Edward Thomson 2018-11-28T13:31:06

index: use new enum and structure names Use the new-style index names throughout our own codebase.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
diff --git a/src/diff_generate.c b/src/diff_generate.c
index 539269a..8a8c4b9 100644
--- a/src/diff_generate.c
+++ b/src/diff_generate.c
@@ -138,7 +138,7 @@ static int diff_delta__from_one(
 	if (DIFF_FLAG_IS_SET(diff, GIT_DIFF_REVERSE))
 		has_old = !has_old;
 
-	if ((entry->flags & GIT_IDXENTRY_VALID) != 0)
+	if ((entry->flags & GIT_INDEX_ENTRY_VALID) != 0)
 		return 0;
 
 	if (status == GIT_DELTA_IGNORED &&
@@ -764,11 +764,11 @@ static int maybe_modified(
 		status = GIT_DELTA_CONFLICTED;
 
 	/* support "assume unchanged" (poorly, b/c we still stat everything) */
-	} else if ((oitem->flags & GIT_IDXENTRY_VALID) != 0) {
+	} else if ((oitem->flags & GIT_INDEX_ENTRY_VALID) != 0) {
 		status = GIT_DELTA_UNMODIFIED;
 
 	/* support "skip worktree" index bit */
-	} else if ((oitem->flags_extended & GIT_IDXENTRY_SKIP_WORKTREE) != 0) {
+	} else if ((oitem->flags_extended & GIT_INDEX_ENTRY_SKIP_WORKTREE) != 0) {
 		status = GIT_DELTA_UNMODIFIED;
 
 	/* if basic type of file changed, then split into delete and add */
diff --git a/src/idxmap.c b/src/idxmap.c
index 05a7b2f..edf8fff 100644
--- a/src/idxmap.c
+++ b/src/idxmap.c
@@ -23,11 +23,11 @@ static kh_inline khint_t idxentry_hash(const git_index_entry *e)
 	const char *s = e->path;
 	khint_t h = (khint_t)git__tolower(*s);
 	if (h) for (++s ; *s; ++s) h = (h << 5) - h + (khint_t)git__tolower(*s);
-	return h + GIT_IDXENTRY_STAGE(e);
+	return h + GIT_INDEX_ENTRY_STAGE(e);
 }
 
-#define idxentry_equal(a, b) (GIT_IDXENTRY_STAGE(a) == GIT_IDXENTRY_STAGE(b) && strcmp(a->path, b->path) == 0)
-#define idxentry_icase_equal(a, b) (GIT_IDXENTRY_STAGE(a) == GIT_IDXENTRY_STAGE(b) && strcasecmp(a->path, b->path) == 0)
+#define idxentry_equal(a, b) (GIT_INDEX_ENTRY_STAGE(a) == GIT_INDEX_ENTRY_STAGE(b) && strcmp(a->path, b->path) == 0)
+#define idxentry_icase_equal(a, b) (GIT_INDEX_ENTRY_STAGE(a) == GIT_INDEX_ENTRY_STAGE(b) && strcasecmp(a->path, b->path) == 0)
 
 __KHASH_IMPL(idx, static kh_inline, const git_index_entry *, git_index_entry *, 1, idxentry_hash, idxentry_equal)
 __KHASH_IMPL(idxicase, static kh_inline, const git_index_entry *, git_index_entry *, 1, idxentry_hash, idxentry_icase_equal)
diff --git a/src/index.c b/src/index.c
index a5a3478..e4f0338 100644
--- a/src/index.c
+++ b/src/index.c
@@ -168,7 +168,7 @@ int git_index_entry_srch(const void *key, const void *array_member)
 		return 1;
 
 	if (srch_key->stage != GIT_INDEX_STAGE_ANY)
-		return srch_key->stage - GIT_IDXENTRY_STAGE(&entry->entry);
+		return srch_key->stage - GIT_INDEX_ENTRY_STAGE(&entry->entry);
 
 	return 0;
 }
@@ -194,7 +194,7 @@ int git_index_entry_isrch(const void *key, const void *array_member)
 		return 1;
 
 	if (srch_key->stage != GIT_INDEX_STAGE_ANY)
-		return srch_key->stage - GIT_IDXENTRY_STAGE(&entry->entry);
+		return srch_key->stage - GIT_INDEX_ENTRY_STAGE(&entry->entry);
 
 	return 0;
 }
@@ -222,7 +222,7 @@ int git_index_entry_cmp(const void *a, const void *b)
 	diff = strcmp(entry_a->path, entry_b->path);
 
 	if (diff == 0)
-		diff = (GIT_IDXENTRY_STAGE(entry_a) - GIT_IDXENTRY_STAGE(entry_b));
+		diff = (GIT_INDEX_ENTRY_STAGE(entry_a) - GIT_INDEX_ENTRY_STAGE(entry_b));
 
 	return diff;
 }
@@ -236,7 +236,7 @@ int git_index_entry_icmp(const void *a, const void *b)
 	diff = strcasecmp(entry_a->path, entry_b->path);
 
 	if (diff == 0)
-		diff = (GIT_IDXENTRY_STAGE(entry_a) - GIT_IDXENTRY_STAGE(entry_b));
+		diff = (GIT_INDEX_ENTRY_STAGE(entry_a) - GIT_INDEX_ENTRY_STAGE(entry_b));
 
 	return diff;
 }
@@ -562,7 +562,7 @@ int git_index_set_caps(git_index *index, int caps)
 
 	old_ignore_case = index->ignore_case;
 
-	if (caps == GIT_INDEXCAP_FROM_OWNER) {
+	if (caps == GIT_INDEX_CAPABILITY_FROM_OWNER) {
 		git_repository *repo = INDEX_OWNER(index);
 		int val;
 
@@ -578,9 +578,9 @@ int git_index_set_caps(git_index *index, int caps)
 			index->no_symlinks = (val == 0);
 	}
 	else {
-		index->ignore_case = ((caps & GIT_INDEXCAP_IGNORE_CASE) != 0);
-		index->distrust_filemode = ((caps & GIT_INDEXCAP_NO_FILEMODE) != 0);
-		index->no_symlinks = ((caps & GIT_INDEXCAP_NO_SYMLINKS) != 0);
+		index->ignore_case = ((caps & GIT_INDEX_CAPABILITY_IGNORE_CASE) != 0);
+		index->distrust_filemode = ((caps & GIT_INDEX_CAPABILITY_NO_FILEMODE) != 0);
+		index->no_symlinks = ((caps & GIT_INDEX_CAPABILITY_NO_SYMLINKS) != 0);
 	}
 
 	if (old_ignore_case != index->ignore_case) {
@@ -592,9 +592,9 @@ int git_index_set_caps(git_index *index, int caps)
 
 int git_index_caps(const git_index *index)
 {
-	return ((index->ignore_case ? GIT_INDEXCAP_IGNORE_CASE : 0) |
-			(index->distrust_filemode ? GIT_INDEXCAP_NO_FILEMODE : 0) |
-			(index->no_symlinks ? GIT_INDEXCAP_NO_SYMLINKS : 0));
+	return ((index->ignore_case ? GIT_INDEX_CAPABILITY_IGNORE_CASE : 0) |
+			(index->distrust_filemode ? GIT_INDEX_CAPABILITY_NO_FILEMODE : 0) |
+			(index->no_symlinks ? GIT_INDEX_CAPABILITY_NO_SYMLINKS : 0));
 }
 
 const git_oid *git_index_checksum(git_index *index)
@@ -736,7 +736,7 @@ static int truncate_racily_clean(git_index *index)
 
 	diff_opts.flags |= GIT_DIFF_INCLUDE_TYPECHANGE | GIT_DIFF_IGNORE_SUBMODULES | GIT_DIFF_DISABLE_PATHSPEC_MATCH;
 	git_vector_foreach(&index->entries, i, entry) {
-		if ((entry->flags_extended & GIT_IDXENTRY_UPTODATE) == 0 &&
+		if ((entry->flags_extended & GIT_INDEX_ENTRY_UPTODATE) == 0 &&
 			is_racy_entry(index, entry))
 			git_vector_insert(&paths, (char *)entry->path);
 	}
@@ -857,7 +857,7 @@ const git_index_entry *git_index_get_bypath(
 	assert(index);
 
 	key.path = path;
-	GIT_IDXENTRY_STAGE_SET(&key, stage);
+	GIT_INDEX_ENTRY_STAGE_SET(&key, stage);
 
 	LOOKUP_IN_MAP(pos, index, &key);
 
@@ -890,12 +890,12 @@ static void index_entry_adjust_namemask(
 		git_index_entry *entry,
 		size_t path_length)
 {
-	entry->flags &= ~GIT_IDXENTRY_NAMEMASK;
+	entry->flags &= ~GIT_INDEX_ENTRY_NAMEMASK;
 
-	if (path_length < GIT_IDXENTRY_NAMEMASK)
-		entry->flags |= path_length & GIT_IDXENTRY_NAMEMASK;
+	if (path_length < GIT_INDEX_ENTRY_NAMEMASK)
+		entry->flags |= path_length & GIT_INDEX_ENTRY_NAMEMASK;
 	else
-		entry->flags |= GIT_IDXENTRY_NAMEMASK;
+		entry->flags |= GIT_INDEX_ENTRY_NAMEMASK;
 }
 
 /* When `from_workdir` is true, we will validate the paths to avoid placing
@@ -1078,7 +1078,7 @@ static void index_entry_cpy_nocache(
 	git_oid_cpy(&tgt->id, &src->id);
 	tgt->mode = src->mode;
 	tgt->flags = src->flags;
-	tgt->flags_extended = (src->flags_extended & GIT_IDXENTRY_EXTENDED_FLAGS);
+	tgt->flags_extended = (src->flags_extended & GIT_INDEX_ENTRY_EXTENDED_FLAGS);
 }
 
 static int index_entry_dup_nocache(
@@ -1097,7 +1097,7 @@ static int has_file_name(git_index *index,
 	 const git_index_entry *entry, size_t pos, int ok_to_replace)
 {
 	size_t len = strlen(entry->path);
-	int stage = GIT_IDXENTRY_STAGE(entry);
+	int stage = GIT_INDEX_ENTRY_STAGE(entry);
 	const char *name = entry->path;
 
 	while (pos < index->entries.length) {
@@ -1107,7 +1107,7 @@ static int has_file_name(git_index *index,
 			break;
 		if (memcmp(name, p->path, len))
 			break;
-		if (GIT_IDXENTRY_STAGE(&p->entry) != stage)
+		if (GIT_INDEX_ENTRY_STAGE(&p->entry) != stage)
 			continue;
 		if (p->path[len] != '/')
 			continue;
@@ -1127,7 +1127,7 @@ static int has_file_name(git_index *index,
 static int has_dir_name(git_index *index,
 		const git_index_entry *entry, int ok_to_replace)
 {
-	int stage = GIT_IDXENTRY_STAGE(entry);
+	int stage = GIT_INDEX_ENTRY_STAGE(entry);
 	const char *name = entry->path;
 	const char *slash = name + strlen(name);
 
@@ -1164,7 +1164,7 @@ static int has_dir_name(git_index *index,
 			    memcmp(p->path, name, len))
 				break; /* not our subdirectory */
 
-			if (GIT_IDXENTRY_STAGE(&p->entry) == stage)
+			if (GIT_INDEX_ENTRY_STAGE(&p->entry) == stage)
 				return 0;
 		}
 	}
@@ -1222,7 +1222,7 @@ static int canonicalize_directory_path(
 			&pos, &index->entries, index->entries_search_path, search);
 
 		while ((match = git_vector_get(&index->entries, pos))) {
-			if (GIT_IDXENTRY_STAGE(match) != 0) {
+			if (GIT_INDEX_ENTRY_STAGE(match) != 0) {
 				/* conflicts do not contribute to canonical paths */
 			} else if (strncmp(search, match->path, search_len) == 0) {
 				/* prefer an exact match to the input filename */
@@ -1260,7 +1260,7 @@ static int index_no_dups(void **old, void *new)
 	const git_index_entry *entry = new;
 	GIT_UNUSED(old);
 	giterr_set(GITERR_INDEX, "'%s' appears multiple times at stage %d",
-		entry->path, GIT_IDXENTRY_STAGE(entry));
+		entry->path, GIT_INDEX_ENTRY_STAGE(entry));
 	return GIT_EEXISTS;
 }
 
@@ -1276,7 +1276,7 @@ static void index_existing_and_best(
 	int error;
 
 	error = index_find(&pos,
-		index, entry->path, 0, GIT_IDXENTRY_STAGE(entry));
+		index, entry->path, 0, GIT_INDEX_ENTRY_STAGE(entry));
 
 	if (error == 0) {
 		*existing = index->entries.contents[pos];
@@ -1289,7 +1289,7 @@ static void index_existing_and_best(
 	*existing_position = 0;
 	*best = NULL;
 
-	if (GIT_IDXENTRY_STAGE(entry) == 0) {
+	if (GIT_INDEX_ENTRY_STAGE(entry) == 0) {
 		for (; pos < index->entries.length; pos++) {
 			int (*strcomp)(const char *a, const char *b) =
 				index->ignore_case ? git__strcasecmp : git__strcmp;
@@ -1299,7 +1299,7 @@ static void index_existing_and_best(
 			if (strcomp(entry->path, e->path) != 0)
 				break;
 
-			if (GIT_IDXENTRY_STAGE(e) == GIT_INDEX_STAGE_ANCESTOR) {
+			if (GIT_INDEX_ENTRY_STAGE(e) == GIT_INDEX_STAGE_ANCESTOR) {
 				*best = e;
 				continue;
 			} else {
@@ -1344,7 +1344,7 @@ static int index_insert(
 	index_entry_adjust_namemask(entry, path_length);
 
 	/* This entry is now up-to-date and should not be checked for raciness */
-	entry->flags_extended |= GIT_IDXENTRY_UPTODATE;
+	entry->flags_extended |= GIT_INDEX_ENTRY_UPTODATE;
 
 	git_vector_sort(&index->entries);
 
@@ -1628,7 +1628,7 @@ int git_index__fill(git_index *index, const git_vector *source_entries)
 			break;
 
 		index_entry_adjust_namemask(entry, ((struct entry_internal *)entry)->pathlen);
-		entry->flags_extended |= GIT_IDXENTRY_UPTODATE;
+		entry->flags_extended |= GIT_INDEX_ENTRY_UPTODATE;
 		entry->mode = git_index__create_mode(entry->mode);
 
 		if ((ret = git_vector_insert(&index->entries, entry)) < 0)
@@ -1675,7 +1675,7 @@ int git_index_remove(git_index *index, const char *path, int stage)
 	git_index_entry remove_key = {{ 0 }};
 
 	remove_key.path = path;
-	GIT_IDXENTRY_STAGE_SET(&remove_key, stage);
+	GIT_INDEX_ENTRY_STAGE_SET(&remove_key, stage);
 
 	DELETE_IN_MAP(index, &remove_key);
 
@@ -1706,7 +1706,7 @@ int git_index_remove_directory(git_index *index, const char *dir, int stage)
 		if (!entry || git__prefixcmp(entry->path, pfx.ptr) != 0)
 			break;
 
-		if (GIT_IDXENTRY_STAGE(entry) != stage) {
+		if (GIT_INDEX_ENTRY_STAGE(entry) != stage) {
 			++pos;
 			continue;
 		}
@@ -1822,7 +1822,7 @@ int git_index_conflict_add(git_index *index,
 			continue;
 
 		/* Make sure stage is correct */
-		GIT_IDXENTRY_STAGE_SET(entries[i], i + 1);
+		GIT_INDEX_ENTRY_STAGE_SET(entries[i], i + 1);
 
 		if ((ret = index_insert(index, &entries[i], 1, true, true, false)) < 0)
 			goto on_error;
@@ -1865,7 +1865,7 @@ static int index_conflict__get_byindex(
 		if (path && index->entries_cmp_path(conflict_entry->path, path) != 0)
 			break;
 
-		stage = GIT_IDXENTRY_STAGE(conflict_entry);
+		stage = GIT_INDEX_ENTRY_STAGE(conflict_entry);
 		path = conflict_entry->path;
 
 		switch (stage) {
@@ -1932,7 +1932,7 @@ static int index_conflict_remove(git_index *index, const char *path)
 			index->entries_cmp_path(conflict_entry->path, path) != 0)
 			break;
 
-		if (GIT_IDXENTRY_STAGE(conflict_entry) == 0) {
+		if (GIT_INDEX_ENTRY_STAGE(conflict_entry) == 0) {
 			pos++;
 			continue;
 		}
@@ -1964,7 +1964,7 @@ int git_index_has_conflicts(const git_index *index)
 	assert(index);
 
 	git_vector_foreach(&index->entries, i, entry) {
-		if (GIT_IDXENTRY_STAGE(entry) > 0)
+		if (GIT_INDEX_ENTRY_STAGE(entry) > 0)
 			return 1;
 	}
 
@@ -2386,13 +2386,13 @@ out_err:
 static size_t index_entry_size(size_t path_len, size_t varint_len, uint32_t flags)
 {
 	if (varint_len) {
-		if (flags & GIT_IDXENTRY_EXTENDED)
+		if (flags & GIT_INDEX_ENTRY_EXTENDED)
 			return offsetof(struct entry_long, path) + path_len + 1 + varint_len;
 		else
 			return offsetof(struct entry_short, path) + path_len + 1 + varint_len;
 	} else {
 #define entry_size(type,len) ((offsetof(type, path) + (len) + 8) & ~7)
-		if (flags & GIT_IDXENTRY_EXTENDED)
+		if (flags & GIT_INDEX_ENTRY_EXTENDED)
 			return entry_size(struct entry_long, path_len);
 		else
 			return entry_size(struct entry_short, path_len);
@@ -2434,7 +2434,7 @@ static int read_entry(
 	git_oid_cpy(&entry.id, &source.oid);
 	entry.flags = ntohs(source.flags);
 
-	if (entry.flags & GIT_IDXENTRY_EXTENDED) {
+	if (entry.flags & GIT_INDEX_ENTRY_EXTENDED) {
 		uint16_t flags_raw;
 		size_t flags_offset;
 
@@ -2449,7 +2449,7 @@ static int read_entry(
 		path_ptr = (const char *) buffer + offsetof(struct entry_short, path);
 
 	if (!compressed) {
-		path_length = entry.flags & GIT_IDXENTRY_NAMEMASK;
+		path_length = entry.flags & GIT_INDEX_ENTRY_NAMEMASK;
 
 		/* if this is a very long string, we must find its
 		 * real length without overflowing */
@@ -2694,10 +2694,10 @@ static bool is_index_extended(git_index *index)
 	extended = 0;
 
 	git_vector_foreach(&index->entries, i, entry) {
-		entry->flags &= ~GIT_IDXENTRY_EXTENDED;
-		if (entry->flags_extended & GIT_IDXENTRY_EXTENDED_FLAGS) {
+		entry->flags &= ~GIT_INDEX_ENTRY_EXTENDED;
+		if (entry->flags_extended & GIT_INDEX_ENTRY_EXTENDED_FLAGS) {
 			extended++;
-			entry->flags |= GIT_IDXENTRY_EXTENDED;
+			entry->flags |= GIT_INDEX_ENTRY_EXTENDED;
 		}
 	}
 
@@ -2762,11 +2762,11 @@ static int write_disk_entry(git_filebuf *file, git_index_entry *entry, const cha
 
 	ondisk.flags = htons(entry->flags);
 
-	if (entry->flags & GIT_IDXENTRY_EXTENDED) {
+	if (entry->flags & GIT_INDEX_ENTRY_EXTENDED) {
 		struct entry_long ondisk_ext;
 		memcpy(&ondisk_ext, &ondisk, sizeof(struct entry_short));
 		ondisk_ext.flags_extended = htons(entry->flags_extended &
-			GIT_IDXENTRY_EXTENDED_FLAGS);
+			GIT_INDEX_ENTRY_EXTENDED_FLAGS);
 		memcpy(mem, &ondisk_ext, offsetof(struct entry_long, path));
 		path = ((struct entry_long*)mem)->path;
 		disk_size -= offsetof(struct entry_long, path);
@@ -2980,7 +2980,7 @@ static void clear_uptodate(git_index *index)
 	size_t i;
 
 	git_vector_foreach(&index->entries, i, entry)
-		entry->flags_extended &= ~GIT_IDXENTRY_UPTODATE;
+		entry->flags_extended &= ~GIT_INDEX_ENTRY_UPTODATE;
 }
 
 static int write_index(git_oid *checksum, git_index *index, git_filebuf *file)
@@ -3037,12 +3037,12 @@ static int write_index(git_oid *checksum, git_index *index, git_filebuf *file)
 
 int git_index_entry_stage(const git_index_entry *entry)
 {
-	return GIT_IDXENTRY_STAGE(entry);
+	return GIT_INDEX_ENTRY_STAGE(entry);
 }
 
 int git_index_entry_is_conflict(const git_index_entry *entry)
 {
-	return (GIT_IDXENTRY_STAGE(entry) > 0);
+	return (GIT_INDEX_ENTRY_STAGE(entry) > 0);
 }
 
 typedef struct read_tree_data {
diff --git a/src/repository.c b/src/repository.c
index 2305bfe..95ab609 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -1186,7 +1186,8 @@ int git_repository_index__weakptr(git_index **out, git_repository *repo)
 				git_index_free(index);
 			}
 
-			error = git_index_set_caps(repo->_index, GIT_INDEXCAP_FROM_OWNER);
+			error = git_index_set_caps(repo->_index,
+			                           GIT_INDEX_CAPABILITY_FROM_OWNER);
 		}
 
 		git_buf_dispose(&index_path);
diff --git a/src/submodule.c b/src/submodule.c
index 45cb957..094eefe 100644
--- a/src/submodule.c
+++ b/src/submodule.c
@@ -889,7 +889,7 @@ int git_submodule_add_to_index(git_submodule *sm, int write_index)
 	memset(&entry, 0, sizeof(entry));
 	entry.path = sm->path;
 	git_index_entry__init_from_stat(
-		&entry, &st, !(git_index_caps(index) & GIT_INDEXCAP_NO_FILEMODE));
+		&entry, &st, !(git_index_caps(index) & GIT_INDEX_CAPABILITY_NO_FILEMODE));
 
 	/* calling git_submodule_open will have set sm->wd_oid if possible */
 	if ((sm->flags & GIT_SUBMODULE_STATUS__WD_OID_VALID) == 0) {
diff --git a/tests/apply/apply_helpers.c b/tests/apply/apply_helpers.c
index c182e05..91cc51a 100644
--- a/tests/apply/apply_helpers.c
+++ b/tests/apply/apply_helpers.c
@@ -13,7 +13,7 @@ static int iterator_compare(const git_index_entry *entry, void *_data)
 
 	struct iterator_compare_data *data = (struct iterator_compare_data *)_data;
 
-	cl_assert_equal_i(GIT_IDXENTRY_STAGE(entry), data->expected[data->idx].stage);
+	cl_assert_equal_i(GIT_INDEX_ENTRY_STAGE(entry), data->expected[data->idx].stage);
 	cl_git_pass(git_oid_fromstr(&expected_id, data->expected[data->idx].oid_str));
 	cl_assert_equal_oid(&entry->id, &expected_id);
 	cl_assert_equal_i(entry->mode, data->expected[data->idx].mode);
@@ -75,7 +75,7 @@ static int iterator_eq(const git_index_entry **entry, void *_data)
 	if (!entry[0] || !entry[1])
 		return -1;
 
-	cl_assert_equal_i(GIT_IDXENTRY_STAGE(entry[0]), GIT_IDXENTRY_STAGE(entry[1]));
+	cl_assert_equal_i(GIT_INDEX_ENTRY_STAGE(entry[0]), GIT_INDEX_ENTRY_STAGE(entry[1]));
 	cl_assert_equal_oid(&entry[0]->id, &entry[1]->id);
 	cl_assert_equal_i(entry[0]->mode, entry[1]->mode);
 	cl_assert_equal_s(entry[0]->path, entry[1]->path);
diff --git a/tests/checkout/conflict.c b/tests/checkout/conflict.c
index 6670b2e..abfd9b7 100644
--- a/tests/checkout/conflict.c
+++ b/tests/checkout/conflict.c
@@ -103,7 +103,7 @@ static void create_index(struct checkout_index_entry *entries, size_t entries_le
 		memset(&entry, 0x0, sizeof(git_index_entry));
 
 		entry.mode = entries[i].mode;
-		GIT_IDXENTRY_STAGE_SET(&entry, entries[i].stage);
+		GIT_INDEX_ENTRY_STAGE_SET(&entry, entries[i].stage);
 		git_oid_fromstr(&entry.id, entries[i].oid_str);
 		entry.path = entries[i].path;
 
diff --git a/tests/checkout/index.c b/tests/checkout/index.c
index 65a121d..a4c811b 100644
--- a/tests/checkout/index.c
+++ b/tests/checkout/index.c
@@ -733,15 +733,15 @@ static void add_conflict(git_index *index, const char *path)
 	entry.path = path;
 
 	git_oid_fromstr(&entry.id, "d427e0b2e138501a3d15cc376077a3631e15bd46");
-	GIT_IDXENTRY_STAGE_SET(&entry, 1);
+	GIT_INDEX_ENTRY_STAGE_SET(&entry, 1);
 	cl_git_pass(git_index_add(index, &entry));
 
 	git_oid_fromstr(&entry.id, "4e886e602529caa9ab11d71f86634bd1b6e0de10");
-	GIT_IDXENTRY_STAGE_SET(&entry, 2);
+	GIT_INDEX_ENTRY_STAGE_SET(&entry, 2);
 	cl_git_pass(git_index_add(index, &entry));
 
 	git_oid_fromstr(&entry.id, "2bd0a343aeef7a2cf0d158478966a6e587ff3863");
-	GIT_IDXENTRY_STAGE_SET(&entry, 3);
+	GIT_INDEX_ENTRY_STAGE_SET(&entry, 3);
 	cl_git_pass(git_index_add(index, &entry));
 }
 
diff --git a/tests/checkout/tree.c b/tests/checkout/tree.c
index 4008935..039393d 100644
--- a/tests/checkout/tree.c
+++ b/tests/checkout/tree.c
@@ -941,16 +941,16 @@ static void create_conflict(const char *path)
 
 	memset(&entry, 0x0, sizeof(git_index_entry));
 	entry.mode = 0100644;
-	GIT_IDXENTRY_STAGE_SET(&entry, 1);
+	GIT_INDEX_ENTRY_STAGE_SET(&entry, 1);
 	git_oid_fromstr(&entry.id, "d427e0b2e138501a3d15cc376077a3631e15bd46");
 	entry.path = path;
 	cl_git_pass(git_index_add(index, &entry));
 
-	GIT_IDXENTRY_STAGE_SET(&entry, 2);
+	GIT_INDEX_ENTRY_STAGE_SET(&entry, 2);
 	git_oid_fromstr(&entry.id, "ee3fa1b8c00aff7fe02065fdb50864bb0d932ccf");
 	cl_git_pass(git_index_add(index, &entry));
 
-	GIT_IDXENTRY_STAGE_SET(&entry, 3);
+	GIT_INDEX_ENTRY_STAGE_SET(&entry, 3);
 	git_oid_fromstr(&entry.id, "2bd0a343aeef7a2cf0d158478966a6e587ff3863");
 	cl_git_pass(git_index_add(index, &entry));
 
diff --git a/tests/diff/workdir.c b/tests/diff/workdir.c
index dab6147..b1d9aef 100644
--- a/tests/diff/workdir.c
+++ b/tests/diff/workdir.c
@@ -145,12 +145,12 @@ void test_diff_workdir__to_index_with_assume_unchanged(void)
 
 	cl_assert((iep = git_index_get_bypath(idx, "modified_file", 0)) != NULL);
 	memcpy(&ie, iep, sizeof(ie));
-	ie.flags |= GIT_IDXENTRY_VALID;
+	ie.flags |= GIT_INDEX_ENTRY_VALID;
 	cl_git_pass(git_index_add(idx, &ie));
 
 	cl_assert((iep = git_index_get_bypath(idx, "file_deleted", 0)) != NULL);
 	memcpy(&ie, iep, sizeof(ie));
-	ie.flags |= GIT_IDXENTRY_VALID;
+	ie.flags |= GIT_INDEX_ENTRY_VALID;
 	cl_git_pass(git_index_add(idx, &ie));
 
 	cl_git_pass(git_index_write(idx));
@@ -749,7 +749,7 @@ void test_diff_workdir__filemode_changes_with_filemode_false(void)
 	cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, NULL, NULL));
 
 	memset(&exp, 0, sizeof(exp));
-	cl_git_pass(git_diff_foreach(diff, 
+	cl_git_pass(git_diff_foreach(diff,
 		diff_file_cb, diff_binary_cb, diff_hunk_cb, diff_line_cb, &exp));
 
 	cl_assert_equal_i(0, exp.files);
diff --git a/tests/index/bypath.c b/tests/index/bypath.c
index 34a7412..f911ffb 100644
--- a/tests/index/bypath.c
+++ b/tests/index/bypath.c
@@ -285,7 +285,7 @@ void test_index_bypath__add_honors_conflict_mode(void)
 	cl_git_pass(git_index_remove_bypath(g_idx, "README.txt"));
 
 	for (stage = 1; stage <= 3; stage++) {
-		new_entry.flags = stage << GIT_IDXENTRY_STAGESHIFT;
+		new_entry.flags = stage << GIT_INDEX_ENTRY_STAGESHIFT;
 		cl_git_pass(git_index_add(g_idx, &new_entry));
 	}
 
@@ -317,7 +317,7 @@ void test_index_bypath__add_honors_conflict_case(void)
 	cl_git_pass(git_index_remove_bypath(g_idx, "README.txt"));
 
 	for (stage = 1; stage <= 3; stage++) {
-		new_entry.flags = stage << GIT_IDXENTRY_STAGESHIFT;
+		new_entry.flags = stage << GIT_INDEX_ENTRY_STAGESHIFT;
 		cl_git_pass(git_index_add(g_idx, &new_entry));
 	}
 
diff --git a/tests/index/collision.c b/tests/index/collision.c
index 699c985..e9af2cf 100644
--- a/tests/index/collision.c
+++ b/tests/index/collision.c
@@ -108,7 +108,7 @@ void test_index_collision__add_with_highstage_1(void)
 	git_oid_cpy(&entry.id, &g_empty_id);
 
 	entry.path = "a/b";
-	GIT_IDXENTRY_STAGE_SET(&entry, 2);
+	GIT_INDEX_ENTRY_STAGE_SET(&entry, 2);
 	cl_git_pass(git_index_add(g_index, &entry));
 
 	/* create a blob beneath the previous tree entry */
@@ -118,7 +118,7 @@ void test_index_collision__add_with_highstage_1(void)
 
 	/* create another tree entry above the blob */
 	entry.path = "a/b";
-	GIT_IDXENTRY_STAGE_SET(&entry, 1);
+	GIT_INDEX_ENTRY_STAGE_SET(&entry, 1);
 	cl_git_pass(git_index_add(g_index, &entry));
 }
 
@@ -134,16 +134,16 @@ void test_index_collision__add_with_highstage_2(void)
 	git_oid_cpy(&entry.id, &g_empty_id);
 
 	entry.path = "a/b/c";
-	GIT_IDXENTRY_STAGE_SET(&entry, 1);
+	GIT_INDEX_ENTRY_STAGE_SET(&entry, 1);
 	cl_git_pass(git_index_add(g_index, &entry));
 
 	/* create a blob beneath the previous tree entry */
 	entry.path = "a/b/c";
-	GIT_IDXENTRY_STAGE_SET(&entry, 2);
+	GIT_INDEX_ENTRY_STAGE_SET(&entry, 2);
 	cl_git_pass(git_index_add(g_index, &entry));
 
 	/* create another tree entry above the blob */
 	entry.path = "a/b";
-	GIT_IDXENTRY_STAGE_SET(&entry, 3);
+	GIT_INDEX_ENTRY_STAGE_SET(&entry, 3);
 	cl_git_pass(git_index_add(g_index, &entry));
 }
diff --git a/tests/index/conflicts.c b/tests/index/conflicts.c
index 27fbe2b..41d0e21 100644
--- a/tests/index/conflicts.c
+++ b/tests/index/conflicts.c
@@ -36,17 +36,17 @@ void test_index_conflicts__add(void)
 
 	ancestor_entry.path = "test-one.txt";
 	ancestor_entry.mode = 0100644;
-	GIT_IDXENTRY_STAGE_SET(&ancestor_entry, 1);
+	GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 1);
 	git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID);
 
 	our_entry.path = "test-one.txt";
 	our_entry.mode = 0100644;
-	GIT_IDXENTRY_STAGE_SET(&our_entry, 2);
+	GIT_INDEX_ENTRY_STAGE_SET(&our_entry, 2);
 	git_oid_fromstr(&our_entry.id, CONFLICTS_ONE_OUR_OID);
 
 	their_entry.path = "test-one.txt";
 	their_entry.mode = 0100644;
-	GIT_IDXENTRY_STAGE_SET(&ancestor_entry, 2);
+	GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 2);
 	git_oid_fromstr(&their_entry.id, CONFLICTS_ONE_THEIR_OID);
 
 	cl_git_pass(git_index_conflict_add(repo_index, &ancestor_entry, &our_entry, &their_entry));
@@ -67,17 +67,17 @@ void test_index_conflicts__add_fixes_incorrect_stage(void)
 
 	ancestor_entry.path = "test-one.txt";
 	ancestor_entry.mode = 0100644;
-	GIT_IDXENTRY_STAGE_SET(&ancestor_entry, 3);
+	GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 3);
 	git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID);
 
 	our_entry.path = "test-one.txt";
 	our_entry.mode = 0100644;
-	GIT_IDXENTRY_STAGE_SET(&our_entry, 1);
+	GIT_INDEX_ENTRY_STAGE_SET(&our_entry, 1);
 	git_oid_fromstr(&our_entry.id, CONFLICTS_ONE_OUR_OID);
 
 	their_entry.path = "test-one.txt";
 	their_entry.mode = 0100644;
-	GIT_IDXENTRY_STAGE_SET(&their_entry, 2);
+	GIT_INDEX_ENTRY_STAGE_SET(&their_entry, 2);
 	git_oid_fromstr(&their_entry.id, CONFLICTS_ONE_THEIR_OID);
 
 	cl_git_pass(git_index_conflict_add(repo_index, &ancestor_entry, &our_entry, &their_entry));
@@ -110,17 +110,17 @@ void test_index_conflicts__add_detects_invalid_filemode(void)
 	for (i = 0; i < 3; i++) {
 		ancestor_entry.path = "test-one.txt";
 		ancestor_entry.mode = 0100644;
-		GIT_IDXENTRY_STAGE_SET(&ancestor_entry, 3);
+		GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 3);
 		git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID);
 
 		our_entry.path = "test-one.txt";
 		our_entry.mode = 0100644;
-		GIT_IDXENTRY_STAGE_SET(&our_entry, 1);
+		GIT_INDEX_ENTRY_STAGE_SET(&our_entry, 1);
 		git_oid_fromstr(&our_entry.id, CONFLICTS_ONE_OUR_OID);
 
 		their_entry.path = "test-one.txt";
 		their_entry.mode = 0100644;
-		GIT_IDXENTRY_STAGE_SET(&their_entry, 2);
+		GIT_INDEX_ENTRY_STAGE_SET(&their_entry, 2);
 		git_oid_fromstr(&their_entry.id, CONFLICTS_ONE_THEIR_OID);
 
 		/* Corrupt the conflict entry's mode */
@@ -150,17 +150,17 @@ void test_index_conflicts__add_removes_stage_zero(void)
 
 	ancestor_entry.path = "test-one.txt";
 	ancestor_entry.mode = 0100644;
-	GIT_IDXENTRY_STAGE_SET(&ancestor_entry, 3);
+	GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 3);
 	git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID);
 
 	our_entry.path = "test-one.txt";
 	our_entry.mode = 0100644;
-	GIT_IDXENTRY_STAGE_SET(&our_entry, 1);
+	GIT_INDEX_ENTRY_STAGE_SET(&our_entry, 1);
 	git_oid_fromstr(&our_entry.id, CONFLICTS_ONE_OUR_OID);
 
 	their_entry.path = "test-one.txt";
 	their_entry.mode = 0100644;
-	GIT_IDXENTRY_STAGE_SET(&their_entry, 2);
+	GIT_INDEX_ENTRY_STAGE_SET(&their_entry, 2);
 	git_oid_fromstr(&their_entry.id, CONFLICTS_ONE_THEIR_OID);
 
 	cl_git_pass(git_index_conflict_add(repo_index, &ancestor_entry, &our_entry, &their_entry));
@@ -356,7 +356,7 @@ void test_index_conflicts__partial(void)
 
 	ancestor_entry.path = "test-one.txt";
 	ancestor_entry.mode = 0100644;
-	GIT_IDXENTRY_STAGE_SET(&ancestor_entry, 1);
+	GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 1);
 	git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID);
 
 	cl_git_pass(git_index_conflict_add(repo_index, &ancestor_entry, NULL, NULL));
@@ -386,17 +386,17 @@ void test_index_conflicts__case_matters(void)
 	memset(&their_entry, 0x0, sizeof(git_index_entry));
 
 	ancestor_entry.path = upper_case;
-	GIT_IDXENTRY_STAGE_SET(&ancestor_entry, GIT_INDEX_STAGE_ANCESTOR);
+	GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, GIT_INDEX_STAGE_ANCESTOR);
 	git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID);
 	ancestor_entry.mode = GIT_FILEMODE_BLOB;
 
 	our_entry.path = upper_case;
-	GIT_IDXENTRY_STAGE_SET(&our_entry, GIT_INDEX_STAGE_OURS);
+	GIT_INDEX_ENTRY_STAGE_SET(&our_entry, GIT_INDEX_STAGE_OURS);
 	git_oid_fromstr(&our_entry.id, CONFLICTS_ONE_OUR_OID);
 	our_entry.mode = GIT_FILEMODE_BLOB;
 
 	their_entry.path = upper_case;
-	GIT_IDXENTRY_STAGE_SET(&their_entry, GIT_INDEX_STAGE_THEIRS);
+	GIT_INDEX_ENTRY_STAGE_SET(&their_entry, GIT_INDEX_STAGE_THEIRS);
 	git_oid_fromstr(&their_entry.id, CONFLICTS_ONE_THEIR_OID);
 	their_entry.mode = GIT_FILEMODE_BLOB;
 
@@ -404,17 +404,17 @@ void test_index_conflicts__case_matters(void)
 		&ancestor_entry, &our_entry, &their_entry));
 
 	ancestor_entry.path = mixed_case;
-	GIT_IDXENTRY_STAGE_SET(&ancestor_entry, GIT_INDEX_STAGE_ANCESTOR);
+	GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, GIT_INDEX_STAGE_ANCESTOR);
 	git_oid_fromstr(&ancestor_entry.id, CONFLICTS_TWO_ANCESTOR_OID);
 	ancestor_entry.mode = GIT_FILEMODE_BLOB;
 
 	our_entry.path = mixed_case;
-	GIT_IDXENTRY_STAGE_SET(&ancestor_entry, GIT_INDEX_STAGE_ANCESTOR);
+	GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, GIT_INDEX_STAGE_ANCESTOR);
 	git_oid_fromstr(&our_entry.id, CONFLICTS_TWO_OUR_OID);
 	ancestor_entry.mode = GIT_FILEMODE_BLOB;
 
 	their_entry.path = mixed_case;
-	GIT_IDXENTRY_STAGE_SET(&their_entry, GIT_INDEX_STAGE_THEIRS);
+	GIT_INDEX_ENTRY_STAGE_SET(&their_entry, GIT_INDEX_STAGE_THEIRS);
 	git_oid_fromstr(&their_entry.id, CONFLICTS_TWO_THEIR_OID);
 	their_entry.mode = GIT_FILEMODE_BLOB;
 
diff --git a/tests/index/filemodes.c b/tests/index/filemodes.c
index 4eadb2c..4e5a6df 100644
--- a/tests/index/filemodes.c
+++ b/tests/index/filemodes.c
@@ -78,7 +78,7 @@ void test_index_filemodes__untrusted(void)
 	cl_repo_set_bool(g_repo, "core.filemode", false);
 
 	cl_git_pass(git_repository_index(&index, g_repo));
-	cl_assert((git_index_caps(index) & GIT_INDEXCAP_NO_FILEMODE) != 0);
+	cl_assert((git_index_caps(index) & GIT_INDEX_CAPABILITY_NO_FILEMODE) != 0);
 
 	/* 1 - add 0644 over existing 0644 -> expect 0644 */
 	replace_file_with_mode("exec_off", "filemodes/exec_off.0", 0644);
@@ -122,7 +122,7 @@ void test_index_filemodes__trusted(void)
 	cl_repo_set_bool(g_repo, "core.filemode", true);
 
 	cl_git_pass(git_repository_index(&index, g_repo));
-	cl_assert((git_index_caps(index) & GIT_INDEXCAP_NO_FILEMODE) == 0);
+	cl_assert((git_index_caps(index) & GIT_INDEX_CAPABILITY_NO_FILEMODE) == 0);
 
 	/* 1 - add 0644 over existing 0644 -> expect 0644 */
 	replace_file_with_mode("exec_off", "filemodes/exec_off.0", 0644);
@@ -245,7 +245,7 @@ void test_index_filemodes__invalid(void)
 	cl_git_pass(git_index_add_bypath(index, "dummy-file.txt"));
 	cl_assert((dummy = git_index_get_bypath(index, "dummy-file.txt", 0)));
 
-	GIT_IDXENTRY_STAGE_SET(&entry, 0);
+	GIT_INDEX_ENTRY_STAGE_SET(&entry, 0);
 	entry.path = "foo";
 	entry.mode = GIT_OBJ_BLOB;
 	git_oid_cpy(&entry.id, &dummy->id);
diff --git a/tests/index/names.c b/tests/index/names.c
index 11d2c41..e36a667 100644
--- a/tests/index/names.c
+++ b/tests/index/names.c
@@ -41,21 +41,21 @@ static void index_add_conflicts(void)
 		/* ancestor */
 		entry.path = conflict[0];
 		entry.mode = GIT_FILEMODE_BLOB;
-		GIT_IDXENTRY_STAGE_SET(&entry, GIT_INDEX_STAGE_ANCESTOR);
+		GIT_INDEX_ENTRY_STAGE_SET(&entry, GIT_INDEX_STAGE_ANCESTOR);
 		git_oid_fromstr(&entry.id, "1f85ca51b8e0aac893a621b61a9c2661d6aa6d81");
 		cl_git_pass(git_index_add(repo_index, &entry));
 
 		/* ours */
 		entry.path = conflict[1];
 		entry.mode = GIT_FILEMODE_BLOB;
-		GIT_IDXENTRY_STAGE_SET(&entry, GIT_INDEX_STAGE_OURS);
+		GIT_INDEX_ENTRY_STAGE_SET(&entry, GIT_INDEX_STAGE_OURS);
 		git_oid_fromstr(&entry.id, "1f85ca51b8e0aac893a621b61a9c2661d6aa6d81");
 		cl_git_pass(git_index_add(repo_index, &entry));
 
 		/* theirs */
 		entry.path = conflict[2];
 		entry.mode = GIT_FILEMODE_BLOB;
-		GIT_IDXENTRY_STAGE_SET(&entry, GIT_INDEX_STAGE_THEIRS);
+		GIT_INDEX_ENTRY_STAGE_SET(&entry, GIT_INDEX_STAGE_THEIRS);
 		git_oid_fromstr(&entry.id, "1f85ca51b8e0aac893a621b61a9c2661d6aa6d81");
 		cl_git_pass(git_index_add(repo_index, &entry));
 	}
diff --git a/tests/index/racy.c b/tests/index/racy.c
index a15f0fc..e08deae 100644
--- a/tests/index/racy.c
+++ b/tests/index/racy.c
@@ -210,13 +210,13 @@ void test_index_racy__adding_to_index_is_uptodate(void)
 
 	/* ensure that they're all uptodate */
 	cl_assert((entry = git_index_get_bypath(index, "A", 0)));
-	cl_assert_equal_i(GIT_IDXENTRY_UPTODATE, (entry->flags_extended & GIT_IDXENTRY_UPTODATE));
+	cl_assert_equal_i(GIT_INDEX_ENTRY_UPTODATE, (entry->flags_extended & GIT_INDEX_ENTRY_UPTODATE));
 
 	cl_assert((entry = git_index_get_bypath(index, "B", 0)));
-	cl_assert_equal_i(GIT_IDXENTRY_UPTODATE, (entry->flags_extended & GIT_IDXENTRY_UPTODATE));
+	cl_assert_equal_i(GIT_INDEX_ENTRY_UPTODATE, (entry->flags_extended & GIT_INDEX_ENTRY_UPTODATE));
 
 	cl_assert((entry = git_index_get_bypath(index, "C", 0)));
-	cl_assert_equal_i(GIT_IDXENTRY_UPTODATE, (entry->flags_extended & GIT_IDXENTRY_UPTODATE));
+	cl_assert_equal_i(GIT_INDEX_ENTRY_UPTODATE, (entry->flags_extended & GIT_INDEX_ENTRY_UPTODATE));
 
 	cl_git_pass(git_index_write(index));
 
@@ -237,13 +237,13 @@ void test_index_racy__reading_clears_uptodate_bit(void)
 
 	/* ensure that no files are uptodate */
 	cl_assert((entry = git_index_get_bypath(index, "A", 0)));
-	cl_assert_equal_i(0, (entry->flags_extended & GIT_IDXENTRY_UPTODATE));
+	cl_assert_equal_i(0, (entry->flags_extended & GIT_INDEX_ENTRY_UPTODATE));
 
 	cl_assert((entry = git_index_get_bypath(index, "B", 0)));
-	cl_assert_equal_i(0, (entry->flags_extended & GIT_IDXENTRY_UPTODATE));
+	cl_assert_equal_i(0, (entry->flags_extended & GIT_INDEX_ENTRY_UPTODATE));
 
 	cl_assert((entry = git_index_get_bypath(index, "C", 0)));
-	cl_assert_equal_i(0, (entry->flags_extended & GIT_IDXENTRY_UPTODATE));
+	cl_assert_equal_i(0, (entry->flags_extended & GIT_INDEX_ENTRY_UPTODATE));
 
 	git_index_free(index);
 }
@@ -264,13 +264,13 @@ void test_index_racy__read_tree_clears_uptodate_bit(void)
 
 	/* ensure that no files are uptodate */
 	cl_assert((entry = git_index_get_bypath(index, "A", 0)));
-	cl_assert_equal_i(0, (entry->flags_extended & GIT_IDXENTRY_UPTODATE));
+	cl_assert_equal_i(0, (entry->flags_extended & GIT_INDEX_ENTRY_UPTODATE));
 
 	cl_assert((entry = git_index_get_bypath(index, "B", 0)));
-	cl_assert_equal_i(0, (entry->flags_extended & GIT_IDXENTRY_UPTODATE));
+	cl_assert_equal_i(0, (entry->flags_extended & GIT_INDEX_ENTRY_UPTODATE));
 
 	cl_assert((entry = git_index_get_bypath(index, "C", 0)));
-	cl_assert_equal_i(0, (entry->flags_extended & GIT_IDXENTRY_UPTODATE));
+	cl_assert_equal_i(0, (entry->flags_extended & GIT_INDEX_ENTRY_UPTODATE));
 
 	git_tree_free(tree);
 	git_index_free(index);
@@ -311,13 +311,13 @@ void test_index_racy__read_index_clears_uptodate_bit(void)
 
 	/* ensure that files brought in from the other index are not uptodate */
 	cl_assert((entry = git_index_get_bypath(newindex, "A", 0)));
-	cl_assert_equal_i(0, (entry->flags_extended & GIT_IDXENTRY_UPTODATE));
+	cl_assert_equal_i(0, (entry->flags_extended & GIT_INDEX_ENTRY_UPTODATE));
 
 	cl_assert((entry = git_index_get_bypath(newindex, "B", 0)));
-	cl_assert_equal_i(0, (entry->flags_extended & GIT_IDXENTRY_UPTODATE));
+	cl_assert_equal_i(0, (entry->flags_extended & GIT_INDEX_ENTRY_UPTODATE));
 
 	cl_assert((entry = git_index_get_bypath(newindex, "C", 0)));
-	cl_assert_equal_i(0, (entry->flags_extended & GIT_IDXENTRY_UPTODATE));
+	cl_assert_equal_i(0, (entry->flags_extended & GIT_INDEX_ENTRY_UPTODATE));
 
 	git_index_free(index);
 	git_index_free(newindex);
diff --git a/tests/index/read_index.c b/tests/index/read_index.c
index 2df7cc8..836c12b 100644
--- a/tests/index/read_index.c
+++ b/tests/index/read_index.c
@@ -147,17 +147,17 @@ static void add_conflicts(git_index *index, const char *filename)
 
 	ancestor_entry.path = filename;
 	ancestor_entry.mode = 0100644;
-	GIT_IDXENTRY_STAGE_SET(&ancestor_entry, 1);
+	GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 1);
 	git_oid_fromstr(&ancestor_entry.id, ancestor_ids[conflict_idx]);
 
 	our_entry.path = filename;
 	our_entry.mode = 0100644;
-	GIT_IDXENTRY_STAGE_SET(&our_entry, 2);
+	GIT_INDEX_ENTRY_STAGE_SET(&our_entry, 2);
 	git_oid_fromstr(&our_entry.id, our_ids[conflict_idx]);
 
 	their_entry.path = filename;
 	their_entry.mode = 0100644;
-	GIT_IDXENTRY_STAGE_SET(&ancestor_entry, 2);
+	GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 2);
 	git_oid_fromstr(&their_entry.id, their_ids[conflict_idx]);
 
 	cl_git_pass(git_index_conflict_add(index, &ancestor_entry,
diff --git a/tests/index/reuc.c b/tests/index/reuc.c
index 1489ed1..73eaf9e 100644
--- a/tests/index/reuc.c
+++ b/tests/index/reuc.c
@@ -129,12 +129,12 @@ void test_index_reuc__ignore_case(void)
 
 	index_caps = git_index_caps(repo_index);
 
-	index_caps &= ~GIT_INDEXCAP_IGNORE_CASE;
+	index_caps &= ~GIT_INDEX_CAPABILITY_IGNORE_CASE;
 	cl_git_pass(git_index_set_caps(repo_index, index_caps));
 
 	cl_assert(!git_index_reuc_get_bypath(repo_index, "TWO.txt"));
 
-	index_caps |= GIT_INDEXCAP_IGNORE_CASE;
+	index_caps |= GIT_INDEX_CAPABILITY_IGNORE_CASE;
 	cl_git_pass(git_index_set_caps(repo_index, index_caps));
 
 	cl_assert_equal_i(2, git_index_reuc_entrycount(repo_index));
@@ -197,7 +197,7 @@ void test_index_reuc__updates_existing(void)
 
 	index_caps = git_index_caps(repo_index);
 
-	index_caps |= GIT_INDEXCAP_IGNORE_CASE;
+	index_caps |= GIT_INDEX_CAPABILITY_IGNORE_CASE;
 	cl_git_pass(git_index_set_caps(repo_index, index_caps));
 
 	git_oid_fromstr(&ancestor_oid, TWO_ANCESTOR_OID);
diff --git a/tests/index/tests.c b/tests/index/tests.c
index de57bd8..49ef8b2 100644
--- a/tests/index/tests.c
+++ b/tests/index/tests.c
@@ -810,7 +810,7 @@ void test_index_tests__preserves_case(void)
 	cl_git_rewritefile("myrepo/TEST.txt", "hello again\n");
 	cl_git_pass(git_index_add_bypath(index, "TEST.txt"));
 
-	if (index_caps & GIT_INDEXCAP_IGNORE_CASE)
+	if (index_caps & GIT_INDEX_CAPABILITY_IGNORE_CASE)
 		cl_assert_equal_i(1, (int)git_index_entrycount(index));
 	else
 		cl_assert_equal_i(2, (int)git_index_entrycount(index));
@@ -821,7 +821,7 @@ void test_index_tests__preserves_case(void)
 	cl_assert(git__strcmp(entry->path, "test.txt") == 0);
 
 	cl_assert((entry = git_index_get_bypath(index, "TEST.txt", 0)) != NULL);
-	if (index_caps & GIT_INDEXCAP_IGNORE_CASE)
+	if (index_caps & GIT_INDEX_CAPABILITY_IGNORE_CASE)
 		/* The path should *not* have changed without an explicit remove */
 		cl_assert(git__strcmp(entry->path, "test.txt") == 0);
 	else
@@ -923,13 +923,13 @@ void test_index_tests__reload_while_ignoring_case(void)
 	cl_git_pass(git_vector_verify_sorted(&index->entries));
 
 	caps = git_index_caps(index);
-	cl_git_pass(git_index_set_caps(index, caps &= ~GIT_INDEXCAP_IGNORE_CASE));
+	cl_git_pass(git_index_set_caps(index, caps &= ~GIT_INDEX_CAPABILITY_IGNORE_CASE));
 	cl_git_pass(git_index_read(index, true));
 	cl_git_pass(git_vector_verify_sorted(&index->entries));
 	cl_assert(git_index_get_bypath(index, ".HEADER", 0));
 	cl_assert_equal_p(NULL, git_index_get_bypath(index, ".header", 0));
 
-	cl_git_pass(git_index_set_caps(index, caps | GIT_INDEXCAP_IGNORE_CASE));
+	cl_git_pass(git_index_set_caps(index, caps | GIT_INDEX_CAPABILITY_IGNORE_CASE));
 	cl_git_pass(git_index_read(index, true));
 	cl_git_pass(git_vector_verify_sorted(&index->entries));
 	cl_assert(git_index_get_bypath(index, ".HEADER", 0));
@@ -948,7 +948,7 @@ void test_index_tests__change_icase_on_instance(void)
 	cl_git_pass(git_vector_verify_sorted(&index->entries));
 
 	caps = git_index_caps(index);
-	cl_git_pass(git_index_set_caps(index, caps &= ~GIT_INDEXCAP_IGNORE_CASE));
+	cl_git_pass(git_index_set_caps(index, caps &= ~GIT_INDEX_CAPABILITY_IGNORE_CASE));
 	cl_assert_equal_i(false, index->ignore_case);
 	cl_git_pass(git_vector_verify_sorted(&index->entries));
 	cl_assert(e = git_index_get_bypath(index, "src/common.h", 0));
@@ -956,7 +956,7 @@ void test_index_tests__change_icase_on_instance(void)
 	cl_assert(e = git_index_get_bypath(index, "COPYING", 0));
 	cl_assert_equal_p(NULL, e = git_index_get_bypath(index, "copying", 0));
 
-	cl_git_pass(git_index_set_caps(index, caps | GIT_INDEXCAP_IGNORE_CASE));
+	cl_git_pass(git_index_set_caps(index, caps | GIT_INDEX_CAPABILITY_IGNORE_CASE));
 	cl_assert_equal_i(true, index->ignore_case);
 	cl_git_pass(git_vector_verify_sorted(&index->entries));
 	cl_assert(e = git_index_get_bypath(index, "COPYING", 0));
diff --git a/tests/iterator/index.c b/tests/iterator/index.c
index 7de0d12..8c7efb2 100644
--- a/tests/iterator/index.c
+++ b/tests/iterator/index.c
@@ -222,10 +222,10 @@ static void check_index_range(
 	cl_git_pass(git_repository_index(&index, repo));
 
 	caps = git_index_caps(index);
-	is_ignoring_case = ((caps & GIT_INDEXCAP_IGNORE_CASE) != 0);
+	is_ignoring_case = ((caps & GIT_INDEX_CAPABILITY_IGNORE_CASE) != 0);
 
 	if (ignore_case != is_ignoring_case)
-		cl_git_pass(git_index_set_caps(index, caps ^ GIT_INDEXCAP_IGNORE_CASE));
+		cl_git_pass(git_index_set_caps(index, caps ^ GIT_INDEX_CAPABILITY_IGNORE_CASE));
 
 	i_opts.flags = 0;
 	i_opts.start = start;
@@ -363,7 +363,7 @@ void test_iterator_index__icase_1(void)
 	caps = git_index_caps(index);
 
 	/* force case sensitivity */
-	cl_git_pass(git_index_set_caps(index, caps & ~GIT_INDEXCAP_IGNORE_CASE));
+	cl_git_pass(git_index_set_caps(index, caps & ~GIT_INDEX_CAPABILITY_IGNORE_CASE));
 
 	/* autoexpand with no tree entries over range */
 	i_opts.start = "c";
@@ -409,7 +409,7 @@ void test_iterator_index__icase_1(void)
 	git_iterator_free(i);
 
 	/* force case insensitivity */
-	cl_git_pass(git_index_set_caps(index, caps | GIT_INDEXCAP_IGNORE_CASE));
+	cl_git_pass(git_index_set_caps(index, caps | GIT_INDEX_CAPABILITY_IGNORE_CASE));
 
 	/* autoexpand with no tree entries over range */
 	i_opts.flags = 0;
@@ -783,7 +783,7 @@ void test_iterator_index__pathlist_1(void)
 	cl_git_pass(git_vector_insert(&filelist, "k/a"));
 
 	/* In this test we DO NOT force a case setting on the index. */
-	default_icase = ((git_index_caps(index) & GIT_INDEXCAP_IGNORE_CASE) != 0);
+	default_icase = ((git_index_caps(index) & GIT_INDEX_CAPABILITY_IGNORE_CASE) != 0);
 
 	i_opts.pathlist.strings = (char **)filelist.contents;
 	i_opts.pathlist.count = filelist.length;
@@ -825,7 +825,7 @@ void test_iterator_index__pathlist_2(void)
 	cl_git_pass(git_vector_insert(&filelist, "kZZZZZZZ"));
 
 	/* In this test we DO NOT force a case setting on the index. */
-	default_icase = ((git_index_caps(index) & GIT_INDEXCAP_IGNORE_CASE) != 0);
+	default_icase = ((git_index_caps(index) & GIT_INDEX_CAPABILITY_IGNORE_CASE) != 0);
 
 	i_opts.pathlist.strings = (char **)filelist.contents;
 	i_opts.pathlist.count = filelist.length;
@@ -867,7 +867,7 @@ void test_iterator_index__pathlist_four(void)
 	cl_git_pass(git_vector_insert(&filelist, "kZZZZZZZ"));
 
 	/* In this test we DO NOT force a case setting on the index. */
-	default_icase = ((git_index_caps(index) & GIT_INDEXCAP_IGNORE_CASE) != 0);
+	default_icase = ((git_index_caps(index) & GIT_INDEX_CAPABILITY_IGNORE_CASE) != 0);
 
 	i_opts.pathlist.strings = (char **)filelist.contents;
 	i_opts.pathlist.count = filelist.length;
@@ -910,7 +910,7 @@ void test_iterator_index__pathlist_icase(void)
 	caps = git_index_caps(index);
 
 	/* force case sensitivity */
-	cl_git_pass(git_index_set_caps(index, caps & ~GIT_INDEXCAP_IGNORE_CASE));
+	cl_git_pass(git_index_set_caps(index, caps & ~GIT_INDEX_CAPABILITY_IGNORE_CASE));
 
 	/* All indexfilelist iterator tests are "autoexpand with no tree entries" */
 
@@ -930,7 +930,7 @@ void test_iterator_index__pathlist_icase(void)
 	git_iterator_free(i);
 
 	/* force case insensitivity */
-	cl_git_pass(git_index_set_caps(index, caps | GIT_INDEXCAP_IGNORE_CASE));
+	cl_git_pass(git_index_set_caps(index, caps | GIT_INDEX_CAPABILITY_IGNORE_CASE));
 
 	i_opts.start = "c";
 	i_opts.end = "k/D";
@@ -1297,17 +1297,17 @@ static void add_conflict(
 	ancestor.path = ancestor_path;
 	ancestor.mode = GIT_FILEMODE_BLOB;
 	git_oid_fromstr(&ancestor.id, "d44e18fb93b7107b5cd1b95d601591d77869a1b6");
-	GIT_IDXENTRY_STAGE_SET(&ancestor, 1);
+	GIT_INDEX_ENTRY_STAGE_SET(&ancestor, 1);
 
 	ours.path = our_path;
 	ours.mode = GIT_FILEMODE_BLOB;
 	git_oid_fromstr(&ours.id, "d44e18fb93b7107b5cd1b95d601591d77869a1b6");
-	GIT_IDXENTRY_STAGE_SET(&ours, 2);
+	GIT_INDEX_ENTRY_STAGE_SET(&ours, 2);
 
 	theirs.path = their_path;
 	theirs.mode = GIT_FILEMODE_BLOB;
 	git_oid_fromstr(&theirs.id, "d44e18fb93b7107b5cd1b95d601591d77869a1b6");
-	GIT_IDXENTRY_STAGE_SET(&theirs, 3);
+	GIT_INDEX_ENTRY_STAGE_SET(&theirs, 3);
 
 	cl_git_pass(git_index_conflict_add(index, &ancestor, &ours, &theirs));
 }
diff --git a/tests/object/tree/duplicateentries.c b/tests/object/tree/duplicateentries.c
index 35dd383..c11ae0d 100644
--- a/tests/object/tree/duplicateentries.c
+++ b/tests/object/tree/duplicateentries.c
@@ -18,9 +18,9 @@ void test_object_tree_duplicateentries__cleanup(void) {
  * parent cf80f8de9f1185bf3a05f993f6121880dd0cfbc9
  * author Ben Straub <bstraub@github.com> 1343755506 -0700
  * committer Ben Straub <bstraub@github.com> 1343755506 -0700
- * 
+ *
  *     Change a file mode
- * 
+ *
  * diff --git a/a/b.txt b/a/b.txt
  * old mode 100644
  * new mode 100755
@@ -69,7 +69,7 @@ static void two_blobs(git_treebuilder *bld)
 {
 	git_oid oid;
 	const git_tree_entry *entry;
-	
+
 	cl_git_pass(git_oid_fromstr(&oid,
 		"a8233120f6ad708f843d861ce2b7228ec4e3dec6"));	/* blob oid (README) */
 
@@ -89,7 +89,7 @@ static void one_blob_and_one_tree(git_treebuilder *bld)
 {
 	git_oid oid;
 	const git_tree_entry *entry;
-	
+
 	cl_git_pass(git_oid_fromstr(&oid,
 		"a8233120f6ad708f843d861ce2b7228ec4e3dec6"));	/* blob oid (README) */
 
@@ -111,7 +111,7 @@ void test_object_tree_duplicateentries__cannot_create_a_duplicate_entry_through_
 
 	tree_creator(&tid, two_blobs);
 	tree_checker(&tid, "a71586c1dfe8a71c6cbf6c129f404c5642ff31bd", GIT_FILEMODE_BLOB);
-	
+
 	tree_creator(&tid, one_blob_and_one_tree);
 	tree_checker(&tid, "4e0883eeeeebc1fb1735161cea82f7cb5fab7e63", GIT_FILEMODE_TREE);
 }
@@ -126,17 +126,17 @@ static void add_fake_conflicts(git_index *index)
 
 	ancestor_entry.path = "duplicate";
 	ancestor_entry.mode = GIT_FILEMODE_BLOB;
-	GIT_IDXENTRY_STAGE_SET(&ancestor_entry, 1);
+	GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 1);
 	git_oid_fromstr(&ancestor_entry.id, "a8233120f6ad708f843d861ce2b7228ec4e3dec6");
 
 	our_entry.path = "duplicate";
 	our_entry.mode = GIT_FILEMODE_BLOB;
-	GIT_IDXENTRY_STAGE_SET(&our_entry, 2);
+	GIT_INDEX_ENTRY_STAGE_SET(&our_entry, 2);
 	git_oid_fromstr(&our_entry.id, "45b983be36b73c0788dc9cbcb76cbb80fc7bb057");
 
 	their_entry.path = "duplicate";
 	their_entry.mode = GIT_FILEMODE_BLOB;
-	GIT_IDXENTRY_STAGE_SET(&their_entry, 3);
+	GIT_INDEX_ENTRY_STAGE_SET(&their_entry, 3);
 	git_oid_fromstr(&their_entry.id, "a71586c1dfe8a71c6cbf6c129f404c5642ff31bd");
 
 	cl_git_pass(git_index_conflict_add(index, &ancestor_entry, &our_entry, &their_entry));
@@ -149,7 +149,7 @@ void test_object_tree_duplicateentries__cannot_create_a_duplicate_entry_building
 
 	cl_git_pass(git_repository_index(&index, _repo));
 
-	add_fake_conflicts(index); 
+	add_fake_conflicts(index);
 
 	cl_assert_equal_i(GIT_EUNMERGED, git_index_write_tree(&tid, index));
 
diff --git a/tests/reset/hard.c b/tests/reset/hard.c
index c63640e..d47ddd8 100644
--- a/tests/reset/hard.c
+++ b/tests/reset/hard.c
@@ -108,7 +108,7 @@ static void index_entry_init(git_index *index, int side, git_oid *oid)
 	memset(&entry, 0x0, sizeof(git_index_entry));
 
 	entry.path = "conflicting_file";
-	GIT_IDXENTRY_STAGE_SET(&entry, side);
+	GIT_INDEX_ENTRY_STAGE_SET(&entry, side);
 	entry.mode = 0100644;
 	git_oid_cpy(&entry.id, oid);
 
diff --git a/tests/status/ignore.c b/tests/status/ignore.c
index c986a6b..4965821 100644
--- a/tests/status/ignore.c
+++ b/tests/status/ignore.c
@@ -167,7 +167,7 @@ void test_status_ignore__ignore_pattern_ignorecase(void)
 	cl_git_mkfile("empty_standard_repo/A.txt", "Differs in case");
 
 	cl_git_pass(git_repository_index(&index, g_repo));
-	ignore_case = (git_index_caps(index) & GIT_INDEXCAP_IGNORE_CASE) != 0;
+	ignore_case = (git_index_caps(index) & GIT_INDEX_CAPABILITY_IGNORE_CASE) != 0;
 	git_index_free(index);
 
 	cl_git_pass(git_status_file(&flags, g_repo, "A.txt"));
diff --git a/tests/status/renames.c b/tests/status/renames.c
index 4459952..7deec98 100644
--- a/tests/status/renames.c
+++ b/tests/status/renames.c
@@ -483,7 +483,7 @@ void test_status_renames__both_casechange_one(void)
 
 	cl_git_pass(git_status_list_new(&statuslist, g_repo, &opts));
 
-	check_status(statuslist, (index_caps & GIT_INDEXCAP_IGNORE_CASE) ?
+	check_status(statuslist, (index_caps & GIT_INDEX_CAPABILITY_IGNORE_CASE) ?
 		expected_icase : expected_case, 1);
 
 	git_status_list_free(statuslist);
@@ -550,7 +550,7 @@ void test_status_renames__both_casechange_two(void)
 
 	cl_git_pass(git_status_list_new(&statuslist, g_repo, &opts));
 
-	check_status(statuslist, (index_caps & GIT_INDEXCAP_IGNORE_CASE) ?
+	check_status(statuslist, (index_caps & GIT_INDEX_CAPABILITY_IGNORE_CASE) ?
 		expected_icase : expected_case, 4);
 
 	git_status_list_free(statuslist);
diff --git a/tests/status/worktree.c b/tests/status/worktree.c
index 7abc703..a83813e 100644
--- a/tests/status/worktree.c
+++ b/tests/status/worktree.c
@@ -154,7 +154,7 @@ void test_status_worktree__swap_subdir_and_file(void)
 	bool ignore_case;
 
 	cl_git_pass(git_repository_index(&index, repo));
-	ignore_case = (git_index_caps(index) & GIT_INDEXCAP_IGNORE_CASE) != 0;
+	ignore_case = (git_index_caps(index) & GIT_INDEX_CAPABILITY_IGNORE_CASE) != 0;
 	git_index_free(index);
 
 	/* first alter the contents of the worktree */
@@ -889,7 +889,7 @@ void test_status_worktree__sorting_by_case(void)
 
 	cl_git_pass(git_repository_index(&index, repo));
 	native_ignore_case =
-		(git_index_caps(index) & GIT_INDEXCAP_IGNORE_CASE) != 0;
+		(git_index_caps(index) & GIT_INDEX_CAPABILITY_IGNORE_CASE) != 0;
 	git_index_free(index);
 
 	memset(&counts, 0, sizeof(counts));
@@ -1222,7 +1222,7 @@ void test_status_worktree__with_directory_in_pathlist(void)
 
 	cl_git_pass(git_repository_index(&index, repo));
 	native_ignore_case =
-			(git_index_caps(index) & GIT_INDEXCAP_IGNORE_CASE) != 0;
+			(git_index_caps(index) & GIT_INDEX_CAPABILITY_IGNORE_CASE) != 0;
 	git_index_free(index);
 
 	opts.pathspec.strings = &subdir_path;