Commit 87d9869fc30951cec632e0d6a3d1dd47756d2886

Vicent Marti 2011-09-19T03:34:49

Tabify everything There were quite a few places were spaces were being used instead of tabs. Try to catch them all. This should hopefully not break anything. Except for `git blame`. Oh well.

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
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
diff --git a/include/git2/commit.h b/include/git2/commit.h
index 2e94a64..3c90e80 100644
--- a/include/git2/commit.h
+++ b/include/git2/commit.h
@@ -26,8 +26,8 @@ GIT_BEGIN_DECL
  *
  * @param commit pointer to the looked up commit
  * @param repo the repo to use when locating the commit.
- * @param id identity of the commit to locate.  If the object is
- *        an annotated tag it will be peeled back to the commit.
+ * @param id identity of the commit to locate. If the object is
+ *		an annotated tag it will be peeled back to the commit.
  * @return GIT_SUCCESS or an error code
  */
 GIT_INLINE(int) git_commit_lookup(git_commit **commit, git_repository *repo, const git_oid *id)
@@ -43,8 +43,8 @@ GIT_INLINE(int) git_commit_lookup(git_commit **commit, git_repository *repo, con
  *
  * @param commit pointer to the looked up commit
  * @param repo the repo to use when locating the commit.
- * @param id identity of the commit to locate.  If the object is
- *        an annotated tag it will be peeled back to the commit.
+ * @param id identity of the commit to locate. If the object is
+ *		an annotated tag it will be peeled back to the commit.
  * @param len the length of the short identifier
  * @return GIT_SUCCESS or an error code
  */
@@ -197,7 +197,7 @@ GIT_EXTERN(const git_oid *) git_commit_parent_oid(git_commit *commit, unsigned i
  *	time of this commit
  *
  * @param committer Signature representing the committer and the
- *  commit time of this commit
+ * commit time of this commit
  *
  * @param message_encoding The encoding for the message in the
  * commit, represented with a standard encoding name.
diff --git a/include/git2/common.h b/include/git2/common.h
index f143140..1a595b0 100644
--- a/include/git2/common.h
+++ b/include/git2/common.h
@@ -12,20 +12,20 @@
 #include <stdlib.h>
 
 #ifdef __cplusplus
-# define GIT_BEGIN_DECL  extern "C" {
-# define GIT_END_DECL    }
+# define GIT_BEGIN_DECL extern "C" {
+# define GIT_END_DECL	}
 #else
-  /** Start declarations in C mode */
-# define GIT_BEGIN_DECL  /* empty */
-  /** End declarations in C mode */
-# define GIT_END_DECL    /* empty */
+ /** Start declarations in C mode */
+# define GIT_BEGIN_DECL /* empty */
+ /** End declarations in C mode */
+# define GIT_END_DECL	/* empty */
 #endif
 
 /** Declare a public function exported for application use. */
 #ifdef __GNUC__
 # define GIT_EXTERN(type) extern \
-			  __attribute__((visibility("default"))) \
-			  type
+			 __attribute__((visibility("default"))) \
+			 type
 #elif defined(_MSC_VER)
 # define GIT_EXTERN(type) __declspec(dllexport) type
 #else
@@ -35,9 +35,9 @@
 /** Declare a public TLS symbol exported for application use. */
 #ifdef __GNUC__
 # define GIT_EXTERN_TLS(type) extern \
-			      __attribute__((visibility("default"))) \
-			      GIT_TLS \
-			      type
+					__attribute__((visibility("default"))) \
+					GIT_TLS \
+					type
 #elif defined(_MSC_VER)
 # define GIT_EXTERN_TLS(type) __declspec(dllexport) GIT_TLS type
 #else
diff --git a/include/git2/errors.h b/include/git2/errors.h
index 8b9fe3b..5ac0d5b 100644
--- a/include/git2/errors.h
+++ b/include/git2/errors.h
@@ -64,7 +64,7 @@ typedef enum {
 	GIT_EINVALIDREFNAME = -15,
 
 	/** The specified reference has its data corrupted */
-	GIT_EREFCORRUPTED  = -16,
+	GIT_EREFCORRUPTED = -16,
 
 	/** The specified symbolic reference is too deeply nested */
 	GIT_ETOONESTEDSYMREF = -17,
@@ -111,7 +111,7 @@ typedef enum {
 	/** The path pattern and string did not match */
 	GIT_ENOMATCH = -31,
 
-	/**  The buffer is too short to satisfy the request */
+	/** The buffer is too short to satisfy the request */
 	GIT_ESHORTBUFFER = -32,
 } git_error;
 
diff --git a/include/git2/index.h b/include/git2/index.h
index 70d928b..5e9c34d 100644
--- a/include/git2/index.h
+++ b/include/git2/index.h
@@ -20,10 +20,10 @@
  */
 GIT_BEGIN_DECL
 
-#define GIT_IDXENTRY_NAMEMASK  (0x0fff)
+#define GIT_IDXENTRY_NAMEMASK (0x0fff)
 #define GIT_IDXENTRY_STAGEMASK (0x3000)
-#define GIT_IDXENTRY_EXTENDED  (0x4000)
-#define GIT_IDXENTRY_VALID     (0x8000)
+#define GIT_IDXENTRY_EXTENDED (0x4000)
+#define GIT_IDXENTRY_VALID		(0x8000)
 #define GIT_IDXENTRY_STAGESHIFT 12
 
 /*
@@ -33,26 +33,26 @@ GIT_BEGIN_DECL
  *
  * In-memory only flags:
  */
-#define GIT_IDXENTRY_UPDATE            (1 << 0)
-#define GIT_IDXENTRY_REMOVE            (1 << 1)
-#define GIT_IDXENTRY_UPTODATE          (1 << 2)
-#define GIT_IDXENTRY_ADDED             (1 << 3)
+#define GIT_IDXENTRY_UPDATE			(1 << 0)
+#define GIT_IDXENTRY_REMOVE			(1 << 1)
+#define GIT_IDXENTRY_UPTODATE			(1 << 2)
+#define GIT_IDXENTRY_ADDED				(1 << 3)
 
-#define GIT_IDXENTRY_HASHED            (1 << 4)
-#define GIT_IDXENTRY_UNHASHED          (1 << 5)
-#define GIT_IDXENTRY_WT_REMOVE         (1 << 6) /* remove in work directory */
-#define GIT_IDXENTRY_CONFLICTED        (1 << 7)
+#define GIT_IDXENTRY_HASHED			(1 << 4)
+#define GIT_IDXENTRY_UNHASHED			(1 << 5)
+#define GIT_IDXENTRY_WT_REMOVE			(1 << 6) /* remove in work directory */
+#define GIT_IDXENTRY_CONFLICTED		(1 << 7)
 
-#define GIT_IDXENTRY_UNPACKED          (1 << 8)
+#define GIT_IDXENTRY_UNPACKED			(1 << 8)
 #define GIT_IDXENTRY_NEW_SKIP_WORKTREE (1 << 9)
 
 /*
  * Extended on-disk flags:
  */
-#define GIT_IDXENTRY_INTENT_TO_ADD     (1 << 13)
-#define GIT_IDXENTRY_SKIP_WORKTREE     (1 << 14)
+#define GIT_IDXENTRY_INTENT_TO_ADD		(1 << 13)
+#define GIT_IDXENTRY_SKIP_WORKTREE		(1 << 14)
 /* GIT_IDXENTRY_EXTENDED2 is for future extension */
-#define GIT_IDXENTRY_EXTENDED2         (1 << 15)
+#define GIT_IDXENTRY_EXTENDED2			(1 << 15)
 
 #define GIT_IDXENTRY_EXTENDED_FLAGS (GIT_IDXENTRY_INTENT_TO_ADD | GIT_IDXENTRY_SKIP_WORKTREE)
 
diff --git a/include/git2/odb.h b/include/git2/odb.h
index 0f719ae..2783741 100644
--- a/include/git2/odb.h
+++ b/include/git2/odb.h
@@ -28,7 +28,7 @@ GIT_BEGIN_DECL
  * backend must be manually added using `git_odb_add_backend()`
  *
  * @param out location to store the database pointer, if opened.
- *            Set to NULL if the open failed.
+ *			Set to NULL if the open failed.
  * @return GIT_SUCCESS or an error code
  */
 GIT_EXTERN(int) git_odb_new(git_odb **out);
@@ -45,7 +45,7 @@ GIT_EXTERN(int) git_odb_new(git_odb **out);
  *		contains a 'pack/' folder with the corresponding data
  *
  * @param out location to store the database pointer, if opened.
- *            Set to NULL if the open failed.
+ *			Set to NULL if the open failed.
  * @param objects_dir path of the backends' "objects" directory.
  * @return GIT_SUCCESS or an error code
  */
@@ -90,7 +90,7 @@ GIT_EXTERN(int) git_odb_add_alternate(git_odb *odb, git_odb_backend *backend, in
 /**
  * Close an open object database.
  *
- * @param db database pointer to close.  If NULL no action is taken.
+ * @param db database pointer to close. If NULL no action is taken.
  */
 GIT_EXTERN(void) git_odb_close(git_odb *db);
 
diff --git a/include/git2/oid.h b/include/git2/oid.h
index 2dd9e4f..f9636d1 100644
--- a/include/git2/oid.h
+++ b/include/git2/oid.h
@@ -41,8 +41,8 @@ struct _git_oid {
  *
  * @param out oid structure the result is written into.
  * @param str input hex string; must be pointing at the start of
- *        the hex sequence and have at least the number of bytes
- *        needed for an oid encoded in hex (40 bytes).
+ *		the hex sequence and have at least the number of bytes
+ *		needed for an oid encoded in hex (40 bytes).
  * @return GIT_SUCCESS or an error code
  */
 GIT_EXTERN(int) git_oid_fromstr(git_oid *out, const char *str);
@@ -72,10 +72,10 @@ GIT_EXTERN(void) git_oid_fromraw(git_oid *out, const unsigned char *raw);
  * Format a git_oid into a hex string.
  *
  * @param str output hex string; must be pointing at the start of
- *        the hex sequence and have at least the number of bytes
- *        needed for an oid encoded in hex (40 bytes).  Only the
- *        oid digits are written; a '\\0' terminator must be added
- *        by the caller if it is required.
+ *		the hex sequence and have at least the number of bytes
+ *		needed for an oid encoded in hex (40 bytes). Only the
+ *		oid digits are written; a '\\0' terminator must be added
+ *		by the caller if it is required.
  * @param oid oid structure to format.
  */
 GIT_EXTERN(void) git_oid_fmt(char *str, const git_oid *oid);
@@ -87,10 +87,10 @@ GIT_EXTERN(void) git_oid_fmt(char *str, const git_oid *oid);
  * hex digitis of the oid and "..." is the remaining 38 digits.
  *
  * @param str output hex string; must be pointing at the start of
- *        the hex sequence and have at least the number of bytes
- *        needed for an oid encoded in hex (41 bytes).  Only the
- *        oid digits are written; a '\\0' terminator must be added
- *        by the caller if it is required.
+ *		the hex sequence and have at least the number of bytes
+ *		needed for an oid encoded in hex (41 bytes). Only the
+ *		oid digits are written; a '\\0' terminator must be added
+ *		by the caller if it is required.
  * @param oid oid structure to format.
  */
 GIT_EXTERN(void) git_oid_pathfmt(char *str, const git_oid *oid);
@@ -99,8 +99,8 @@ GIT_EXTERN(void) git_oid_pathfmt(char *str, const git_oid *oid);
  * Format a git_oid into a newly allocated c-string.
  *
  * @param oid the oid structure to format
- * @return the c-string; NULL if memory is exhausted.  Caller must
- *         deallocate the string with free().
+ * @return the c-string; NULL if memory is exhausted. Caller must
+ *			deallocate the string with free().
  */
 GIT_EXTERN(char *) git_oid_allocfmt(const git_oid *oid);
 
@@ -117,7 +117,7 @@ GIT_EXTERN(char *) git_oid_allocfmt(const git_oid *oid);
  * @param n the size of the out buffer.
  * @param oid the oid structure to format.
  * @return the out buffer pointer, assuming no input parameter
- *         errors, otherwise a pointer to an empty string.
+ *			errors, otherwise a pointer to an empty string.
  */
 GIT_EXTERN(char *) git_oid_to_string(char *out, size_t n, const git_oid *oid);
 
diff --git a/include/git2/revwalk.h b/include/git2/revwalk.h
index b232de8..c84c5d3 100644
--- a/include/git2/revwalk.h
+++ b/include/git2/revwalk.h
@@ -26,28 +26,28 @@ GIT_BEGIN_DECL
  * and subject to change at any time.
  * This is the default sorting for new walkers.
  */
-#define GIT_SORT_NONE         (0)
+#define GIT_SORT_NONE			(0)
 
 /**
  * Sort the repository contents in topological order
  * (parents before children); this sorting mode
  * can be combined with time sorting.
  */
-#define GIT_SORT_TOPOLOGICAL  (1 << 0)
+#define GIT_SORT_TOPOLOGICAL (1 << 0)
 
 /**
  * Sort the repository contents by commit time;
  * this sorting mode can be combined with
  * topological sorting.
  */
-#define GIT_SORT_TIME         (1 << 1)
+#define GIT_SORT_TIME			(1 << 1)
 
 /**
  * Iterate through the repository contents in reverse
  * order; this sorting mode can be combined with
  * any of the above.
  */
-#define GIT_SORT_REVERSE      (1 << 2)
+#define GIT_SORT_REVERSE		(1 << 2)
 
 /**
  * Allocate a new revision walker to iterate through a repo.
@@ -151,7 +151,7 @@ GIT_EXTERN(void) git_revwalk_sorting(git_revwalk *walk, unsigned int sort_mode);
 /**
  * Free a revision walker previously allocated.
  *
- * @param walk traversal handle to close.  If NULL nothing occurs.
+ * @param walk traversal handle to close. If NULL nothing occurs.
  */
 GIT_EXTERN(void) git_revwalk_free(git_revwalk *walk);
 
diff --git a/include/git2/status.h b/include/git2/status.h
index 5f498d8..42b2dd1 100644
--- a/include/git2/status.h
+++ b/include/git2/status.h
@@ -19,19 +19,19 @@
  */
 GIT_BEGIN_DECL
 
-#define GIT_STATUS_CURRENT        0
+#define GIT_STATUS_CURRENT		0
 /** Flags for index status */
-#define GIT_STATUS_INDEX_NEW      (1 << 0)
+#define GIT_STATUS_INDEX_NEW		(1 << 0)
 #define GIT_STATUS_INDEX_MODIFIED (1 << 1)
-#define GIT_STATUS_INDEX_DELETED  (1 << 2)
+#define GIT_STATUS_INDEX_DELETED (1 << 2)
 
 /** Flags for worktree status */
-#define GIT_STATUS_WT_NEW         (1 << 3)
-#define GIT_STATUS_WT_MODIFIED    (1 << 4)
-#define GIT_STATUS_WT_DELETED     (1 << 5)
+#define GIT_STATUS_WT_NEW			(1 << 3)
+#define GIT_STATUS_WT_MODIFIED	(1 << 4)
+#define GIT_STATUS_WT_DELETED		(1 << 5)
 
 // TODO Ignored files not handled yet
-#define GIT_STATUS_IGNORED        (1 << 6)
+#define GIT_STATUS_IGNORED		(1 << 6)
 
 /**
  * Gather file statuses and run a callback for each one.
diff --git a/include/git2/tag.h b/include/git2/tag.h
index baf7f9d..63a5228 100644
--- a/include/git2/tag.h
+++ b/include/git2/tag.h
@@ -152,7 +152,7 @@ GIT_EXTERN(const char *) git_tag_message(git_tag *tag);
  * must belong to the given `repo`.
  *
  * @param tagger Signature of the tagger for this tag, and
- *  of the tagging time
+ * of the tagging time
  *
  * @param message Full message for this tag
  *
@@ -211,7 +211,7 @@ GIT_EXTERN(int) git_tag_create_frombuffer(
  *
  * @return GIT_SUCCESS or an error code
  *	A proper reference is written in the /refs/tags folder,
- *  pointing to the provided target object
+ * pointing to the provided target object
  */
 GIT_EXTERN(int) git_tag_create_lightweight(
 		git_oid *oid,
diff --git a/include/git2/thread-utils.h b/include/git2/thread-utils.h
index e5085fc..81c62d1 100644
--- a/include/git2/thread-utils.h
+++ b/include/git2/thread-utils.h
@@ -10,51 +10,51 @@
 /*
  * How TLS works is compiler+platform dependant
  * Sources: http://en.wikipedia.org/wiki/Thread-Specific_Storage
- *          http://predef.sourceforge.net/precomp.html
+ *			http://predef.sourceforge.net/precomp.html
  */
 
 #ifdef GIT_THREADS
-#  define GIT_HAS_TLS 1
+#	define GIT_HAS_TLS 1
 
 /* No TLS in Cygwin */
-#  if defined(__CHECKER__) || defined(__CYGWIN__)
-#    undef GIT_HAS_TLS
-#    define GIT_TLS
+#	if defined(__CHECKER__) || defined(__CYGWIN__)
+#		undef GIT_HAS_TLS
+#		define GIT_TLS
 
 /* No TLS in Mach binaries for Mac OS X */
-#  elif defined(__APPLE__) && defined(__MACH__)
-#    undef GIT_TLS
-#    define GIT_TLS
+#	elif defined(__APPLE__) && defined(__MACH__)
+#		undef GIT_TLS
+#		define GIT_TLS
 
 /* Normal TLS for GCC */
-#  elif defined(__GNUC__) || \
-        defined(__SUNPRO_C) || \
-        defined(__SUNPRO_CC) || \
-        defined(__xlc__) || \
-        defined(__xlC__)
-#    define GIT_TLS __thread
+#	elif defined(__GNUC__) || \
+		defined(__SUNPRO_C) || \
+		defined(__SUNPRO_CC) || \
+		defined(__xlc__) || \
+		defined(__xlC__)
+#		define GIT_TLS __thread
 
 /* ICC may run on Windows or Linux */
-#  elif defined(__INTEL_COMPILER)
-#    if defined(_WIN32) || defined(_WIN32_CE)
-#      define GIT_TLS __declspec(thread)
-#    else
-#      define GIT_TLS __thread
-#    endif
+#	elif defined(__INTEL_COMPILER)
+#		if defined(_WIN32) || defined(_WIN32_CE)
+#		define GIT_TLS __declspec(thread)
+#		else
+#		define GIT_TLS __thread
+#		endif
 
 /* Declspec for MSVC in Win32 */
-#  elif defined(_WIN32) || \
-        defined(_WIN32_CE) || \
-        defined(__BORLANDC__)
-#    define GIT_TLS __declspec(thread)
+#	elif defined(_WIN32) || \
+		defined(_WIN32_CE) || \
+		defined(__BORLANDC__)
+#		define GIT_TLS __declspec(thread)
 
 /* Other platform; no TLS */
-#  else
-#    undef GIT_HAS_TLS
-#    define GIT_TLS /* nothing: tls vars are thread-global */
-#  endif
+#	else
+#		undef GIT_HAS_TLS
+#		define GIT_TLS /* nothing: tls vars are thread-global */
+#	endif
 #else /* Disable TLS if libgit2 is not threadsafe */
-#  define GIT_TLS
+#	define GIT_TLS
 #endif /* GIT_THREADS */
 
 #endif /* INCLUDE_git_thread_utils_h__ */
diff --git a/include/git2/types.h b/include/git2/types.h
index d4edda5..1df1897 100644
--- a/include/git2/types.h
+++ b/include/git2/types.h
@@ -36,7 +36,7 @@ GIT_BEGIN_DECL
 #if defined(_MSC_VER)
 
 typedef __int64 git_off_t;
-typedef __time64_t  git_time_t;
+typedef __time64_t git_time_t;
 
 #elif defined(__MINGW32__)
 
@@ -48,7 +48,7 @@ typedef __time64_t git_time_t;
 typedef __haiku_std_int64 git_off_t;
 typedef __haiku_std_int64 git_time_t;
 
-#else  /* POSIX */
+#else /* POSIX */
 
 /*
  * Note: Can't use off_t since if a client program includes <sys/types.h>
@@ -63,15 +63,15 @@ typedef int64_t git_time_t;
 /** Basic type (loose or packed) of any Git object. */
 typedef enum {
 	GIT_OBJ_ANY = -2,		/**< Object can be any of the following */
-	GIT_OBJ_BAD = -1,       /**< Object is invalid. */
-	GIT_OBJ__EXT1 = 0,      /**< Reserved for future use. */
-	GIT_OBJ_COMMIT = 1,     /**< A commit object. */
-	GIT_OBJ_TREE = 2,       /**< A tree (directory listing) object. */
-	GIT_OBJ_BLOB = 3,       /**< A file revision object. */
-	GIT_OBJ_TAG = 4,        /**< An annotated tag object. */
-	GIT_OBJ__EXT2 = 5,      /**< Reserved for future use. */
-	GIT_OBJ_OFS_DELTA = 6,  /**< A delta, base is given by an offset. */
-	GIT_OBJ_REF_DELTA = 7,  /**< A delta, base is given by object id. */
+	GIT_OBJ_BAD = -1,		/**< Object is invalid. */
+	GIT_OBJ__EXT1 = 0,		/**< Reserved for future use. */
+	GIT_OBJ_COMMIT = 1,		/**< A commit object. */
+	GIT_OBJ_TREE = 2,		/**< A tree (directory listing) object. */
+	GIT_OBJ_BLOB = 3,		/**< A file revision object. */
+	GIT_OBJ_TAG = 4,		/**< An annotated tag object. */
+	GIT_OBJ__EXT2 = 5,		/**< Reserved for future use. */
+	GIT_OBJ_OFS_DELTA = 6, /**< A delta, base is given by an offset. */
+	GIT_OBJ_REF_DELTA = 7, /**< A delta, base is given by object id. */
 } git_otype;
 
 /** An open object database handle. */
diff --git a/src/bswap.h b/src/bswap.h
index edb64a2..0914906 100644
--- a/src/bswap.h
+++ b/src/bswap.h
@@ -14,8 +14,8 @@
 GIT_INLINE(uint32_t) default_swab32(uint32_t val)
 {
 	return (((val & 0xff000000) >> 24) |
-		((val & 0x00ff0000) >>  8) |
-		((val & 0x0000ff00) <<  8) |
+		((val & 0x00ff0000) >> 8) |
+		((val & 0x0000ff00) << 8) |
 		((val & 0x000000ff) << 24));
 }
 
diff --git a/src/cc-compat.h b/src/cc-compat.h
index 521e491..cce4ca9 100644
--- a/src/cc-compat.h
+++ b/src/cc-compat.h
@@ -12,18 +12,18 @@
  */
 #ifndef GIT_FLEX_ARRAY
 # if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L)
-#  define GIT_FLEX_ARRAY /* empty */
+#	define GIT_FLEX_ARRAY /* empty */
 # elif defined(__GNUC__)
-#  if (__GNUC__ >= 3)
-#   define GIT_FLEX_ARRAY /* empty */
-#  else
-#   define GIT_FLEX_ARRAY 0 /* older GNU extension */
-#  endif
+#	if (__GNUC__ >= 3)
+#	define GIT_FLEX_ARRAY /* empty */
+#	else
+#	define GIT_FLEX_ARRAY 0 /* older GNU extension */
+#	endif
 # endif
 
 /* Default to safer but a bit wasteful traditional style */
 # ifndef GIT_FLEX_ARRAY
-#  define GIT_FLEX_ARRAY 1
+#	define GIT_FLEX_ARRAY 1
 # endif
 #endif
 
@@ -37,9 +37,9 @@
 # define GIT_UNUSED(x)
 #else
 # ifdef __GNUC__
-#  define GIT_UNUSED(x) x __attribute__ ((__unused__))
+#	define GIT_UNUSED(x) x __attribute__ ((__unused__))
 # else
-#  define GIT_UNUSED(x) x
+#	define GIT_UNUSED(x) x
 # endif
 #endif
 
diff --git a/src/common.h b/src/common.h
index 2d0f3f4..ed04de2 100644
--- a/src/common.h
+++ b/src/common.h
@@ -32,7 +32,7 @@
 # include "win32/msvc-compat.h"
 # include "win32/mingw-compat.h"
 # ifdef GIT_THREADS
-#  include "win32/pthread.h"
+#	include "win32/pthread.h"
 #endif
 
 # define snprintf _snprintf
@@ -43,7 +43,7 @@ typedef SSIZE_T ssize_t;
 # include <unistd.h>
 
 # ifdef GIT_THREADS
-#  include <pthread.h>
+#	include <pthread.h>
 # endif
 #endif
 
diff --git a/src/config.c b/src/config.c
index 1974df9..975e353 100644
--- a/src/config.c
+++ b/src/config.c
@@ -151,7 +151,7 @@ int git_config_foreach(git_config *cfg, int (*fn)(const char *, const char *, vo
 
 int git_config_delete(git_config *cfg, const char *name)
 {
-	return  git_config_set_string(cfg, name, NULL);
+	return git_config_set_string(cfg, name, NULL);
 }
 
 /**************
diff --git a/src/config_file.c b/src/config_file.c
index 564f9a2..f7e6f61 100644
--- a/src/config_file.c
+++ b/src/config_file.c
@@ -748,7 +748,7 @@ static int skip_bom(diskfile_backend *cfg)
 	if (memcmp(cfg->reader.read_ptr, utf8_bom, sizeof(utf8_bom)) == 0)
 		cfg->reader.read_ptr += sizeof(utf8_bom);
 
-	/*  TODO: the reference implementation does pretty stupid
+	/* TODO: the reference implementation does pretty stupid
 		shit with the BoM
 	*/
 
@@ -1019,7 +1019,7 @@ static int config_write(diskfile_backend *cfg, cvar_t *var)
 
 			/* And then the write out rest of the file */
 			error = git_filebuf_write(&file, post_start,
-			            cfg->reader.buffer.len - (post_start - data_start));
+						cfg->reader.buffer.len - (post_start - data_start));
 
 			if (error < GIT_SUCCESS) {
 				git__rethrow(error, "Failed to write the rest of the file");
diff --git a/src/delta-apply.c b/src/delta-apply.c
index 70ddfd9..e1fb15b 100644
--- a/src/delta-apply.c
+++ b/src/delta-apply.c
@@ -11,7 +11,7 @@
 /*
  * This file was heavily cribbed from BinaryDelta.java in JGit, which
  * itself was heavily cribbed from <code>patch-delta.c</code> in the
- * GIT project.   The original delta patching code was written by
+ * GIT project.	The original delta patching code was written by
  * Nicolas Pitre <nico@cam.org>.
  */
 
@@ -70,15 +70,15 @@ int git__delta_apply(
 			 */
 			size_t off = 0, len = 0;
 
-			if (cmd & 0x01) off  = *delta++;
-			if (cmd & 0x02) off |= *delta++ <<  8;
+			if (cmd & 0x01) off = *delta++;
+			if (cmd & 0x02) off |= *delta++ << 8;
 			if (cmd & 0x04) off |= *delta++ << 16;
 			if (cmd & 0x08) off |= *delta++ << 24;
 
-			if (cmd & 0x10) len  = *delta++;
-			if (cmd & 0x20) len |= *delta++ <<  8;
+			if (cmd & 0x10) len = *delta++;
+			if (cmd & 0x20) len |= *delta++ << 8;
 			if (cmd & 0x40) len |= *delta++ << 16;
-			if (!len)       len  = 0x10000;
+			if (!len)		len = 0x10000;
 
 			if (base_len < off + len || res_sz < len)
 				goto fail;
@@ -93,7 +93,7 @@ int git__delta_apply(
 			if (delta_end - delta < cmd || res_sz < cmd)
 				goto fail;
 			memcpy(res_dp, delta, cmd);
-			delta  += cmd;
+			delta += cmd;
 			res_dp += cmd;
 			res_sz -= cmd;
 
diff --git a/src/dir.h b/src/dir.h
index 148062e..ed517da 100644
--- a/src/dir.h
+++ b/src/dir.h
@@ -16,7 +16,7 @@
 #ifdef GIT_WIN32
 
 struct git__dirent {
-	int  d_ino;
+	int d_ino;
 	char d_name[261];
 };
 
@@ -34,12 +34,12 @@ extern void git__rewinddir(git__DIR *);
 extern int git__closedir(git__DIR *);
 
 # ifndef GIT__WIN32_NO_WRAP_DIR
-#  define dirent git__dirent
-#  define DIR git__DIR
-#  define opendir   git__opendir
-#  define readdir   git__readdir
-#  define rewinddir git__rewinddir
-#  define closedir  git__closedir
+#	define dirent git__dirent
+#	define DIR git__DIR
+#	define opendir	git__opendir
+#	define readdir	git__readdir
+#	define rewinddir git__rewinddir
+#	define closedir git__closedir
 # endif
 
 #endif
diff --git a/src/errors.c b/src/errors.c
index 45091e3..60d7746 100644
--- a/src/errors.c
+++ b/src/errors.c
@@ -71,7 +71,7 @@ void git___rethrow(const char *msg, ...)
 	va_end(va);
 
 	old_error = strdup(g_last_error);
-	snprintf(g_last_error, sizeof(g_last_error), "%s \n    - %s", new_error, old_error);
+	snprintf(g_last_error, sizeof(g_last_error), "%s \n	- %s", new_error, old_error);
 	free(old_error);
 }
 
diff --git a/src/fileops.c b/src/fileops.c
index 8457339..bfd63f5 100644
--- a/src/fileops.c
+++ b/src/fileops.c
@@ -194,7 +194,7 @@ int git_futils_readbuffer_updated(git_fbuffer *obj, const char *path, time_t *mt
 		*updated = 1;
 
 	obj->data = buff;
-	obj->len  = len;
+	obj->len = len;
 
 	return GIT_SUCCESS;
 }
@@ -293,7 +293,7 @@ int git_futils_mkdir_r(const char *path, int mode)
 {
 	int error, root_path_offset;
 	char *pp, *sp;
-    char *path_copy = git__strdup(path);
+	char *path_copy = git__strdup(path);
 
 	if (path_copy == NULL)
 		return GIT_ENOMEM;
@@ -305,7 +305,7 @@ int git_futils_mkdir_r(const char *path, int mode)
 	if (root_path_offset > 0)
 		pp += root_path_offset; /* On Windows, will skip the drive name (eg. C: or D:) */
 
-    while (error == GIT_SUCCESS && (sp = strchr(pp, '/')) != NULL) {
+	while (error == GIT_SUCCESS && (sp = strchr(pp, '/')) != NULL) {
 		if (sp != pp && git_futils_isdir(path_copy) < GIT_SUCCESS) {
 			*sp = 0;
 			error = p_mkdir(path_copy, mode);
@@ -359,7 +359,7 @@ int git_futils_rmdir_r(const char *path, int force)
 {
 	char p[GIT_PATH_MAX];
 	strncpy(p, path, GIT_PATH_MAX);
-	return  _rmdir_recurs_foreach(&force, p);
+	return _rmdir_recurs_foreach(&force, p);
 }
 
 int git_futils_cmp_path(const char *name1, int len1, int isdir1,
@@ -373,10 +373,10 @@ int git_futils_cmp_path(const char *name1, int len1, int isdir1,
 		return cmp;
 	if (len1 < len2)
 		return ((!isdir1 && !isdir2) ? -1 :
-                        (isdir1 ? '/' - name2[len1] : name2[len1] - '/'));
+						(isdir1 ? '/' - name2[len1] : name2[len1] - '/'));
 	if (len1 > len2)
 		return ((!isdir1 && !isdir2) ? 1 :
-                        (isdir2 ? name1[len2] - '/' : '/' - name1[len2]));
+						(isdir2 ? name1[len2] - '/' : '/' - name1[len2]));
 	return 0;
 }
 
diff --git a/src/fileops.h b/src/fileops.h
index 92d2fb8..5b69199 100644
--- a/src/fileops.h
+++ b/src/fileops.h
@@ -20,9 +20,9 @@
  */
 #define GIT_FBUFFER_INIT {NULL, 0}
 
-typedef struct {  /* file io buffer  */
-	void *data;  /* data bytes   */
-	size_t len;  /* data length  */
+typedef struct { /* file io buffer */
+	void *data; /* data bytes	*/
+	size_t len; /* data length */
 } git_fbuffer;
 
 extern int git_futils_readbuffer(git_fbuffer *obj, const char *path);
@@ -139,8 +139,8 @@ extern void git_futils_mmap_free(git_map *map);
  * @param pathbuf buffer the function reads the initial directory
  * 		path from, and updates with each successive entry's name.
  * @param pathmax maximum allocation of pathbuf.
- * @param fn function to invoke with each entry.  The first arg is
- *		the input state and the second arg is pathbuf.  The function
+ * @param fn function to invoke with each entry. The first arg is
+ *		the input state and the second arg is pathbuf. The function
  *		may modify the pathbuf, but only by appending new text.
  * @param state to pass to fn as the first arg.
  */
diff --git a/src/index.c b/src/index.c
index fed4f2a..e6a1819 100644
--- a/src/index.c
+++ b/src/index.c
@@ -963,11 +963,11 @@ static int write_disk_entry(git_filebuf *file, git_index_entry *entry)
 	ondisk->mtime.seconds = htonl((uint32_t)entry->mtime.seconds);
 	ondisk->ctime.nanoseconds = htonl(entry->ctime.nanoseconds);
 	ondisk->mtime.nanoseconds = htonl(entry->mtime.nanoseconds);
-	ondisk->dev  = htonl(entry->dev);
-	ondisk->ino  = htonl(entry->ino);
+	ondisk->dev = htonl(entry->dev);
+	ondisk->ino = htonl(entry->ino);
 	ondisk->mode = htonl(entry->mode);
-	ondisk->uid  = htonl(entry->uid);
-	ondisk->gid  = htonl(entry->gid);
+	ondisk->uid = htonl(entry->uid);
+	ondisk->gid = htonl(entry->gid);
 	ondisk->file_size = htonl((uint32_t)entry->file_size);
 
 	git_oid_cpy(&ondisk->oid, &entry->oid);
diff --git a/src/map.h b/src/map.h
index a3ca1a1..6969de5 100644
--- a/src/map.h
+++ b/src/map.h
@@ -11,23 +11,23 @@
 
 
 /* p_mmap() prot values */
-#define GIT_PROT_NONE  0x0
-#define GIT_PROT_READ  0x1
+#define GIT_PROT_NONE 0x0
+#define GIT_PROT_READ 0x1
 #define GIT_PROT_WRITE 0x2
-#define GIT_PROT_EXEC  0x4
+#define GIT_PROT_EXEC 0x4
 
 /* git__mmmap() flags values */
-#define GIT_MAP_FILE    0
-#define GIT_MAP_SHARED  1
+#define GIT_MAP_FILE	0
+#define GIT_MAP_SHARED 1
 #define GIT_MAP_PRIVATE 2
-#define GIT_MAP_TYPE    0xf
-#define GIT_MAP_FIXED   0x10
+#define GIT_MAP_TYPE	0xf
+#define GIT_MAP_FIXED	0x10
 
-typedef struct {  /* memory mapped buffer   */
-	void *data;  /* data bytes          */
-	size_t len;  /* data length         */
+typedef struct { /* memory mapped buffer	*/
+	void *data; /* data bytes			*/
+	size_t len; /* data length			*/
 #ifdef GIT_WIN32
-	HANDLE fmh;  /* file mapping handle */
+	HANDLE fmh; /* file mapping handle */
 #endif
 } git_map;
 
diff --git a/src/mwindow.c b/src/mwindow.c
index cb35e48..76b80d7 100644
--- a/src/mwindow.c
+++ b/src/mwindow.c
@@ -13,7 +13,7 @@
 
 #define DEFAULT_WINDOW_SIZE \
 	(sizeof(void*) >= 8 \
-		?  1 * 1024 * 1024 * 1024 \
+		? 1 * 1024 * 1024 * 1024 \
 		: 32 * 1024 * 1024)
 
 #define DEFAULT_MAPPED_LIMIT \
@@ -165,7 +165,7 @@ static git_mwindow *new_window(git_mwindow_file *mwf, git_file fd, git_off_t siz
 	ctl.mapped += (size_t)len;
 
 	while(ctl.mapped_limit < ctl.mapped &&
-	      git_mwindow_close_lru(mwf) == GIT_SUCCESS) {}
+			git_mwindow_close_lru(mwf) == GIT_SUCCESS) {}
 
 	/* FIXME: Shouldn't we error out if there's an error in closing lru? */
 
@@ -193,7 +193,7 @@ cleanup:
  * enough space. Don't forget to add it to your list
  */
 unsigned char *git_mwindow_open(git_mwindow_file *mwf, git_mwindow **cursor,
-                                git_off_t offset, int extra, unsigned int *left)
+								git_off_t offset, int extra, unsigned int *left)
 {
 	git_mwindow *w = *cursor;
 
@@ -241,7 +241,7 @@ int git_mwindow_file_register(git_mwindow_file *mwf)
 	int error;
 
 	if (ctl.windowfiles.length == 0 &&
-	    (error = git_vector_init(&ctl.windowfiles, 8, NULL)) < GIT_SUCCESS)
+		(error = git_vector_init(&ctl.windowfiles, 8, NULL)) < GIT_SUCCESS)
 		return error;
 
 	return git_vector_insert(&ctl.windowfiles, mwf);
diff --git a/src/object.c b/src/object.c
index 4b6141b..edc2d80 100644
--- a/src/object.c
+++ b/src/object.c
@@ -19,8 +19,8 @@
 static const int OBJECT_BASE_SIZE = 4096;
 
 static struct {
-	const char	*str;   /* type name string */
-	int			loose;  /* valid loose object type flag */
+	const char	*str;	/* type name string */
+	int			loose; /* valid loose object type flag */
 	size_t		size;	/* size in bytes of the object structure */
 } git_objects_table[] = {
 	/* 0 = GIT_OBJ__EXT1 */
@@ -92,7 +92,7 @@ int git_object_lookup_prefix(git_object **object_out, git_repository *repo, cons
 	if (len > GIT_OID_HEXSZ)
 		len = GIT_OID_HEXSZ;
 
-	if (len == GIT_OID_HEXSZ)  {
+	if (len == GIT_OID_HEXSZ) {
 		/* We want to match the full id : we can first look up in the cache,
 		 * since there is no need to check for non ambiguousity
 		 */
@@ -126,10 +126,10 @@ int git_object_lookup_prefix(git_object **object_out, git_repository *repo, cons
 		/* If len < GIT_OID_HEXSZ (a strict short oid was given), we have
 		 * 2 options :
 		 * - We always search in the cache first. If we find that short oid is
-		 *   ambiguous, we can stop. But in all the other cases, we must then
-		 *   explore all the backends (to find an object if there was match,
-		 *   or to check that oid is not ambiguous if we have found 1 match in
-		 *   the cache)
+		 *	ambiguous, we can stop. But in all the other cases, we must then
+		 *	explore all the backends (to find an object if there was match,
+		 *	or to check that oid is not ambiguous if we have found 1 match in
+		 *	the cache)
 		 * - We never explore the cache, go right to exploring the backends
 		 * We chose the latter : we explore directly the backends.
 		 */
diff --git a/src/odb.c b/src/odb.c
index ed50dbc..02809be 100644
--- a/src/odb.c
+++ b/src/odb.c
@@ -57,9 +57,9 @@ int git_odb__hash_obj(git_oid *id, git_rawobj *obj)
 		return git__rethrow(hdrlen, "Failed to hash object");
 
 	vec[0].data = header;
-	vec[0].len  = hdrlen;
+	vec[0].len = hdrlen;
 	vec[1].data = obj->data;
-	vec[1].len  = obj->len;
+	vec[1].len = obj->len;
 
 	git_hash_vec(id, vec, 2);
 
diff --git a/src/odb.h b/src/odb.h
index 49c6359..4e85091 100644
--- a/src/odb.h
+++ b/src/odb.h
@@ -16,9 +16,9 @@
 
 /* DO NOT EXPORT */
 typedef struct {
-	void *data;          /**< Raw, decompressed object data. */
-	size_t len;          /**< Total number of bytes in data. */
-	git_otype type;      /**< Type of this object. */
+	void *data;			/**< Raw, decompressed object data. */
+	size_t len;			/**< Total number of bytes in data. */
+	git_otype type;		/**< Type of this object. */
 } git_rawobj;
 
 /* EXPORT */
diff --git a/src/odb_loose.c b/src/odb_loose.c
index 6ecd9a4..59703ce 100644
--- a/src/odb_loose.c
+++ b/src/odb_loose.c
@@ -18,9 +18,9 @@
 #include "git2/odb_backend.h"
 #include "git2/types.h"
 
-typedef struct {  /* object header data */
-	git_otype type;  /* object type */
-	size_t    size;  /* object size */
+typedef struct { /* object header data */
+	git_otype type; /* object type */
+	size_t	size; /* object size */
 } obj_hdr;
 
 typedef struct {
@@ -124,7 +124,7 @@ static size_t get_object_header(obj_hdr *hdr, unsigned char *data)
 	if (used == 0)
 		return 0;
 	hdr->type = git_object_string2type(typename);
-	used++;  /* consume the space */
+	used++; /* consume the space */
 
 	/*
 	 * length follows immediately in decimal (without
@@ -164,19 +164,19 @@ static size_t get_object_header(obj_hdr *hdr, unsigned char *data)
 static void init_stream(z_stream *s, void *out, size_t len)
 {
 	memset(s, 0, sizeof(*s));
-	s->next_out  = out;
+	s->next_out = out;
 	s->avail_out = (uInt)len;
 }
 
 static void set_stream_input(z_stream *s, void *in, size_t len)
 {
-	s->next_in  = in;
+	s->next_in = in;
 	s->avail_in = (uInt)len;
 }
 
 static void set_stream_output(z_stream *s, void *out, size_t len)
 {
-	s->next_out  = out;
+	s->next_out = out;
 	s->avail_out = (uInt)len;
 }
 
@@ -224,10 +224,10 @@ static int inflate_buffer(void *in, size_t inlen, void *out, size_t outlen)
 
 	memset(&zs, 0x0, sizeof(zs));
 
-	zs.next_out  = out;
+	zs.next_out = out;
 	zs.avail_out = (uInt)outlen;
 
-	zs.next_in  = in;
+	zs.next_in = in;
 	zs.avail_in = (uInt)inlen;
 
 	if (inflateInit(&zs) < Z_OK)
@@ -314,7 +314,7 @@ static int inflate_packlike_loose_disk_obj(git_rawobj *out, git_fbuffer *obj)
 	if (!buf)
 		return GIT_ENOMEM;
 
-	in  = ((unsigned char *)obj->data) + used;
+	in = ((unsigned char *)obj->data) + used;
 	len = obj->len - used;
 	if (inflate_buffer(in, len, buf, hdr.size)) {
 		free(buf);
@@ -323,7 +323,7 @@ static int inflate_packlike_loose_disk_obj(git_rawobj *out, git_fbuffer *obj)
 	buf[hdr.size] = '\0';
 
 	out->data = buf;
-	out->len  = hdr.size;
+	out->len = hdr.size;
 	out->type = hdr.type;
 
 	return GIT_SUCCESS;
@@ -364,7 +364,7 @@ static int inflate_disk_obj(git_rawobj *out, git_fbuffer *obj)
 	buf[hdr.size] = '\0';
 
 	out->data = buf;
-	out->len  = hdr.size;
+	out->len = hdr.size;
 	out->type = hdr.type;
 
 	return GIT_SUCCESS;
@@ -392,7 +392,7 @@ static int read_loose(git_rawobj *out, const char *loc)
 	assert(out && loc);
 
 	out->data = NULL;
-	out->len  = 0;
+	out->len = 0;
 	out->type = GIT_OBJ_BAD;
 
 	if (git_futils_readbuffer(&obj, loc) < 0)
@@ -443,7 +443,7 @@ static int read_header_loose(git_rawobj *out, const char *loc)
 		goto cleanup;
 	}
 
-	out->len  = header_obj.size;
+	out->len = header_obj.size;
 	out->type = header_obj.type;
 
 cleanup:
@@ -694,8 +694,8 @@ static int format_object_header(char *hdr, size_t n, size_t obj_len, git_otype o
 	const char *type_str = git_object_type2string(obj_type);
 	int len = snprintf(hdr, n, "%s %"PRIuZ, type_str, obj_len);
 
-	assert(len > 0);             /* otherwise snprintf() is broken  */
-	assert(((size_t) len) < n);  /* otherwise the caller is broken! */
+	assert(len > 0);				/* otherwise snprintf() is broken */
+	assert(((size_t) len) < n); /* otherwise the caller is broken! */
 
 	if (len < 0 || ((size_t) len) >= n)
 		return git__throw(GIT_ERROR, "Failed to format object header. Length is out of bounds");
@@ -708,7 +708,7 @@ int loose_backend__stream(git_odb_stream **stream_out, git_odb_backend *_backend
 	loose_writestream *stream;
 
 	char hdr[64], tmp_path[GIT_PATH_MAX];
-	int  hdrlen;
+	int hdrlen;
 	int error;
 
 	assert(_backend);
diff --git a/src/odb_pack.c b/src/odb_pack.c
index 4a171f9..1867ada 100644
--- a/src/odb_pack.c
+++ b/src/odb_pack.c
@@ -30,9 +30,9 @@ struct pack_backend {
 /**
  * The wonderful tale of a Packed Object lookup query
  * ===================================================
- *   A riveting and epic story of epicness and ASCII
- *          art, presented by yours truly,
- *               Sir Vicent of Marti
+ *	A riveting and epic story of epicness and ASCII
+ *			art, presented by yours truly,
+ *				Sir Vicent of Marti
  *
  *
  *	Chapter 1: Once upon a time...
@@ -43,32 +43,32 @@ struct pack_backend {
  *	| Creates the pack backend structure, initializes the
  *	| callback pointers to our default read() and exist() methods,
  *	| and tries to preload all the known packfiles in the ODB.
- *  |
+ * |
  *	|-# packfile_load_all
- *	  | Tries to find the `pack` folder, if it exists. ODBs without
- *	  | a pack folder are ignored altogether. If there's a `pack` folder
- *	  | we run a `dirent` callback through every file in the pack folder
- *	  | to find our packfiles. The packfiles are then sorted according
- *	  | to a sorting callback.
- * 	  |
- *	  |-# packfile_load__cb
- *	  | | This callback is called from `dirent` with every single file
- *	  | | inside the pack folder. We find the packs by actually locating
- *	  | | their index (ends in ".idx"). From that index, we verify that
- *	  | | the corresponding packfile exists and is valid, and if so, we
- *    | | add it to the pack list.
- *	  | |
- *	  | |-# packfile_check
- *	  |     Make sure that there's a packfile to back this index, and store
- *	  |     some very basic information regarding the packfile itself,
- *	  |     such as the full path, the size, and the modification time.
- *	  |     We don't actually open the packfile to check for internal consistency.
- *    |
- *    |-# packfile_sort__cb
- *        Sort all the preloaded packs according to some specific criteria:
- *        we prioritize the "newer" packs because it's more likely they
- *        contain the objects we are looking for, and we prioritize local
- *        packs over remote ones.
+ *	 | Tries to find the `pack` folder, if it exists. ODBs without
+ *	 | a pack folder are ignored altogether. If there's a `pack` folder
+ *	 | we run a `dirent` callback through every file in the pack folder
+ *	 | to find our packfiles. The packfiles are then sorted according
+ *	 | to a sorting callback.
+ * 	 |
+ *	 |-# packfile_load__cb
+ *	 | | This callback is called from `dirent` with every single file
+ *	 | | inside the pack folder. We find the packs by actually locating
+ *	 | | their index (ends in ".idx"). From that index, we verify that
+ *	 | | the corresponding packfile exists and is valid, and if so, we
+ *	| | add it to the pack list.
+ *	 | |
+ *	 | |-# packfile_check
+ *	 |		Make sure that there's a packfile to back this index, and store
+ *	 |		some very basic information regarding the packfile itself,
+ *	 |		such as the full path, the size, and the modification time.
+ *	 |		We don't actually open the packfile to check for internal consistency.
+ *	|
+ *	|-# packfile_sort__cb
+ *		Sort all the preloaded packs according to some specific criteria:
+ *		we prioritize the "newer" packs because it's more likely they
+ *		contain the objects we are looking for, and we prioritize local
+ *		packs over remote ones.
  *
  *
  *
@@ -76,41 +76,41 @@ struct pack_backend {
  *	A standard packed `exist` query for an OID
  *	--------------------------------------------------
  *
- *  # pack_backend__exists
- *  | Check if the given SHA1 oid exists in any of the packs
- *  | that have been loaded for our ODB.
- *  |
- *  |-# pack_entry_find
- *    | Iterate through all the packs that have been preloaded
- *    | (starting by the pack where the latest object was found)
- *    | to try to find the OID in one of them.
- *    |
- *    |-# pack_entry_find1
- *      | Check the index of an individual pack to see if the SHA1
- *      | OID can be found. If we can find the offset to that SHA1
- *      | inside of the index, that means the object is contained
- *      | inside of the packfile and we can stop searching.
- *      | Before returning, we verify that the packfile behing the
- *      | index we are searching still exists on disk.
- *      |
- *      |-# pack_entry_find_offset
- *      | | Mmap the actual index file to disk if it hasn't been opened
- *      | | yet, and run a binary search through it to find the OID.
- *      | | See <http://book.git-scm.com/7_the_packfile.html> for specifics
- *      | | on the Packfile Index format and how do we find entries in it.
- *      | |
- *      | |-# pack_index_open
- *      |   | Guess the name of the index based on the full path to the
- *      |   | packfile, open it and verify its contents. Only if the index
- *      |   | has not been opened already.
- *      |   |
- *      |   |-# pack_index_check
- *      |       Mmap the index file and do a quick run through the header
- *      |       to guess the index version (right now we support v1 and v2),
- *      |       and to verify that the size of the index makes sense.
- *      |
- *      |-# packfile_open
- *          See `packfile_open` in Chapter 3
+ * # pack_backend__exists
+ * | Check if the given SHA1 oid exists in any of the packs
+ * | that have been loaded for our ODB.
+ * |
+ * |-# pack_entry_find
+ *	| Iterate through all the packs that have been preloaded
+ *	| (starting by the pack where the latest object was found)
+ *	| to try to find the OID in one of them.
+ *	|
+ *	|-# pack_entry_find1
+ *		| Check the index of an individual pack to see if the SHA1
+ *		| OID can be found. If we can find the offset to that SHA1
+ *		| inside of the index, that means the object is contained
+ *		| inside of the packfile and we can stop searching.
+ *		| Before returning, we verify that the packfile behing the
+ *		| index we are searching still exists on disk.
+ *		|
+ *		|-# pack_entry_find_offset
+ *		| | Mmap the actual index file to disk if it hasn't been opened
+ *		| | yet, and run a binary search through it to find the OID.
+ *		| | See <http://book.git-scm.com/7_the_packfile.html> for specifics
+ *		| | on the Packfile Index format and how do we find entries in it.
+ *		| |
+ *		| |-# pack_index_open
+ *		|	| Guess the name of the index based on the full path to the
+ *		|	| packfile, open it and verify its contents. Only if the index
+ *		|	| has not been opened already.
+ *		|	|
+ *		|	|-# pack_index_check
+ *		|		Mmap the index file and do a quick run through the header
+ *		|		to guess the index version (right now we support v1 and v2),
+ *		|		and to verify that the size of the index makes sense.
+ *		|
+ *		|-# packfile_open
+ *			See `packfile_open` in Chapter 3
  *
  *
  *
@@ -170,7 +170,7 @@ GIT_INLINE(int) pack_window_contains(git_mwindow *win, off_t offset)
 	/* We must promise at least 20 bytes (one hash) after the
 	 * offset is available from this window, otherwise the offset
 	 * is not actually in this window and a different window (which
-	 * has that one hash excess) must be used.  This is to support
+	 * has that one hash excess) must be used. This is to support
 	 * the object header and delta base parsing routines below.
 	 */
 	return git_mwindow_contains(win, offset + 20);
@@ -184,7 +184,7 @@ static int packfile_sort__cb(const void *a_, const void *b_)
 
 	/*
 	 * Local packs tend to contain objects specific to our
-	 * variant of the project than remote ones.  In addition,
+	 * variant of the project than remote ones. In addition,
 	 * remote ones could be on a network mounted filesystem.
 	 * Favor local ones for these reasons.
 	 */
diff --git a/src/oid.c b/src/oid.c
index 794f5e2..e2d16d5 100644
--- a/src/oid.c
+++ b/src/oid.c
@@ -15,7 +15,7 @@ static signed char from_hex[] = {
 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 00 */
 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 10 */
 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 20 */
- 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, -1, -1, -1, -1, -1, -1, /* 30 */
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, -1, -1, -1, -1, -1, -1, /* 30 */
 -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 40 */
 -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 50 */
 -1, 10, 11, 12, 13, 14, 15, -1, -1, -1, -1, -1, -1, -1, -1, -1, /* 60 */
@@ -43,7 +43,7 @@ int git_oid_fromstrn(git_oid *out, const char *str, size_t length)
 
 	for (p = 0; p < length; p += 2) {
 		int v = (from_hex[(unsigned char)str[p + 0]] << 4)
-		       | from_hex[(unsigned char)str[p + 1]];
+				| from_hex[(unsigned char)str[p + 1]];
 
 		if (v < 0)
 			return git__throw(GIT_ENOTOID, "Failed to generate sha1. Given string is not a valid sha1 hash");
@@ -104,7 +104,7 @@ char *git_oid_to_string(char *out, size_t n, const git_oid *oid)
 	if (!out || n == 0 || !oid)
 		return "";
 
-	n--;  /* allow room for terminating NUL */
+	n--; /* allow room for terminating NUL */
 
 	if (n > 0) {
 		git_oid_fmt(str, oid);
diff --git a/src/pack.c b/src/pack.c
index 130ee49..8de2d78 100644
--- a/src/pack.c
+++ b/src/pack.c
@@ -52,7 +52,7 @@ static void pack_index_free(struct git_pack_file *p)
 	}
 }
 
-static int pack_index_check(const char *path,  struct git_pack_file *p)
+static int pack_index_check(const char *path, struct git_pack_file *p)
 {
 	struct git_pack_idx_header *hdr;
 	uint32_t version, nr, i, *index;
@@ -108,7 +108,7 @@ static int pack_index_check(const char *path,  struct git_pack_file *p)
 	index = idx_map;
 
 	if (version > 1)
-		index += 2;  /* skip index header */
+		index += 2; /* skip index header */
 
 	for (i = 0; i < 256; i++) {
 		uint32_t n = ntohl(index[i]);
@@ -122,10 +122,10 @@ static int pack_index_check(const char *path,  struct git_pack_file *p)
 	if (version == 1) {
 		/*
 		 * Total size:
-		 *  - 256 index entries 4 bytes each
-		 *  - 24-byte entries * nr (20-byte sha1 + 4-byte offset)
-		 *  - 20-byte SHA1 of the packfile
-		 *  - 20-byte SHA1 file checksum
+		 * - 256 index entries 4 bytes each
+		 * - 24-byte entries * nr (20-byte sha1 + 4-byte offset)
+		 * - 20-byte SHA1 of the packfile
+		 * - 20-byte SHA1 file checksum
 		 */
 		if (idx_size != 4*256 + nr * 24 + 20 + 20) {
 			git_futils_mmap_free(&p->index_map);
@@ -134,13 +134,13 @@ static int pack_index_check(const char *path,  struct git_pack_file *p)
 	} else if (version == 2) {
 		/*
 		 * Minimum size:
-		 *  - 8 bytes of header
-		 *  - 256 index entries 4 bytes each
-		 *  - 20-byte sha1 entry * nr
-		 *  - 4-byte crc entry * nr
-		 *  - 4-byte offset entry * nr
-		 *  - 20-byte SHA1 of the packfile
-		 *  - 20-byte SHA1 file checksum
+		 * - 8 bytes of header
+		 * - 256 index entries 4 bytes each
+		 * - 20-byte sha1 entry * nr
+		 * - 4-byte crc entry * nr
+		 * - 4-byte offset entry * nr
+		 * - 20-byte SHA1 of the packfile
+		 * - 20-byte SHA1 file checksum
 		 * And after the 4-byte offset table might be a
 		 * variable sized table containing 8-byte entries
 		 * for offsets larger than 2^31.
@@ -245,8 +245,8 @@ int git_packfile_unpack_header(
 	unsigned long used;
 
 	/* pack_window_open() assures us we have [base, base + 20) available
-	 * as a range that we can look at at.  (Its actually the hash
-	 * size that is assured.)  With our object header encoding
+	 * as a range that we can look at at. (Its actually the hash
+	 * size that is assured.) With our object header encoding
 	 * the maximum deflated object size is 2^137, which is just
 	 * insane, so we know won't exceed what we have been given.
 	 */
@@ -435,8 +435,8 @@ off_t get_delta_base(
 
 	/* pack_window_open() assured us we have [base_info, base_info + 20)
 	 * as a range that we can look at without walking off the
-	 * end of the mapped window.  Its actually the hash size
-	 * that is assured.  An OFS_DELTA longer than the hash size
+	 * end of the mapped window. Its actually the hash size
+	 * that is assured. An OFS_DELTA longer than the hash size
 	 * is stupid, as then a REF_DELTA would be smaller to store.
 	 */
 	if (type == GIT_OBJ_OFS_DELTA) {
@@ -446,13 +446,13 @@ off_t get_delta_base(
 		while (c & 128) {
 			base_offset += 1;
 			if (!base_offset || MSB(base_offset, 7))
-				return 0;  /* overflow */
+				return 0; /* overflow */
 			c = base_info[used++];
 			base_offset = (base_offset << 7) + (c & 127);
 		}
 		base_offset = delta_obj_offset - base_offset;
 		if (base_offset <= 0 || base_offset >= delta_obj_offset)
-			return 0;  /* out of bound */
+			return 0; /* out of bound */
 		*curpos += used;
 	} else if (type == GIT_OBJ_REF_DELTA) {
 		/* If we have the cooperative cache, search in it first */
@@ -650,7 +650,7 @@ static off_t nth_packed_object_offset(const struct git_pack_file *p, uint32_t n)
 			return off;
 		index += p->num_objects * 4 + (off & 0x7fffffff) * 8;
 		return (((uint64_t)ntohl(*((uint32_t *)(index + 0)))) << 32) |
-				   ntohl(*((uint32_t *)(index + 4)));
+					ntohl(*((uint32_t *)(index + 4)));
 	}
 }
 
@@ -703,7 +703,7 @@ static int pack_entry_find_offset(
 #endif
 
 	/* Use git.git lookup code */
-	pos =  sha1_entry_pos(index, stride, 0, lo, hi, p->num_objects, short_oid->id);
+	pos = sha1_entry_pos(index, stride, 0, lo, hi, p->num_objects, short_oid->id);
 
 	if (pos >= 0) {
 		/* An object matching exactly the oid was found */
diff --git a/src/pack.h b/src/pack.h
index ca35878..0fddd9d 100644
--- a/src/pack.h
+++ b/src/pack.h
@@ -38,7 +38,7 @@ struct git_pack_header {
  * Very old git binaries will also compare the first 4 bytes to the
  * next 4 bytes in the index and abort with a "non-monotonic index"
  * error if the second 4 byte word is smaller than the first 4
- * byte word.  This would be true in the proposed future index
+ * byte word. This would be true in the proposed future index
  * format as idx_signature would be greater than idx_version.
  */
 
diff --git a/src/path.c b/src/path.c
index ce4203f..2c6b76d 100644
--- a/src/path.c
+++ b/src/path.c
@@ -23,8 +23,8 @@ int git_path_basename_r(char *buffer, size_t bufflen, const char *path)
 
 	/* Empty or NULL string gets treated as "." */
 	if (path == NULL || *path == '\0') {
-		startp  = ".";
-		len     = 1;
+		startp = ".";
+		len		= 1;
 		goto Exit;
 	}
 
@@ -36,7 +36,7 @@ int git_path_basename_r(char *buffer, size_t bufflen, const char *path)
 	/* All slashes becomes "/" */
 	if (endp == path && *endp == '/') {
 		startp = "/";
-		len    = 1;
+		len	= 1;
 		goto Exit;
 	}
 
@@ -53,7 +53,7 @@ Exit:
 		return result;
 	}
 	if (len > (int)bufflen-1) {
-		len    = (int)bufflen-1;
+		len	= (int)bufflen-1;
 		result = GIT_ENOMEM;
 	}
 
@@ -70,103 +70,103 @@ Exit:
  */
 int git_path_dirname_r(char *buffer, size_t bufflen, const char *path)
 {
-    const char *endp;
-    int result, len;
-
-    /* Empty or NULL string gets treated as "." */
-    if (path == NULL || *path == '\0') {
-        path = ".";
-        len  = 1;
-        goto Exit;
-    }
-
-    /* Strip trailing slashes */
-    endp = path + strlen(path) - 1;
-    while (endp > path && *endp == '/')
-        endp--;
-
-    /* Find the start of the dir */
-    while (endp > path && *endp != '/')
-        endp--;
-
-    /* Either the dir is "/" or there are no slashes */
-    if (endp == path) {
-        path = (*endp == '/') ? "/" : ".";
-        len  = 1;
-        goto Exit;
-    }
-
-    do {
-        endp--;
-    } while (endp > path && *endp == '/');
-
-    len = endp - path +1;
+	const char *endp;
+	int result, len;
+
+	/* Empty or NULL string gets treated as "." */
+	if (path == NULL || *path == '\0') {
+		path = ".";
+		len = 1;
+		goto Exit;
+	}
+
+	/* Strip trailing slashes */
+	endp = path + strlen(path) - 1;
+	while (endp > path && *endp == '/')
+		endp--;
+
+	/* Find the start of the dir */
+	while (endp > path && *endp != '/')
+		endp--;
+
+	/* Either the dir is "/" or there are no slashes */
+	if (endp == path) {
+		path = (*endp == '/') ? "/" : ".";
+		len = 1;
+		goto Exit;
+	}
+
+	do {
+		endp--;
+	} while (endp > path && *endp == '/');
+
+	len = endp - path +1;
 
 #ifdef GIT_WIN32
-    /* Mimic unix behavior where '/.git' returns '/': 'C:/.git' will return
-       'C:/' here */
+	/* Mimic unix behavior where '/.git' returns '/': 'C:/.git' will return
+		'C:/' here */
 
-    if (len == 2 && isalpha(path[0]) && path[1] == ':') {
-      len = 3;
-      goto Exit;
-    }
+	if (len == 2 && isalpha(path[0]) && path[1] == ':') {
+		len = 3;
+		goto Exit;
+	}
 #endif
 
 Exit:
-    result = len;
-    if (len+1 > GIT_PATH_MAX) {
-        return GIT_ENOMEM;
-    }
-    if (buffer == NULL)
-        return result;
-
-    if (len > (int)bufflen-1) {
-        len    = (int)bufflen-1;
-        result = GIT_ENOMEM;
-    }
-
-    if (len >= 0) {
-        memmove(buffer, path, len);
-        buffer[len] = 0;
-    }
-    return result;
+	result = len;
+	if (len+1 > GIT_PATH_MAX) {
+		return GIT_ENOMEM;
+	}
+	if (buffer == NULL)
+		return result;
+
+	if (len > (int)bufflen-1) {
+		len	= (int)bufflen-1;
+		result = GIT_ENOMEM;
+	}
+
+	if (len >= 0) {
+		memmove(buffer, path, len);
+		buffer[len] = 0;
+	}
+	return result;
 }
 
 
 char *git_path_dirname(const char *path)
 {
-    char *dname = NULL;
-    int len;
+	char *dname = NULL;
+	int len;
 
 	len = (path ? strlen(path) : 0) + 2;
 	dname = (char *)git__malloc(len);
 	if (dname == NULL)
 		return NULL;
 
-    if (git_path_dirname_r(dname, len, path) < GIT_SUCCESS) {
+	if (git_path_dirname_r(dname, len, path) < GIT_SUCCESS) {
 		free(dname);
 		return NULL;
 	}
 
-    return dname;
+	return dname;
 }
 
 char *git_path_basename(const char *path)
 {
-    char *bname = NULL;
-    int len;
+	char *bname = NULL;
+	int len;
 
 	len = (path ? strlen(path) : 0) + 2;
 	bname = (char *)git__malloc(len);
 	if (bname == NULL)
 		return NULL;
 
-    if (git_path_basename_r(bname, len, path) < GIT_SUCCESS) {
+	if (git_path_basename_r(bname, len, path) < GIT_SUCCESS) {
 		free(bname);
 		return NULL;
 	}
 
-    return bname;
+	return bname;
 }
 
 
diff --git a/src/pkt.c b/src/pkt.c
index 97e9224..e0beb72 100644
--- a/src/pkt.c
+++ b/src/pkt.c
@@ -163,11 +163,11 @@ static ssize_t parse_len(const char *line)
 /*
  * As per the documentation, the syntax is:
  *
- * pkt-line    = data-pkt / flush-pkt
- * data-pkt    = pkt-len pkt-payload
- * pkt-len     = 4*(HEXDIG)
+ * pkt-line	= data-pkt / flush-pkt
+ * data-pkt	= pkt-len pkt-payload
+ * pkt-len		= 4*(HEXDIG)
  * pkt-payload = (pkt-len -4)*(OCTET)
- * flush-pkt   = "0000"
+ * flush-pkt	= "0000"
  *
  * Which means that the first four bytes are the length of the line,
  * in ASCII hexadecimal (including itself)
diff --git a/src/ppc/sha1.c b/src/ppc/sha1.c
index 947000f..a34bf25 100644
--- a/src/ppc/sha1.c
+++ b/src/ppc/sha1.c
@@ -9,7 +9,7 @@
 #include "sha1.h"
 
 extern void ppc_sha1_core(uint32_t *hash, const unsigned char *p,
-			  unsigned int nblocks);
+			 unsigned int nblocks);
 
 int ppc_SHA1_Init(ppc_SHA_CTX *c)
 {
diff --git a/src/pqueue.c b/src/pqueue.c
index a244ed7..b5ddab8 100644
--- a/src/pqueue.c
+++ b/src/pqueue.c
@@ -8,29 +8,29 @@
 #include "common.h"
 #include "pqueue.h"
 
-#define left(i)   ((i) << 1)
-#define right(i)  (((i) << 1) + 1)
+#define left(i)	((i) << 1)
+#define right(i) (((i) << 1) + 1)
 #define parent(i) ((i) >> 1)
 
 int git_pqueue_init(git_pqueue *q, size_t n, git_pqueue_cmp cmppri)
 {
 	assert(q);
 
-    /* Need to allocate n+1 elements since element 0 isn't used. */
-    if ((q->d = malloc((n + 1) * sizeof(void *))) == NULL)
+	/* Need to allocate n+1 elements since element 0 isn't used. */
+	if ((q->d = malloc((n + 1) * sizeof(void *))) == NULL)
 		return GIT_ENOMEM;
 
-    q->size = 1;
-    q->avail = q->step = (n + 1);  /* see comment above about n+1 */
-    q->cmppri = cmppri;
+	q->size = 1;
+	q->avail = q->step = (n + 1); /* see comment above about n+1 */
+	q->cmppri = cmppri;
 
-    return GIT_SUCCESS;
+	return GIT_SUCCESS;
 }
 
 
 void git_pqueue_free(git_pqueue *q)
 {
-    free(q->d);
+	free(q->d);
 	q->d = NULL;
 }
 
@@ -41,101 +41,101 @@ void git_pqueue_clear(git_pqueue *q)
 
 size_t git_pqueue_size(git_pqueue *q)
 {
-    /* queue element 0 exists but doesn't count since it isn't used. */
-    return (q->size - 1);
+	/* queue element 0 exists but doesn't count since it isn't used. */
+	return (q->size - 1);
 }
 
 
 static void bubble_up(git_pqueue *q, size_t i)
 {
-    size_t parent_node;
-    void *moving_node = q->d[i];
+	size_t parent_node;
+	void *moving_node = q->d[i];
 
-    for (parent_node = parent(i);
-         ((i > 1) && q->cmppri(q->d[parent_node], moving_node));
-         i = parent_node, parent_node = parent(i)) {
-        q->d[i] = q->d[parent_node];
-    }
+	for (parent_node = parent(i);
+			((i > 1) && q->cmppri(q->d[parent_node], moving_node));
+			i = parent_node, parent_node = parent(i)) {
+		q->d[i] = q->d[parent_node];
+	}
 
-    q->d[i] = moving_node;
+	q->d[i] = moving_node;
 }
 
 
 static size_t maxchild(git_pqueue *q, size_t i)
 {
-    size_t child_node = left(i);
+	size_t child_node = left(i);
 
-    if (child_node >= q->size)
-        return 0;
+	if (child_node >= q->size)
+		return 0;
 
-    if ((child_node + 1) < q->size &&
-        q->cmppri(q->d[child_node], q->d[child_node + 1]))
-        child_node++; /* use right child instead of left */
+	if ((child_node + 1) < q->size &&
+		q->cmppri(q->d[child_node], q->d[child_node + 1]))
+		child_node++; /* use right child instead of left */
 
-    return child_node;
+	return child_node;
 }
 
 
 static void percolate_down(git_pqueue *q, size_t i)
 {
-    size_t child_node;
-    void *moving_node = q->d[i];
+	size_t child_node;
+	void *moving_node = q->d[i];
 
-    while ((child_node = maxchild(q, i)) != 0 &&
-           q->cmppri(moving_node, q->d[child_node])) {
-        q->d[i] = q->d[child_node];
-        i = child_node;
-    }
+	while ((child_node = maxchild(q, i)) != 0 &&
+			q->cmppri(moving_node, q->d[child_node])) {
+		q->d[i] = q->d[child_node];
+		i = child_node;
+	}
 
-    q->d[i] = moving_node;
+	q->d[i] = moving_node;
 }
 
 
 int git_pqueue_insert(git_pqueue *q, void *d)
 {
-    void *tmp;
-    size_t i;
-    size_t newsize;
+	void *tmp;
+	size_t i;
+	size_t newsize;
 
-    if (!q) return 1;
+	if (!q) return 1;
 
-    /* allocate more memory if necessary */
-    if (q->size >= q->avail) {
-        newsize = q->size + q->step;
-        if ((tmp = realloc(q->d, sizeof(void *) * newsize)) == NULL)
-            return GIT_ENOMEM;
+	/* allocate more memory if necessary */
+	if (q->size >= q->avail) {
+		newsize = q->size + q->step;
+		if ((tmp = realloc(q->d, sizeof(void *) * newsize)) == NULL)
+			return GIT_ENOMEM;
 
-        q->d = tmp;
-        q->avail = newsize;
-    }
+		q->d = tmp;
+		q->avail = newsize;
+	}
 
-    /* insert item */
-    i = q->size++;
-    q->d[i] = d;
-    bubble_up(q, i);
+	/* insert item */
+	i = q->size++;
+	q->d[i] = d;
+	bubble_up(q, i);
 
-    return GIT_SUCCESS;
+	return GIT_SUCCESS;
 }
 
 
 void *git_pqueue_pop(git_pqueue *q)
 {
-    void *head;
+	void *head;
 
-    if (!q || q->size == 1)
-        return NULL;
+	if (!q || q->size == 1)
+		return NULL;
 
-    head = q->d[1];
-    q->d[1] = q->d[--q->size];
-    percolate_down(q, 1);
+	head = q->d[1];
+	q->d[1] = q->d[--q->size];
+	percolate_down(q, 1);
 
-    return head;
+	return head;
 }
 
 
 void *git_pqueue_peek(git_pqueue *q)
 {
-    if (!q || q->size == 1)
-        return NULL;
-    return q->d[1];
+	if (!q || q->size == 1)
+		return NULL;
+	return q->d[1];
 }
diff --git a/src/pqueue.h b/src/pqueue.h
index e9ac4b7..6826055 100644
--- a/src/pqueue.h
+++ b/src/pqueue.h
@@ -13,9 +13,9 @@ typedef int (*git_pqueue_cmp)(void *a, void *b);
 
 /** the priority queue handle */
 typedef struct {
-    size_t size, avail, step;
-    git_pqueue_cmp cmppri;
-    void **d;
+	size_t size, avail, step;
+	git_pqueue_cmp cmppri;
+	void **d;
 } git_pqueue;
 
 
@@ -23,7 +23,7 @@ typedef struct {
  * initialize the queue
  *
  * @param n the initial estimate of the number of queue items for which memory
- *          should be preallocated
+ *			should be preallocated
  * @param cmppri the callback function to compare two nodes of the queue
  *
  * @Return the handle or NULL for insufficent memory
diff --git a/src/reflog.c b/src/reflog.c
index e4ced35..594963c 100644
--- a/src/reflog.c
+++ b/src/reflog.c
@@ -205,7 +205,7 @@ int git_reflog_read(git_reflog **reflog, git_reference *ref)
 }
 
 int git_reflog_write(git_reference *ref, const git_oid *oid_old,
-		     const git_signature *committer, const char *msg)
+				const git_signature *committer, const char *msg)
 {
 	int error;
 	char old[GIT_OID_HEXSZ+1];
diff --git a/src/refs.c b/src/refs.c
index 868fe21..7cfbe55 100644
--- a/src/refs.c
+++ b/src/refs.c
@@ -494,7 +494,7 @@ static int packed_load(git_repository *repo)
 	}
 
 	error = reference_read(&packfile, &ref_cache->packfile_time,
-						   repo->path_repository, GIT_PACKEDREFS_FILE, &updated);
+							repo->path_repository, GIT_PACKEDREFS_FILE, &updated);
 
 	/*
 	 * If we couldn't find the file, we need to clear the table and
@@ -827,7 +827,7 @@ static int packed_write(git_repository *repo)
 		const void *GIT_UNUSED(_unused);
 
 		GIT_HASHTABLE_FOREACH(repo->references.packfile, _unused, reference,
-			git_vector_insert(&packing_list, reference);  /* cannot fail: vector already has the right size */
+			git_vector_insert(&packing_list, reference); /* cannot fail: vector already has the right size */
 		);
 	}
 
@@ -905,7 +905,7 @@ static int _reference_available_cb(const char *ref, void *data)
 		const char *lead = reflen < newlen ? new : ref;
 
 		if (!strncmp(new, ref, cmplen) &&
-		    lead[cmplen] == '/')
+			lead[cmplen] == '/')
 			return GIT_EEXISTS;
 	}
 
@@ -1054,7 +1054,7 @@ int git_reference_create_symbolic(git_reference **ref_out, git_repository *repo,
 	 * need a new reference because we can't make a symbolic ref out
 	 * of an oid one.
 	 * If if didn't exist, then we need to create a new one anyway.
-     */
+		*/
 	if (ref && ref->type & GIT_REF_SYMBOLIC){
 		updated = 1;
 	} else {
@@ -1113,7 +1113,7 @@ int git_reference_create_oid(git_reference **ref_out, git_repository *repo, cons
 	 * need a new reference because we can't make a symbolic ref out
 	 * of an oid one.
 	 * If if didn't exist, then we need to create a new one anyway.
-     */
+		*/
 	if (ref && ref-> type & GIT_REF_OID){
 		updated = 1;
 	} else {
@@ -1344,10 +1344,10 @@ int git_reference_rename(git_reference *ref, const char *new_name, int force)
 	 * writes reflogs by default in any repo with a working directory:
 	 *
 	 * "We only enable reflogs in repositories that have a working directory
-	 *  associated with them, as shared/bare repositories do not have
-	 *  an easy means to prune away old log entries, or may fail logging
-	 *  entirely if the user's gecos information is not valid during a push.
-	 *  This heuristic was suggested on the mailing list by Junio."
+	 * associated with them, as shared/bare repositories do not have
+	 * an easy means to prune away old log entries, or may fail logging
+	 * entirely if the user's gecos information is not valid during a push.
+	 * This heuristic was suggested on the mailing list by Junio."
 	 *
 	 * 	Shawn O. Pearce - 0bee59186976b1d9e6b2dd77332480c9480131d5
 	 *
diff --git a/src/refspec.c b/src/refspec.c
index b79733a..9de2730 100644
--- a/src/refspec.c
+++ b/src/refspec.c
@@ -55,7 +55,7 @@ int git_refspec_src_match(const git_refspec *refspec, const char *refname)
 	return git__fnmatch(refspec->src, refname, 0);
 }
 
-int git_refspec_transform(char *out, size_t outlen, const git_refspec *spec,  const char *name)
+int git_refspec_transform(char *out, size_t outlen, const git_refspec *spec, const char *name)
 {
 	size_t baselen, namelen;
 
diff --git a/src/remote.c b/src/remote.c
index 027894d..74a238d 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -110,7 +110,7 @@ int git_remote_get(git_remote **out, git_config *cfg, const char *name)
 
 	error = git_config_get_string(cfg, buf, &val);
 	if (error < GIT_SUCCESS) {
-		error = git__rethrow(error,  "Remote's url doesn't exist");
+		error = git__rethrow(error, "Remote's url doesn't exist");
 		goto cleanup;
 	}
 
diff --git a/src/sha1.c b/src/sha1.c
index 2d7d10a..4043fb1 100644
--- a/src/sha1.c
+++ b/src/sha1.c
@@ -52,11 +52,11 @@
  */
 
 #if defined(__i386__) || defined(__x86_64__)
-  #define setW(x, val) (*(volatile unsigned int *)&W(x) = (val))
+ #define setW(x, val) (*(volatile unsigned int *)&W(x) = (val))
 #elif defined(__GNUC__) && defined(__arm__)
-  #define setW(x, val) do { W(x) = (val); __asm__("":::"memory"); } while (0)
+ #define setW(x, val) do { W(x) = (val); __asm__("":::"memory"); } while (0)
 #else
-  #define setW(x, val) (W(x) = (val))
+ #define setW(x, val) (W(x) = (val))
 #endif
 
 /*
@@ -67,10 +67,10 @@
  */
 
 #if defined(__i386__) || defined(__x86_64__) || \
-    defined(_M_IX86) || defined(_M_X64) || \
-    defined(__ppc__) || defined(__ppc64__) || \
-    defined(__powerpc__) || defined(__powerpc64__) || \
-    defined(__s390__) || defined(__s390x__)
+	defined(_M_IX86) || defined(_M_X64) || \
+	defined(__ppc__) || defined(__ppc64__) || \
+	defined(__powerpc__) || defined(__powerpc64__) || \
+	defined(__s390__) || defined(__s390x__)
 
 #define get_be32(p)	ntohl(*(const unsigned int *)(p))
 #define put_be32(p, v)	do { *(unsigned int *)(p) = htonl(v); } while (0)
@@ -80,14 +80,14 @@
 #define get_be32(p)	( \
 	(*((const unsigned char *)(p) + 0) << 24) | \
 	(*((const unsigned char *)(p) + 1) << 16) | \
-	(*((const unsigned char *)(p) + 2) <<  8) | \
-	(*((const unsigned char *)(p) + 3) <<  0) )
+	(*((const unsigned char *)(p) + 2) << 8) | \
+	(*((const unsigned char *)(p) + 3) << 0) )
 #define put_be32(p, v)	do { \
 	unsigned int __v = (v); \
 	*((unsigned char *)(p) + 0) = __v >> 24; \
 	*((unsigned char *)(p) + 1) = __v >> 16; \
-	*((unsigned char *)(p) + 2) = __v >>  8; \
-	*((unsigned char *)(p) + 3) = __v >>  0; } while (0)
+	*((unsigned char *)(p) + 2) = __v >> 8; \
+	*((unsigned char *)(p) + 3) = __v >> 0; } while (0)
 
 #endif
 
@@ -106,11 +106,11 @@
 	E += TEMP + SHA_ROL(A,5) + (fn) + (constant); \
 	B = SHA_ROR(B, 2); } while (0)
 
-#define T_0_15(t, A, B, C, D, E)  SHA_ROUND(t, SHA_SRC, (((C^D)&B)^D) , 0x5a827999, A, B, C, D, E )
+#define T_0_15(t, A, B, C, D, E) SHA_ROUND(t, SHA_SRC, (((C^D)&B)^D) , 0x5a827999, A, B, C, D, E )
 #define T_16_19(t, A, B, C, D, E) SHA_ROUND(t, SHA_MIX, (((C^D)&B)^D) , 0x5a827999, A, B, C, D, E )
 #define T_20_39(t, A, B, C, D, E) SHA_ROUND(t, SHA_MIX, (B^C^D) , 0x6ed9eba1, A, B, C, D, E )
 #define T_40_59(t, A, B, C, D, E) SHA_ROUND(t, SHA_MIX, ((B&C)+(D&(B^C))) , 0x8f1bbcdc, A, B, C, D, E )
-#define T_60_79(t, A, B, C, D, E) SHA_ROUND(t, SHA_MIX, (B^C^D) ,  0xca62c1d6, A, B, C, D, E )
+#define T_60_79(t, A, B, C, D, E) SHA_ROUND(t, SHA_MIX, (B^C^D) , 0xca62c1d6, A, B, C, D, E )
 
 static void blk_SHA1_Block(blk_SHA_CTX *ctx, const unsigned int *data)
 {
diff --git a/src/sha1_lookup.c b/src/sha1_lookup.c
index f63f785..3051568 100644
--- a/src/sha1_lookup.c
+++ b/src/sha1_lookup.c
@@ -14,69 +14,69 @@
  * Conventional binary search loop looks like this:
  *
  *	unsigned lo, hi;
- *      do {
- *              unsigned mi = (lo + hi) / 2;
- *              int cmp = "entry pointed at by mi" minus "target";
- *              if (!cmp)
- *                      return (mi is the wanted one)
- *              if (cmp > 0)
- *                      hi = mi; "mi is larger than target"
- *              else
- *                      lo = mi+1; "mi is smaller than target"
- *      } while (lo < hi);
+ *		do {
+ *				unsigned mi = (lo + hi) / 2;
+ *				int cmp = "entry pointed at by mi" minus "target";
+ *				if (!cmp)
+ *						return (mi is the wanted one)
+ *				if (cmp > 0)
+ *						hi = mi; "mi is larger than target"
+ *				else
+ *						lo = mi+1; "mi is smaller than target"
+ *		} while (lo < hi);
  *
  * The invariants are:
  *
  * - When entering the loop, lo points at a slot that is never
- *   above the target (it could be at the target), hi points at a
- *   slot that is guaranteed to be above the target (it can never
- *   be at the target).
+ *	above the target (it could be at the target), hi points at a
+ *	slot that is guaranteed to be above the target (it can never
+ *	be at the target).
  *
  * - We find a point 'mi' between lo and hi (mi could be the same
- *   as lo, but never can be as same as hi), and check if it hits
- *   the target.  There are three cases:
+ *	as lo, but never can be as same as hi), and check if it hits
+ *	the target. There are three cases:
  *
- *    - if it is a hit, we are happy.
+ *	- if it is a hit, we are happy.
  *
- *    - if it is strictly higher than the target, we set it to hi,
- *      and repeat the search.
+ *	- if it is strictly higher than the target, we set it to hi,
+ *		and repeat the search.
  *
- *    - if it is strictly lower than the target, we update lo to
- *      one slot after it, because we allow lo to be at the target.
+ *	- if it is strictly lower than the target, we update lo to
+ *		one slot after it, because we allow lo to be at the target.
  *
- *   If the loop exits, there is no matching entry.
+ *	If the loop exits, there is no matching entry.
  *
  * When choosing 'mi', we do not have to take the "middle" but
  * anywhere in between lo and hi, as long as lo <= mi < hi is
- * satisfied.  When we somehow know that the distance between the
+ * satisfied. When we somehow know that the distance between the
  * target and lo is much shorter than the target and hi, we could
  * pick mi that is much closer to lo than the midway.
  *
  * Now, we can take advantage of the fact that SHA-1 is a good hash
  * function, and as long as there are enough entries in the table, we
- * can expect uniform distribution.  An entry that begins with for
+ * can expect uniform distribution. An entry that begins with for
  * example "deadbeef..." is much likely to appear much later than in
- * the midway of the table.  It can reasonably be expected to be near
+ * the midway of the table. It can reasonably be expected to be near
  * 87% (222/256) from the top of the table.
  *
- * However, we do not want to pick "mi" too precisely.  If the entry at
+ * However, we do not want to pick "mi" too precisely. If the entry at
  * the 87% in the above example turns out to be higher than the target
  * we are looking for, we would end up narrowing the search space down
  * only by 13%, instead of 50% we would get if we did a simple binary
- * search.  So we would want to hedge our bets by being less aggressive.
+ * search. So we would want to hedge our bets by being less aggressive.
  *
  * The table at "table" holds at least "nr" entries of "elem_size"
- * bytes each.  Each entry has the SHA-1 key at "key_offset".  The
- * table is sorted by the SHA-1 key of the entries.  The caller wants
+ * bytes each. Each entry has the SHA-1 key at "key_offset". The
+ * table is sorted by the SHA-1 key of the entries. The caller wants
  * to find the entry with "key", and knows that the entry at "lo" is
  * not higher than the entry it is looking for, and that the entry at
  * "hi" is higher than the entry it is looking for.
  */
 int sha1_entry_pos(const void *table,
-		   size_t elem_size,
-		   size_t key_offset,
-		   unsigned lo, unsigned hi, unsigned nr,
-		   const unsigned char *key)
+			size_t elem_size,
+			size_t key_offset,
+			unsigned lo, unsigned hi, unsigned nr,
+			const unsigned char *key)
 {
 	const unsigned char *base = (const unsigned char*)table;
 	const unsigned char *hi_key, *lo_key;
@@ -138,7 +138,7 @@ int sha1_entry_pos(const void *table,
 		 * end up narrowing the search space by a smaller
 		 * amount (i.e. the distance between 'mi' and 'hi')
 		 * than what we would have (i.e. about half of 'lo'
-		 * and 'hi').  Hedge our bets to pick 'mi' less
+		 * and 'hi'). Hedge our bets to pick 'mi' less
 		 * aggressively, i.e. make 'mi' a bit closer to the
 		 * middle than we would otherwise pick.
 		 */
@@ -154,7 +154,7 @@ int sha1_entry_pos(const void *table,
 #ifdef INDEX_DEBUG_LOOKUP
 		printf("lo %u hi %u rg %u mi %u ", lo, hi, range, mi);
 		printf("ofs %u lov %x, hiv %x, kyv %x\n",
-		       ofs_0, lov, hiv, kyv);
+				ofs_0, lov, hiv, kyv);
 #endif
 
 		if (!(lo <= mi && mi < hi)) {
diff --git a/src/sha1_lookup.h b/src/sha1_lookup.h
index bf167b3..52282e6 100644
--- a/src/sha1_lookup.h
+++ b/src/sha1_lookup.h
@@ -10,9 +10,9 @@
 #include <stdlib.h>
 
 int sha1_entry_pos(const void *table,
-		   size_t elem_size,
-		   size_t key_offset,
-		   unsigned lo, unsigned hi, unsigned nr,
-		   const unsigned char *key);
+			size_t elem_size,
+			size_t key_offset,
+			unsigned lo, unsigned hi, unsigned nr,
+			const unsigned char *key);
 
 #endif
diff --git a/src/tag.c b/src/tag.c
index 7afc22d..fc9f8b5 100644
--- a/src/tag.c
+++ b/src/tag.c
@@ -227,7 +227,7 @@ static int git_tag_create__internal(
 	}
 
 	/** Ensure the tag name doesn't conflict with an already existing
-	 *   reference unless overwriting has explictly been requested **/
+	 *	reference unless overwriting has explictly been requested **/
 	if (new_ref != NULL) {
 		if (!allow_ref_overwrite) {
 			git_oid_cpy(oid, git_reference_oid(new_ref));
@@ -312,7 +312,7 @@ int git_tag_create_frombuffer(git_oid *oid, git_repository *repo, const char *bu
 	}
 
 	/** Ensure the tag name doesn't conflict with an already existing
-	 *   reference unless overwriting has explictly been requested **/
+	 *	reference unless overwriting has explictly been requested **/
 	if (new_ref != NULL) {
 		if (!allow_ref_overwrite) {
 			git_oid_cpy(oid, git_reference_oid(new_ref));
@@ -366,8 +366,8 @@ int git_tag__parse(git_tag *tag, git_odb_object *obj)
 }
 
 typedef struct {
-  git_vector *taglist;
-  const char *pattern;
+ git_vector *taglist;
+ const char *pattern;
 } tag_filter_data;
 
 #define GIT_REFS_TAGS_DIR_LEN strlen(GIT_REFS_TAGS_DIR)
diff --git a/src/thread-utils.c b/src/thread-utils.c
index ff7a795..f582f43 100644
--- a/src/thread-utils.c
+++ b/src/thread-utils.c
@@ -8,10 +8,10 @@
 #include "thread-utils.h"
 
 #ifdef _WIN32
-#  define WIN32_LEAN_AND_MEAN
-#  include <windows.h>
+#	define WIN32_LEAN_AND_MEAN
+#	include <windows.h>
 #elif defined(hpux) || defined(__hpux) || defined(_hpux)
-#  include <sys/pstat.h>
+#	include <sys/pstat.h>
 #endif
 
 /*
@@ -20,11 +20,11 @@
  * with this disgusting nest of #ifdefs.
  */
 #ifndef _SC_NPROCESSORS_ONLN
-#  ifdef _SC_NPROC_ONLN
-#    define _SC_NPROCESSORS_ONLN _SC_NPROC_ONLN
-#  elif defined _SC_CRAY_NCPU
-#    define _SC_NPROCESSORS_ONLN _SC_CRAY_NCPU
-#  endif
+#	ifdef _SC_NPROC_ONLN
+#		define _SC_NPROCESSORS_ONLN _SC_NPROC_ONLN
+#	elif defined _SC_CRAY_NCPU
+#		define _SC_NPROCESSORS_ONLN _SC_CRAY_NCPU
+#	endif
 #endif
 
 int git_online_cpus(void)
diff --git a/src/thread-utils.h b/src/thread-utils.h
index f331de9..3361ed8 100644
--- a/src/thread-utils.h
+++ b/src/thread-utils.h
@@ -33,10 +33,10 @@ GIT_INLINE(void) git_atomic_set(git_atomic *a, int val)
 
 /* Pthreads Mutex */
 #define git_mutex pthread_mutex_t
-#define git_mutex_init(a)   pthread_mutex_init(a, NULL)
-#define git_mutex_lock(a)   pthread_mutex_lock(a)
+#define git_mutex_init(a)	pthread_mutex_init(a, NULL)
+#define git_mutex_lock(a)	pthread_mutex_lock(a)
 #define git_mutex_unlock(a) pthread_mutex_unlock(a)
-#define git_mutex_free(a)   pthread_mutex_destroy(a)
+#define git_mutex_free(a)	pthread_mutex_destroy(a)
 
 /* Pthreads condition vars -- disabled by now */
 #define git_cond unsigned int //pthread_cond_t
diff --git a/src/transport.h b/src/transport.h
index ff0bb00..233cfb1 100644
--- a/src/transport.h
+++ b/src/transport.h
@@ -15,7 +15,7 @@
 
 typedef struct git_transport_caps {
 	int common:1,
-	    ofs_delta:1;
+		ofs_delta:1;
 } git_transport_caps;
 
 /*
diff --git a/src/transport_git.c b/src/transport_git.c
index 2d54b42..ac268cd 100644
--- a/src/transport_git.c
+++ b/src/transport_git.c
@@ -387,8 +387,8 @@ static int git_negotiate_fetch(git_transport *transport, git_repository *repo, g
 
 				error = gitno_recv(&buf);
 				if (error < GIT_SUCCESS) {
-				  error = git__rethrow(error, "Error receiving data");
-				  goto cleanup;
+				 error = git__rethrow(error, "Error receiving data");
+				 goto cleanup;
 				}
 				error = git_pkt_parse_line(&pkt, ptr, &line_end, buf.offset);
 				if (error == GIT_ESHORTBUFFER)
@@ -535,7 +535,7 @@ static int git_close(git_transport *transport)
 	int s = t->socket;
 	int error;
 
-	/* Can't do anything if there's an error, so don't bother checking  */
+	/* Can't do anything if there's an error, so don't bother checking */
 	git_pkt_send_flush(s);
 	error = close(s);
 	if (error < 0)
diff --git a/src/tsort.c b/src/tsort.c
index 6a51702..5dd99cc 100644
--- a/src/tsort.c
+++ b/src/tsort.c
@@ -68,7 +68,7 @@ static int binsearch(void **dst, const void *x, size_t size, cmp_ptr_t cmp)
 	}
 }
 
-/* Binary insertion sort, but knowing that the first "start" entries are sorted.  Used in timsort. */
+/* Binary insertion sort, but knowing that the first "start" entries are sorted. Used in timsort. */
 static void bisort(void **dst, size_t start, size_t size, cmp_ptr_t cmp)
 {
 	size_t i;
@@ -207,7 +207,7 @@ static void merge(void **dst, const struct tsort_run *stack, int stack_curr, str
 	if (resize(store, MIN(A, B)) < 0)
 		return;
 
-	storage =  store->storage;
+	storage = store->storage;
 
 	/* left merge */
 	if (A < B) {
diff --git a/src/util.c b/src/util.c
index a178a5a..b46a2a1 100644
--- a/src/util.c
+++ b/src/util.c
@@ -214,7 +214,7 @@ void git__hexdump(const char *buffer, size_t len)
 			printf("%02X ", (unsigned char)*line & 0xFF);
 
 		for (j = 0; j < (LINE_WIDTH - last_line); ++j)
-			printf("   ");
+			printf("	");
 
 		printf("| ");
 
@@ -255,7 +255,7 @@ uint32_t git__hash(const void *key, int len, unsigned int seed)
 	case 3: h ^= data[2] << 16;
 	case 2: h ^= data[1] << 8;
 	case 1: h ^= data[0];
-	        h *= m;
+			h *= m;
 	};
 
 	h ^= h >> 13;
@@ -276,13 +276,13 @@ uint32_t git__hash(const void *key, int len, uint32_t seed)
 {
 
 #define MURMUR_BLOCK() {\
-    k1 *= c1; \
-    k1  = git__rotl(k1,11);\
-    k1 *= c2;\
-    h1 ^= k1;\
-    h1 = h1*3 + 0x52dce729;\
-    c1 = c1*5 + 0x7b7d159c;\
-    c2 = c2*5 + 0x6bce6396;\
+	k1 *= c1; \
+	k1 = git__rotl(k1,11);\
+	k1 *= c2;\
+	h1 ^= k1;\
+	h1 = h1*3 + 0x52dce729;\
+	c1 = c1*5 + 0x7b7d159c;\
+	c2 = c2*5 + 0x6bce6396;\
 }
 
 	const uint8_t *data = (const uint8_t*)key;
@@ -332,20 +332,20 @@ uint32_t git__hash(const void *key, int len, uint32_t seed)
  */
 void **git__bsearch(const void *key, void **base, size_t nmemb, int (*compar)(const void *, const void *))
 {
-        int lim, cmp;
-        void **p;
-
-        for (lim = nmemb; lim != 0; lim >>= 1) {
-                p = base + (lim >> 1);
-                cmp = (*compar)(key, *p);
-                if (cmp > 0) {  /* key > p: move right */
-                        base = p + 1;
-                        lim--;
-                } else if (cmp == 0) {
-                        return (void **)p;
-                } /* else move left */
-        }
-        return NULL;
+		int lim, cmp;
+		void **p;
+
+		for (lim = nmemb; lim != 0; lim >>= 1) {
+				p = base + (lim >> 1);
+				cmp = (*compar)(key, *p);
+				if (cmp > 0) { /* key > p: move right */
+						base = p + 1;
+						lim--;
+				} else if (cmp == 0) {
+						return (void **)p;
+				} /* else move left */
+		}
+		return NULL;
 }
 
 /**
diff --git a/src/util.h b/src/util.h
index cd63abc..f24afb3 100644
--- a/src/util.h
+++ b/src/util.h
@@ -8,7 +8,7 @@
 #define INCLUDE_util_h__
 
 #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
-#define bitsizeof(x)  (CHAR_BIT * sizeof(x))
+#define bitsizeof(x) (CHAR_BIT * sizeof(x))
 #define MSB(x, bits) ((x) & (~0ULL << (bitsizeof(x) - (bits))))
 #ifndef min
 # define min(a,b) ((a) < (b) ? (a) : (b))
diff --git a/src/win32/fnmatch.c b/src/win32/fnmatch.c
index cdce057..7d7c77d 100644
--- a/src/win32/fnmatch.c
+++ b/src/win32/fnmatch.c
@@ -16,165 +16,165 @@
 
 #include "fnmatch.h"
 
-#define EOS        '\0'
+#define EOS		'\0'
 
-#define RANGE_MATCH        1
-#define RANGE_NOMATCH        0
-#define RANGE_ERROR        (-1)
+#define RANGE_MATCH		1
+#define RANGE_NOMATCH		0
+#define RANGE_ERROR		(-1)
 
 static int rangematch(const char *, char, int, char **);
 
 int
 p_fnmatch(const char *pattern, const char *string, int flags)
 {
-        const char *stringstart;
-        char *newp;
-        char c, test;
-
-        for (stringstart = string;;)
-                switch (c = *pattern++) {
-                case EOS:
-                        if ((flags & FNM_LEADING_DIR) && *string == '/')
-                                return (0);
-                        return (*string == EOS ? 0 : FNM_NOMATCH);
-                case '?':
-                        if (*string == EOS)
-                                return (FNM_NOMATCH);
-                        if (*string == '/' && (flags & FNM_PATHNAME))
-                                return (FNM_NOMATCH);
-                        if (*string == '.' && (flags & FNM_PERIOD) &&
-                            (string == stringstart ||
-                            ((flags & FNM_PATHNAME) && *(string - 1) == '/')))
-                                return (FNM_NOMATCH);
-                        ++string;
-                        break;
-                case '*':
-                        c = *pattern;
-                        /* Collapse multiple stars. */
-                        while (c == '*')
-                                c = *++pattern;
-
-                        if (*string == '.' && (flags & FNM_PERIOD) &&
-                            (string == stringstart ||
-                            ((flags & FNM_PATHNAME) && *(string - 1) == '/')))
-                                return (FNM_NOMATCH);
-
-                        /* Optimize for pattern with * at end or before /. */
-                        if (c == EOS) {
-                                if (flags & FNM_PATHNAME)
-                                        return ((flags & FNM_LEADING_DIR) ||
-                                            strchr(string, '/') == NULL ?
-                                            0 : FNM_NOMATCH);
-                                else
-                                        return (0);
-                        } else if (c == '/' && (flags & FNM_PATHNAME)) {
-                                if ((string = strchr(string, '/')) == NULL)
-                                        return (FNM_NOMATCH);
-                                break;
-                        }
-
-                        /* General case, use recursion. */
-                        while ((test = *string) != EOS) {
-                                if (!p_fnmatch(pattern, string, flags & ~FNM_PERIOD))
-                                        return (0);
-                                if (test == '/' && (flags & FNM_PATHNAME))
-                                        break;
-                                ++string;
-                        }
-                        return (FNM_NOMATCH);
-                case '[':
-                        if (*string == EOS)
-                                return (FNM_NOMATCH);
-                        if (*string == '/' && (flags & FNM_PATHNAME))
-                                return (FNM_NOMATCH);
-                        if (*string == '.' && (flags & FNM_PERIOD) &&
-                            (string == stringstart ||
-                            ((flags & FNM_PATHNAME) && *(string - 1) == '/')))
-                                return (FNM_NOMATCH);
-
-                        switch (rangematch(pattern, *string, flags, &newp)) {
-                        case RANGE_ERROR:
-                                /* not a good range, treat as normal text */
-                                goto normal;
-                        case RANGE_MATCH:
-                                pattern = newp;
-                                break;
-                        case RANGE_NOMATCH:
-                                return (FNM_NOMATCH);
-                        }
-                        ++string;
-                        break;
-                case '\\':
-                        if (!(flags & FNM_NOESCAPE)) {
-                                if ((c = *pattern++) == EOS) {
-                                        c = '\\';
-                                        --pattern;
-                                }
-                        }
-                        /* FALLTHROUGH */
-                default:
-                normal:
-                        if (c != *string && !((flags & FNM_CASEFOLD) &&
-                                 (tolower((unsigned char)c) ==
-                                 tolower((unsigned char)*string))))
-                                return (FNM_NOMATCH);
-                        ++string;
-                        break;
-                }
-        /* NOTREACHED */
+		const char *stringstart;
+		char *newp;
+		char c, test;
+
+		for (stringstart = string;;)
+				switch (c = *pattern++) {
+				case EOS:
+						if ((flags & FNM_LEADING_DIR) && *string == '/')
+								return (0);
+						return (*string == EOS ? 0 : FNM_NOMATCH);
+				case '?':
+						if (*string == EOS)
+								return (FNM_NOMATCH);
+						if (*string == '/' && (flags & FNM_PATHNAME))
+								return (FNM_NOMATCH);
+						if (*string == '.' && (flags & FNM_PERIOD) &&
+							(string == stringstart ||
+							((flags & FNM_PATHNAME) && *(string - 1) == '/')))
+								return (FNM_NOMATCH);
+						++string;
+						break;
+				case '*':
+						c = *pattern;
+						/* Collapse multiple stars. */
+						while (c == '*')
+								c = *++pattern;
+
+						if (*string == '.' && (flags & FNM_PERIOD) &&
+							(string == stringstart ||
+							((flags & FNM_PATHNAME) && *(string - 1) == '/')))
+								return (FNM_NOMATCH);
+
+						/* Optimize for pattern with * at end or before /. */
+						if (c == EOS) {
+								if (flags & FNM_PATHNAME)
+										return ((flags & FNM_LEADING_DIR) ||
+											strchr(string, '/') == NULL ?
+											0 : FNM_NOMATCH);
+								else
+										return (0);
+						} else if (c == '/' && (flags & FNM_PATHNAME)) {
+								if ((string = strchr(string, '/')) == NULL)
+										return (FNM_NOMATCH);
+								break;
+						}
+
+						/* General case, use recursion. */
+						while ((test = *string) != EOS) {
+								if (!p_fnmatch(pattern, string, flags & ~FNM_PERIOD))
+										return (0);
+								if (test == '/' && (flags & FNM_PATHNAME))
+										break;
+								++string;
+						}
+						return (FNM_NOMATCH);
+				case '[':
+						if (*string == EOS)
+								return (FNM_NOMATCH);
+						if (*string == '/' && (flags & FNM_PATHNAME))
+								return (FNM_NOMATCH);
+						if (*string == '.' && (flags & FNM_PERIOD) &&
+							(string == stringstart ||
+							((flags & FNM_PATHNAME) && *(string - 1) == '/')))
+								return (FNM_NOMATCH);
+
+						switch (rangematch(pattern, *string, flags, &newp)) {
+						case RANGE_ERROR:
+								/* not a good range, treat as normal text */
+								goto normal;
+						case RANGE_MATCH:
+								pattern = newp;
+								break;
+						case RANGE_NOMATCH:
+								return (FNM_NOMATCH);
+						}
+						++string;
+						break;
+				case '\\':
+						if (!(flags & FNM_NOESCAPE)) {
+								if ((c = *pattern++) == EOS) {
+										c = '\\';
+										--pattern;
+								}
+						}
+						/* FALLTHROUGH */
+				default:
+				normal:
+						if (c != *string && !((flags & FNM_CASEFOLD) &&
+									(tolower((unsigned char)c) ==
+									tolower((unsigned char)*string))))
+								return (FNM_NOMATCH);
+						++string;
+						break;
+				}
+		/* NOTREACHED */
 }
 
 static int
 rangematch(const char *pattern, char test, int flags, char **newp)
 {
-        int negate, ok;
-        char c, c2;
-
-        /*
-         * A bracket expression starting with an unquoted circumflex
-         * character produces unspecified results (IEEE 1003.2-1992,
-         * 3.13.2).  This implementation treats it like '!', for
-         * consistency with the regular expression syntax.
-         * J.T. Conklin (conklin@ngai.kaleida.com)
-         */
-        if ((negate = (*pattern == '!' || *pattern == '^')) != 0)
-                ++pattern;
-
-        if (flags & FNM_CASEFOLD)
-                test = (char)tolower((unsigned char)test);
-
-        /*
-         * A right bracket shall lose its special meaning and represent
-         * itself in a bracket expression if it occurs first in the list.
-         * -- POSIX.2 2.8.3.2
-         */
-        ok = 0;
-        c = *pattern++;
-        do {
-                if (c == '\\' && !(flags & FNM_NOESCAPE))
-                        c = *pattern++;
-                if (c == EOS)
-                        return (RANGE_ERROR);
-                if (c == '/' && (flags & FNM_PATHNAME))
-                        return (RANGE_NOMATCH);
-                if ((flags & FNM_CASEFOLD))
-                        c = (char)tolower((unsigned char)c);
-                if (*pattern == '-'
-                    && (c2 = *(pattern+1)) != EOS && c2 != ']') {
-                        pattern += 2;
-                        if (c2 == '\\' && !(flags & FNM_NOESCAPE))
-                                c2 = *pattern++;
-                        if (c2 == EOS)
-                                return (RANGE_ERROR);
-                        if (flags & FNM_CASEFOLD)
-                                c2 = (char)tolower((unsigned char)c2);
-                        if (c <= test && test <= c2)
-                                ok = 1;
-                } else if (c == test)
-                        ok = 1;
-        } while ((c = *pattern++) != ']');
-
-        *newp = (char *)pattern;
-        return (ok == negate ? RANGE_NOMATCH : RANGE_MATCH);
+		int negate, ok;
+		char c, c2;
+
+		/*
+			* A bracket expression starting with an unquoted circumflex
+			* character produces unspecified results (IEEE 1003.2-1992,
+			* 3.13.2). This implementation treats it like '!', for
+			* consistency with the regular expression syntax.
+			* J.T. Conklin (conklin@ngai.kaleida.com)
+			*/
+		if ((negate = (*pattern == '!' || *pattern == '^')) != 0)
+				++pattern;
+
+		if (flags & FNM_CASEFOLD)
+				test = (char)tolower((unsigned char)test);
+
+		/*
+			* A right bracket shall lose its special meaning and represent
+			* itself in a bracket expression if it occurs first in the list.
+			* -- POSIX.2 2.8.3.2
+			*/
+		ok = 0;
+		c = *pattern++;
+		do {
+				if (c == '\\' && !(flags & FNM_NOESCAPE))
+						c = *pattern++;
+				if (c == EOS)
+						return (RANGE_ERROR);
+				if (c == '/' && (flags & FNM_PATHNAME))
+						return (RANGE_NOMATCH);
+				if ((flags & FNM_CASEFOLD))
+						c = (char)tolower((unsigned char)c);
+				if (*pattern == '-'
+					&& (c2 = *(pattern+1)) != EOS && c2 != ']') {
+						pattern += 2;
+						if (c2 == '\\' && !(flags & FNM_NOESCAPE))
+								c2 = *pattern++;
+						if (c2 == EOS)
+								return (RANGE_ERROR);
+						if (flags & FNM_CASEFOLD)
+								c2 = (char)tolower((unsigned char)c2);
+						if (c <= test && test <= c2)
+								ok = 1;
+				} else if (c == test)
+						ok = 1;
+		} while ((c = *pattern++) != ']');
+
+		*newp = (char *)pattern;
+		return (ok == negate ? RANGE_NOMATCH : RANGE_MATCH);
 }
 
diff --git a/src/win32/fnmatch.h b/src/win32/fnmatch.h
index 2490292..1caac37 100644
--- a/src/win32/fnmatch.h
+++ b/src/win32/fnmatch.h
@@ -9,17 +9,17 @@
 
 #include "common.h"
 
-#define FNM_NOMATCH      1     /* Match failed. */
-#define FNM_NOSYS        2     /* Function not supported (unused). */
+#define FNM_NOMATCH		1		/* Match failed. */
+#define FNM_NOSYS		2		/* Function not supported (unused). */
 
-#define FNM_NOESCAPE     0x01        /* Disable backslash escaping. */
-#define FNM_PATHNAME     0x02        /* Slash must be matched by slash. */
-#define FNM_PERIOD       0x04        /* Period must be matched by period. */
-#define FNM_LEADING_DIR  0x08        /* Ignore /<tail> after Imatch. */
-#define FNM_CASEFOLD     0x10        /* Case insensitive search. */
+#define FNM_NOESCAPE		0x01		/* Disable backslash escaping. */
+#define FNM_PATHNAME		0x02		/* Slash must be matched by slash. */
+#define FNM_PERIOD		0x04		/* Period must be matched by period. */
+#define FNM_LEADING_DIR 0x08		/* Ignore /<tail> after Imatch. */
+#define FNM_CASEFOLD		0x10		/* Case insensitive search. */
 
-#define FNM_IGNORECASE   FNM_CASEFOLD
-#define FNM_FILE_NAME    FNM_PATHNAME
+#define FNM_IGNORECASE	FNM_CASEFOLD
+#define FNM_FILE_NAME	FNM_PATHNAME
 
 extern int p_fnmatch(const char *pattern, const char *string, int flags);
 
diff --git a/src/win32/map.c b/src/win32/map.c
index a30714c..3e6b3d8 100644
--- a/src/win32/map.c
+++ b/src/win32/map.c
@@ -29,7 +29,7 @@ int p_mmap(git_map *out, size_t len, int prot, int flags, int fd, git_off_t offs
 	DWORD fmap_prot = 0;
 	DWORD view_prot = 0;
 	DWORD off_low = 0;
-	DWORD off_hi  = 0;
+	DWORD off_hi = 0;
 	git_off_t page_start;
 	git_off_t page_offset;
 
@@ -71,7 +71,7 @@ int p_mmap(git_map *out, size_t len, int prot, int flags, int fd, git_off_t offs
 	page_start = (offset / page_size) * page_size;
 	page_offset = offset - page_start;
 
-	if (page_offset != 0) {  /* offset must be multiple of page size */
+	if (page_offset != 0) { /* offset must be multiple of page size */
 		errno = EINVAL;
 		return git__throw(GIT_ERROR, "Failed to mmap. Offset must be multiple of page size");
 	}
diff --git a/src/win32/mingw-compat.h b/src/win32/mingw-compat.h
index bd12de8..7207d88 100644
--- a/src/win32/mingw-compat.h
+++ b/src/win32/mingw-compat.h
@@ -17,7 +17,7 @@
 /* stat: file mode type testing macros */
 # define _S_IFLNK 0120000
 # define S_IFLNK _S_IFLNK
-# define S_ISLNK(m)  (((m) & _S_IFMT) == _S_IFLNK)
+# define S_ISLNK(m) (((m) & _S_IFMT) == _S_IFLNK)
 
 #endif
 
diff --git a/src/win32/msvc-compat.h b/src/win32/msvc-compat.h
index 57ff811..64ed184 100644
--- a/src/win32/msvc-compat.h
+++ b/src/win32/msvc-compat.h
@@ -9,10 +9,10 @@
 
 #if defined(_MSC_VER)
 
-/* access() mode parameter #defines   */
-# define F_OK 0  /* existence  check */
-# define W_OK 2  /* write mode check */
-# define R_OK 4  /* read  mode check */
+/* access() mode parameter #defines	*/
+# define F_OK 0 /* existence check */
+# define W_OK 2 /* write mode check */
+# define R_OK 4 /* read mode check */
 
 # define lseek _lseeki64
 # define stat _stat64
@@ -22,16 +22,16 @@
 # define _S_IFLNK 0120000
 # define S_IFLNK _S_IFLNK
 
-# define S_ISDIR(m)   (((m) & _S_IFMT) == _S_IFDIR)
-# define S_ISREG(m)   (((m) & _S_IFMT) == _S_IFREG)
-# define S_ISFIFO(m)  (((m) & _S_IFMT) == _S_IFIFO)
-# define S_ISLNK(m)  (((m) & _S_IFMT) == _S_IFLNK)
+# define S_ISDIR(m)	(((m) & _S_IFMT) == _S_IFDIR)
+# define S_ISREG(m)	(((m) & _S_IFMT) == _S_IFREG)
+# define S_ISFIFO(m) (((m) & _S_IFMT) == _S_IFIFO)
+# define S_ISLNK(m) (((m) & _S_IFMT) == _S_IFLNK)
 
 # define mode_t unsigned short
 
 /* case-insensitive string comparison */
-# define strcasecmp   _stricmp
-# define strncasecmp  _strnicmp
+# define strcasecmp	_stricmp
+# define strncasecmp _strnicmp
 
 #if (_MSC_VER >= 1600)
 #	include <stdint.h>
diff --git a/src/win32/posix.c b/src/win32/posix.c
index 2f63049..38e505e 100644
--- a/src/win32/posix.c
+++ b/src/win32/posix.c
@@ -144,13 +144,13 @@ int p_readlink(const char *link, char *target, size_t target_len)
 				"'GetFinalPathNameByHandleA' is not available in this platform");
 	}
 
-	hFile = CreateFile(link,            // file to open
-				 GENERIC_READ,          // open for reading
-				 FILE_SHARE_READ,       // share for reading
-				 NULL,                  // default security
-				 OPEN_EXISTING,         // existing file only
+	hFile = CreateFile(link,			// file to open
+				 GENERIC_READ,			// open for reading
+				 FILE_SHARE_READ,		// share for reading
+				 NULL,					// default security
+				 OPEN_EXISTING,			// existing file only
 				 FILE_FLAG_BACKUP_SEMANTICS, // normal file
-				 NULL);                 // no attr. template
+				 NULL);					// no attr. template
 
 	if (hFile == INVALID_HANDLE_VALUE)
 		return GIT_EOSERR;
@@ -163,7 +163,7 @@ int p_readlink(const char *link, char *target, size_t target_len)
 
 	if (dwRet > 4) {
 		/* Skip first 4 characters if they are "\\?\" */
-		if (target[0] == '\\' && target[1] == '\\' && target[2] == '?' && target[3] ==  '\\') {
+		if (target[0] == '\\' && target[1] == '\\' && target[2] == '?' && target[3] == '\\') {
 			char tmp[GIT_PATH_MAX];
 			unsigned int offset = 4;
 			dwRet -= 4;
@@ -189,7 +189,7 @@ int p_hide_directory__w32(const char *path)
 	int error;
 
 	error = SetFileAttributes(path, FILE_ATTRIBUTE_HIDDEN) != 0 ?
-        GIT_SUCCESS : GIT_ERROR; /* MSDN states a "non zero" value indicates a success */
+		GIT_SUCCESS : GIT_ERROR; /* MSDN states a "non zero" value indicates a success */
 
 	if (error < GIT_SUCCESS)
 		error = git__throw(GIT_EOSERR, "Failed to hide directory '%s'", path);
diff --git a/src/win32/pthread.c b/src/win32/pthread.c
index b613e91..e0f6c14 100644
--- a/src/win32/pthread.c
+++ b/src/win32/pthread.c
@@ -8,8 +8,8 @@
 #include "pthread.h"
 
 int pthread_create(pthread_t *GIT_RESTRICT thread,
-                   const pthread_attr_t *GIT_RESTRICT GIT_UNUSED(attr),
-                   void *(*start_routine)(void*), void *GIT_RESTRICT arg)
+					const pthread_attr_t *GIT_RESTRICT GIT_UNUSED(attr),
+					void *(*start_routine)(void*), void *GIT_RESTRICT arg)
 {
 	GIT_UNUSED_ARG(attr);
 	*thread = (pthread_t) CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)start_routine, arg, 0, NULL);
@@ -18,48 +18,48 @@ int pthread_create(pthread_t *GIT_RESTRICT thread,
 
 int pthread_join(pthread_t thread, void **value_ptr)
 {
-    int ret;
-    ret = WaitForSingleObject(thread, INFINITE);
-    if (ret && value_ptr)
-        GetExitCodeThread(thread, (void*) value_ptr);
-    return -(!!ret);
+	int ret;
+	ret = WaitForSingleObject(thread, INFINITE);
+	if (ret && value_ptr)
+		GetExitCodeThread(thread, (void*) value_ptr);
+	return -(!!ret);
 }
 
 int pthread_mutex_init(pthread_mutex_t *GIT_RESTRICT mutex,
-                       const pthread_mutexattr_t *GIT_RESTRICT GIT_UNUSED(mutexattr))
+						const pthread_mutexattr_t *GIT_RESTRICT GIT_UNUSED(mutexattr))
 {
-    GIT_UNUSED_ARG(mutexattr);
-    InitializeCriticalSection(mutex);
-    return 0;
+	GIT_UNUSED_ARG(mutexattr);
+	InitializeCriticalSection(mutex);
+	return 0;
 }
 
 int pthread_mutex_destroy(pthread_mutex_t *mutex)
 {
-    DeleteCriticalSection(mutex);
-    return 0;
+	DeleteCriticalSection(mutex);
+	return 0;
 }
 
 int pthread_mutex_lock(pthread_mutex_t *mutex)
 {
-    EnterCriticalSection(mutex);
-    return 0;
+	EnterCriticalSection(mutex);
+	return 0;
 }
 
 int pthread_mutex_unlock(pthread_mutex_t *mutex)
 {
-    LeaveCriticalSection(mutex);
-    return 0;
+	LeaveCriticalSection(mutex);
+	return 0;
 }
 
 int pthread_num_processors_np(void)
 {
-    DWORD_PTR p, s;
-    int n = 0;
+	DWORD_PTR p, s;
+	int n = 0;
 
-    if (GetProcessAffinityMask(GetCurrentProcess(), &p, &s))
-        for (; p; p >>= 1)
-            n += p&1;
+	if (GetProcessAffinityMask(GetCurrentProcess(), &p, &s))
+		for (; p; p >>= 1)
+			n += p&1;
 
-    return n ? n : 1;
+	return n ? n : 1;
 }
 
diff --git a/src/win32/pthread.h b/src/win32/pthread.h
index aaa226d..3ea8c7a 100644
--- a/src/win32/pthread.h
+++ b/src/win32/pthread.h
@@ -25,8 +25,8 @@ typedef HANDLE pthread_t;
 #define PTHREAD_MUTEX_INITIALIZER {(void*)-1};
 
 int pthread_create(pthread_t *GIT_RESTRICT,
-                   const pthread_attr_t *GIT_RESTRICT,
-                   void *(*start_routine)(void*), void *__restrict);
+					const pthread_attr_t *GIT_RESTRICT,
+					void *(*start_routine)(void*), void *__restrict);
 
 int pthread_join(pthread_t, void **);
 
diff --git a/tests-clay/clay_main.c b/tests-clay/clay_main.c
index 90c33bd..b536b6a 100644
--- a/tests-clay/clay_main.c
+++ b/tests-clay/clay_main.c
@@ -139,7 +139,7 @@ clay_run_test(
 static void
 clay_print_error(int num, const struct clay_error *error)
 {
-	clay_print("  %d) Failure:\n", num);
+	clay_print(" %d) Failure:\n", num);
 
 	clay_print("%s::%s (%s) [%s:%d] [-t%d]\n",
 		error->suite,
@@ -149,10 +149,10 @@ clay_print_error(int num, const struct clay_error *error)
 		error->line_number,
 		error->test_number);
 
-	clay_print("  %s\n", error->error_msg);
+	clay_print(" %s\n", error->error_msg);
 
 	if (error->description != NULL)
-		clay_print("  %s\n", error->description);
+		clay_print(" %s\n", error->description);
 
 	clay_print("\n");
 }
@@ -204,8 +204,8 @@ clay_usage(const char *arg)
 {
 	printf("Usage: %s [options]\n\n", arg);
 	printf("Options:\n");
-	printf("  -tXX\t\tRun only the test number XX\n");
-	printf("  -sXX\t\tRun only the suite number XX\n");
+	printf(" -tXX\t\tRun only the test number XX\n");
+	printf(" -sXX\t\tRun only the suite number XX\n");
 	exit(-1);
 }
 
@@ -691,7 +691,7 @@ extern void test_status_worktree__whole_repository(void);
 extern void test_status_worktree__empty_repository(void);
 
 static const struct clay_func _all_callbacks[] = {
-    {"dont_traverse_dot", &test_core_dirent__dont_traverse_dot, 0},
+	{"dont_traverse_dot", &test_core_dirent__dont_traverse_dot, 0},
 	{"traverse_subfolder", &test_core_dirent__traverse_subfolder, 0},
 	{"traverse_slash_terminated_folder", &test_core_dirent__traverse_slash_terminated_folder, 0},
 	{"dont_traverse_empty_folders", &test_core_dirent__dont_traverse_empty_folders, 0},
@@ -717,63 +717,63 @@ static const struct clay_func _all_callbacks[] = {
 };
 
 static const struct clay_suite _all_suites[] = {
-    {
-        "core::dirent",
-        {NULL, NULL, 0},
-        {NULL, NULL, 0},
-        &_all_callbacks[0], 5
-    },
 	{
-        "core::filebuf",
-        {NULL, NULL, 0},
-        {NULL, NULL, 0},
-        &_all_callbacks[5], 3
-    },
+		"core::dirent",
+		{NULL, NULL, 0},
+		{NULL, NULL, 0},
+		&_all_callbacks[0], 5
+	},
 	{
-        "core::path",
-        {NULL, NULL, 0},
-        {NULL, NULL, 0},
-        &_all_callbacks[8], 5
-    },
+		"core::filebuf",
+		{NULL, NULL, 0},
+		{NULL, NULL, 0},
+		&_all_callbacks[5], 3
+	},
 	{
-        "core::rmdir",
-        {"initialize", &test_core_rmdir__initialize, 3},
-        {NULL, NULL, 0},
-        &_all_callbacks[13], 2
-    },
+		"core::path",
+		{NULL, NULL, 0},
+		{NULL, NULL, 0},
+		&_all_callbacks[8], 5
+	},
 	{
-        "core::string",
-        {NULL, NULL, 0},
-        {NULL, NULL, 0},
-        &_all_callbacks[15], 2
-    },
+		"core::rmdir",
+		{"initialize", &test_core_rmdir__initialize, 3},
+		{NULL, NULL, 0},
+		&_all_callbacks[13], 2
+	},
 	{
-        "core::vector",
-        {NULL, NULL, 0},
-        {NULL, NULL, 0},
-        &_all_callbacks[17], 3
-    },
+		"core::string",
+		{NULL, NULL, 0},
+		{NULL, NULL, 0},
+		&_all_callbacks[15], 2
+	},
 	{
-        "status::single",
-        {NULL, NULL, 0},
-        {NULL, NULL, 0},
-        &_all_callbacks[20], 1
-    },
+		"core::vector",
+		{NULL, NULL, 0},
+		{NULL, NULL, 0},
+		&_all_callbacks[17], 3
+	},
 	{
-        "status::worktree",
-        {"initialize", &test_status_worktree__initialize, 7},
-        {"cleanup", &test_status_worktree__cleanup, 7},
-        &_all_callbacks[21], 2
-    }
+		"status::single",
+		{NULL, NULL, 0},
+		{NULL, NULL, 0},
+		&_all_callbacks[20], 1
+	},
+	{
+		"status::worktree",
+		{"initialize", &test_status_worktree__initialize, 7},
+		{"cleanup", &test_status_worktree__cleanup, 7},
+		&_all_callbacks[21], 2
+	}
 };
 
 static const char _suites_str[] = "core::dirent, core::filebuf, core::path, core::rmdir, core::string, core::vector, status::single, status::worktree";
 
 int _CC main(int argc, char *argv[])
 {
-    return clay_test(
-        argc, argv, _suites_str,
-        _all_callbacks, 23,
-        _all_suites, 8
-    );
+	return clay_test(
+		argc, argv, _suites_str,
+		_all_callbacks, 23,
+		_all_suites, 8
+	);
 }
diff --git a/tests-clay/core/dirent.c b/tests-clay/core/dirent.c
index ed51890..73f5715 100644
--- a/tests-clay/core/dirent.c
+++ b/tests-clay/core/dirent.c
@@ -2,13 +2,13 @@
 #include "fileops.h"
 
 typedef struct name_data {
-	int  count;  /* return count */
-	char *name;  /* filename     */
+	int count; /* return count */
+	char *name; /* filename		*/
 } name_data;
 
 typedef struct walk_data {
-	char *sub;        /* sub-directory name */
-	name_data *names; /* name state data    */
+	char *sub;		/* sub-directory name */
+	name_data *names; /* name state data	*/
 } walk_data;
 
 
@@ -112,9 +112,9 @@ void test_core_dirent__dont_traverse_dot(void)
 	setup(&dot);
 
 	cl_git_pass(git_futils_direach(path_buffer,
-			       sizeof(path_buffer),
-			       one_entry,
-			       &dot));
+					sizeof(path_buffer),
+					one_entry,
+					&dot));
 
 	check_counts(&dot);
 }
@@ -138,9 +138,9 @@ void test_core_dirent__traverse_subfolder(void)
 	setup(&sub);
 
 	cl_git_pass(git_futils_direach(path_buffer,
-			       sizeof(path_buffer),
-			       one_entry,
-			       &sub));
+					sizeof(path_buffer),
+					one_entry,
+					&sub));
 
 	check_counts(&sub);
 }
@@ -158,9 +158,9 @@ void test_core_dirent__traverse_slash_terminated_folder(void)
 	setup(&sub_slash);
 
 	cl_git_pass(git_futils_direach(path_buffer,
-			       sizeof(path_buffer),
-			       one_entry,
-			       &sub_slash));
+					sizeof(path_buffer),
+					one_entry,
+					&sub_slash));
 
 	check_counts(&sub_slash);
 }
@@ -181,17 +181,17 @@ void test_core_dirent__dont_traverse_empty_folders(void)
 	setup(&empty);
 
 	cl_git_pass(git_futils_direach(path_buffer,
-			       sizeof(path_buffer),
-			       one_entry,
-			       &empty));
+					sizeof(path_buffer),
+					one_entry,
+					&empty));
 
 	check_counts(&empty);
 
 	/* make sure callback not called */
 	cl_git_pass(git_futils_direach(path_buffer,
-			       sizeof(path_buffer),
-			       dont_call_me,
-			       &empty));
+					sizeof(path_buffer),
+					dont_call_me,
+					&empty));
 }
 
 static name_data odd_names[] = {
@@ -199,7 +199,7 @@ static name_data odd_names[] = {
 	{ 0, "odd/..c" },
 	/* the following don't work on cygwin/win32 */
 	/* { 0, "odd/.b." }, */
-	/* { 0, "odd/..d.." },  */
+	/* { 0, "odd/..d.." }, */
 	{ 0, NULL }
 };
 static walk_data odd = {
@@ -214,9 +214,9 @@ void test_core_dirent__traverse_weird_filenames(void)
 	setup(&odd);
 
 	cl_git_pass(git_futils_direach(path_buffer,
-			       sizeof(path_buffer),
-			       one_entry,
-			       &odd));
+					sizeof(path_buffer),
+					one_entry,
+					&odd));
 
 	check_counts(&odd);
 }
diff --git a/tests-clay/core/vector.c b/tests-clay/core/vector.c
index ba9d188..44e6d87 100644
--- a/tests-clay/core/vector.c
+++ b/tests-clay/core/vector.c
@@ -24,7 +24,7 @@ void test_core_vector__1(void)
 	git_vector_insert(&x, (void*) 0xdef);
 	git_vector_insert(&x, (void*) 0x123);
 
-	git_vector_remove(&x, 0);  // used to read past array bounds.
+	git_vector_remove(&x, 0); // used to read past array bounds.
 	git_vector_free(&x);
 }