Commit 0a7c00be7fb5e85574bbe4676465b24b22f40e87

lhchavez 2022-06-11T14:31:16

Merge remote-tracking branch 'origin/main' into main

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
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
index 38b4a04..de1ec5e 100644
--- a/.github/workflows/codeql.yml
+++ b/.github/workflows/codeql.yml
@@ -6,7 +6,7 @@ on:
     - cron: '21 3 * * 1'
 
 env:
-  docker-registry: docker.pkg.github.com
+  docker-registry: ghcr.io
 
 jobs:
   analyze:
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 69b691e..3435556 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -10,7 +10,7 @@ on:
   workflow_dispatch:
 
 env:
-  docker-registry: docker.pkg.github.com
+  docker-registry: ghcr.io
   docker-config-path: source/ci/docker
 
 jobs:
@@ -69,7 +69,7 @@ jobs:
         if [ "${{ matrix.container.base }}" != "" ]; then
           BASE_ARG="--build-arg BASE=${{ matrix.container.base }}"
         fi
-        docker build -t ${{ env.docker-registry-container-sha }} ${BASE_ARG} -f ${{ env.dockerfile }} .
+        docker build -t ${{ env.docker-registry-container-sha }} --build-arg UID=$(id -u) --build-arg GID=$(id -g) ${BASE_ARG} -f ${{ env.dockerfile }} .
         docker tag ${{ env.docker-registry-container-sha }} ${{ env.docker-registry-container-latest }}
         docker push ${{ env.docker-registry-container-sha }}
         docker push ${{ env.docker-registry-container-latest }}
@@ -85,6 +85,7 @@ jobs:
       matrix:
         platform:
         - name: "Linux (Xenial, GCC, OpenSSL)"
+          id: xenial-gcc-openssl
           container:
             name: xenial
           env:
@@ -93,6 +94,7 @@ jobs:
             CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DREGEX_BACKEND=builtin -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=ON -DDEBUG_STRICT_ALLOC=ON -DDEBUG_STRICT_OPEN=ON
           os: ubuntu-latest
         - name: Linux (Xenial, GCC, mbedTLS)
+          id: xenial-gcc-mbedtls
           container:
             name: xenial
           env:
@@ -101,6 +103,7 @@ jobs:
             CMAKE_OPTIONS: -DUSE_HTTPS=mbedTLS -DUSE_SHA1=HTTPS -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=ON
           os: ubuntu-latest
         - name: "Linux (Xenial, Clang, OpenSSL)"
+          id: xenial-clang-openssl
           container:
             name: xenial
           env:
@@ -109,6 +112,7 @@ jobs:
             CMAKE_OPTIONS: -DUSE_HTTPS=OpenSSL -DDEPRECATE_HARD=ON -DUSE_LEAK_CHECKER=valgrind -DUSE_GSSAPI=ON -DUSE_SSH=ON
           os: ubuntu-latest
         - name: "Linux (Xenial, Clang, mbedTLS)"
+          id: xenial-clang-mbedtls
           container:
             name: xenial
           env:
@@ -117,6 +121,7 @@ jobs:
             CMAKE_GENERATOR: Ninja
           os: ubuntu-latest
         - name: "Linux (MemorySanitizer)"
+          id: memorysanitizer
           container:
             name: focal
           env:
@@ -130,6 +135,7 @@ jobs:
             UBSAN_OPTIONS: print_stacktrace=1
           os: ubuntu-latest
         - name: "Linux (UndefinedBehaviorSanitizer)"
+          id: ubsanitizer
           container:
             name: focal
           env:
@@ -143,6 +149,7 @@ jobs:
             UBSAN_OPTIONS: print_stacktrace=1
           os: ubuntu-latest
         - name: "Linux (ThreadSanitizer)"
+          id: threadsanitizer
           container:
             name: focal
           env:
@@ -157,6 +164,7 @@ jobs:
             TSAN_OPTIONS: suppressions=/home/libgit2/source/script/thread-sanitizer.supp second_deadlock_stack=1
           os: ubuntu-latest
         - name: "macOS"
+          id: macos
           os: macos-10.15
           env:
             CC: clang
@@ -166,6 +174,7 @@ jobs:
             SKIP_NEGOTIATE_TESTS: true
           setup-script: osx
         - name: "Windows (amd64, Visual Studio)"
+          id: windows-amd64-vs
           os: windows-2019
           env:
             ARCH: amd64
@@ -174,6 +183,7 @@ jobs:
             SKIP_SSH_TESTS: true
             SKIP_NEGOTIATE_TESTS: true
         - name: "Windows (x86, Visual Studio)"
+          id: windows-x86-vs
           os: windows-2019
           env:
             ARCH: x86
@@ -182,6 +192,7 @@ jobs:
             SKIP_SSH_TESTS: true
             SKIP_NEGOTIATE_TESTS: true
         - name: "Windows (amd64, mingw)"
+          id: windows-amd64-mingw
           os: windows-2019
           setup-script: mingw
           env:
@@ -193,6 +204,7 @@ jobs:
             SKIP_SSH_TESTS: true
             SKIP_NEGOTIATE_TESTS: true
         - name: "Windows (x86, mingw)"
+          id: windows-x86-mingw
           os: windows-2019
           setup-script: mingw
           env:
@@ -237,10 +249,12 @@ jobs:
         export GITTEST_NEGOTIATE_PASSWORD="${{ secrets.GITTEST_NEGOTIATE_PASSWORD }}"
 
         if [ -n "${{ matrix.platform.container.name }}" ]; then
+          mkdir build
           docker run \
               --rm \
-              --user libgit2:libgit2 \
+              --user "$(id -u):$(id -g)" \
               -v "$(pwd)/source:/home/libgit2/source" \
+              -v "$(pwd)/build:/home/libgit2/build" \
               -w /home/libgit2 \
               -e ASAN_SYMBOLIZER_PATH \
               -e CC \
@@ -255,13 +269,33 @@ jobs:
               -e TSAN_OPTIONS \
               -e UBSAN_OPTIONS \
               ${{ env.docker-registry-container-sha }} \
-              /bin/bash -c "mkdir build && cd build && ../source/ci/build.sh && ../source/ci/test.sh"
+              /bin/bash -c "cd build && ../source/ci/build.sh && ../source/ci/test.sh"
         else
-          mkdir build && cd build
+          mkdir build
+          cd build
           ../source/ci/build.sh
           ../source/ci/test.sh
         fi
       shell: bash
+    - name: Upload test results
+      uses: actions/upload-artifact@v3
+      if: success() || failure()
+      with:
+        name: test-results-${{ matrix.platform.id }}
+        path: build/results_*.xml
+
+  test_results:
+    name: Test results
+    needs: [ build ]
+    runs-on: ubuntu-latest
+    steps:
+    - name: Download test results
+      uses: actions/download-artifact@v3
+    - name: Generate test summary
+      uses: test-summary/action@v1
+      with:
+        paths: 'test-results-*/*.xml'
+
 
   # Generate documentation using docurium.  We'll upload the documentation
   # as a build artifact so that it can be reviewed as part of a pull
@@ -271,6 +305,7 @@ jobs:
   documentation:
     name: Generate documentation
     needs: [ containers ]
+    if: success() || failure()
     runs-on: ubuntu-latest
     steps:
     - name: Check out repository
diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml
index c26e1e2..5f80ed0 100644
--- a/.github/workflows/nightly.yml
+++ b/.github/workflows/nightly.yml
@@ -7,7 +7,7 @@ on:
   - cron: '15 1 * * *'
 
 env:
-  docker-registry: docker.pkg.github.com
+  docker-registry: ghcr.io
   docker-config-path: source/ci/docker
 
 jobs:
diff --git a/README.md b/README.md
index c73b507..a9deaa0 100644
--- a/README.md
+++ b/README.md
@@ -392,6 +392,8 @@ Here are the bindings to libgit2 that are currently available:
     * parrot-libgit2 <https://github.com/letolabs/parrot-libgit2>
 * Perl
     * Git-Raw <https://github.com/jacquesg/p5-Git-Raw>
+* Pharo Smalltalk
+    * libgit2-pharo-bindings <https://github.com/pharo-vcs/libgit2-pharo-bindings>
 * PHP
     * php-git <https://github.com/libgit2/php-git>
 * Python
@@ -405,6 +407,8 @@ Here are the bindings to libgit2 that are currently available:
     * git2-rs <https://github.com/rust-lang/git2-rs>
 * Swift
     * SwiftGit2 <https://github.com/SwiftGit2/SwiftGit2>
+* Tcl
+    * lg2 <https://github.com/apnadkarni/tcl-libgit2>
 * Vala
     * libgit2.vapi <https://github.com/apmasell/vapis/blob/master/libgit2.vapi>
 
diff --git a/ci/docker/bionic b/ci/docker/bionic
index 51af5c0..52832f3 100644
--- a/ci/docker/bionic
+++ b/ci/docker/bionic
@@ -38,7 +38,12 @@ RUN cd /tmp && \
     rm -rf mbedtls-2.16.2
 
 FROM mbedtls AS adduser
-RUN useradd --shell /bin/bash libgit2 --create-home
+ARG UID=""
+ARG GID=""
+RUN if [ "${UID}" != "" ]; then USER_ARG="--uid ${UID}"; fi && \
+    if [ "${GID}" != "" ]; then GROUP_ARG="--gid ${GID}"; fi && \
+    groupadd ${GROUP_ARG} libgit2 && \
+    useradd ${USER_ARG} --gid libgit2 --shell /bin/bash --create-home libgit2
 
 FROM adduser AS configure
 RUN mkdir /var/run/sshd
diff --git a/ci/docker/centos7 b/ci/docker/centos7
index 8105f14..28ed650 100644
--- a/ci/docker/centos7
+++ b/ci/docker/centos7
@@ -48,7 +48,12 @@ RUN cd /tmp && \
     rm -rf cmake-3.21.1
 
 FROM cmake AS adduser
-RUN useradd --shell /bin/bash libgit2 --create-home
+ARG UID=""
+ARG GID=""
+RUN if [ "${UID}" != "" ]; then USER_ARG="--uid ${UID}"; fi && \
+    if [ "${GID}" != "" ]; then GROUP_ARG="--gid ${GID}"; fi && \
+    groupadd ${GROUP_ARG} libgit2 && \
+    useradd ${USER_ARG} --gid libgit2 --shell /bin/bash --create-home libgit2
 
 FROM adduser AS configure
 ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig
diff --git a/ci/docker/centos8 b/ci/docker/centos8
index cca0881..81f0c3c 100644
--- a/ci/docker/centos8
+++ b/ci/docker/centos8
@@ -1,6 +1,10 @@
 ARG BASE=centos:8
 
-FROM ${BASE} AS yum
+FROM ${BASE} AS stream
+RUN dnf -y --disablerepo '*' --enablerepo=extras swap centos-linux-repos centos-stream-repos && \
+    dnf -y distro-sync
+
+FROM stream AS yum
 RUN yum install -y \
 	which \
 	bzip2 \
@@ -40,7 +44,12 @@ RUN cd /tmp && \
     rm -rf valgrind-3.15.0
 
 FROM valgrind AS adduser
-RUN useradd --shell /bin/bash libgit2 --create-home
+ARG UID=""
+ARG GID=""
+RUN if [ "${UID}" != "" ]; then USER_ARG="--uid ${UID}"; fi && \
+    if [ "${GID}" != "" ]; then GROUP_ARG="--gid ${GID}"; fi && \
+    groupadd ${GROUP_ARG} libgit2 && \
+    useradd ${USER_ARG} --gid libgit2 --shell /bin/bash --create-home libgit2
 
 FROM adduser AS configure
 ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig
diff --git a/ci/docker/focal b/ci/docker/focal
index 37d7d63..8061237 100644
--- a/ci/docker/focal
+++ b/ci/docker/focal
@@ -73,7 +73,13 @@ RUN cd /tmp && \
     rm -rf valgrind-3.15.0
 
 FROM valgrind AS adduser
-RUN useradd --shell /bin/bash libgit2 --create-home
+ARG UID=""
+ARG GID=""
+RUN if [ "${UID}" != "" ]; then USER_ARG="--uid ${UID}"; fi && \
+    if [ "${GID}" != "" ]; then GROUP_ARG="--gid ${GID}"; fi && \
+    groupadd ${GROUP_ARG} libgit2 && \
+    useradd ${USER_ARG} --gid libgit2 --shell /bin/bash --create-home libgit2
+
 
 FROM adduser AS configure
 RUN mkdir /var/run/sshd
diff --git a/ci/docker/xenial b/ci/docker/xenial
index c19fe42..c979146 100644
--- a/ci/docker/xenial
+++ b/ci/docker/xenial
@@ -60,7 +60,13 @@ RUN cd /tmp && \
     rm -rf valgrind-3.15.0
 
 FROM valgrind AS adduser
-RUN useradd --shell /bin/bash libgit2 --create-home
+ARG UID=""
+ARG GID=""
+RUN if [ "${UID}" != "" ]; then USER_ARG="--uid ${UID}"; fi && \
+    if [ "${GID}" != "" ]; then GROUP_ARG="--gid ${GID}"; fi && \
+    groupadd ${GROUP_ARG} libgit2 && \
+    useradd ${USER_ARG} --gid libgit2 --shell /bin/bash --create-home libgit2
+
 
 FROM adduser AS configure
 RUN mkdir /var/run/sshd
diff --git a/ci/getcontainer.sh b/ci/getcontainer.sh
index 07ef7b8..81d0c1d 100755
--- a/ci/getcontainer.sh
+++ b/ci/getcontainer.sh
@@ -37,9 +37,13 @@ DOCKER_REGISTRY_CONTAINER_SHA="${DOCKER_REGISTRY_CONTAINER}:${DOCKER_SHA}"
 echo "docker-registry-container-sha=${DOCKER_REGISTRY_CONTAINER_SHA}" >> $GITHUB_ENV
 echo "docker-registry-container-latest=${DOCKER_REGISTRY_CONTAINER}:latest" >> $GITHUB_ENV
 
+echo "::: logging in to ${DOCKER_REGISTRY} as ${GITHUB_ACTOR}"
+
 exists="true"
 docker login https://${DOCKER_REGISTRY} -u ${GITHUB_ACTOR} -p ${GITHUB_TOKEN} || exists="false"
 
+echo "::: pulling ${DOCKER_REGISTRY_CONTAINER_SHA}"
+
 if [ "${exists}" != "false" ]; then
 	docker pull ${DOCKER_REGISTRY_CONTAINER_SHA} || exists="false"
 fi
diff --git a/fuzzers/packfile_fuzzer.c b/fuzzers/packfile_fuzzer.c
index 6002fa1..23ecaf8 100644
--- a/fuzzers/packfile_fuzzer.c
+++ b/fuzzers/packfile_fuzzer.c
@@ -94,7 +94,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
 			fprintf(stderr, "Failed to compute the SHA1 hash\n");
 			abort();
 		}
-		if (git_indexer_append(indexer, &oid, sizeof(oid), &stats) < 0) {
+		if (git_indexer_append(indexer, &oid.id, GIT_OID_RAWSZ, &stats) < 0) {
 			goto cleanup;
 		}
 	}
diff --git a/include/git2/branch.h b/include/git2/branch.h
index 36a393d..27c6fa1 100644
--- a/include/git2/branch.h
+++ b/include/git2/branch.h
@@ -129,8 +129,8 @@ GIT_EXTERN(void) git_branch_iterator_free(git_branch_iterator *iter);
  * See `git_tag_create()` for rules about valid names.
  *
  * Note that if the move succeeds, the old reference object will not
- + be valid anymore, and should be freed immediately by the user using
- + `git_reference_free()`.
+ * be valid anymore, and should be freed immediately by the user using
+ * `git_reference_free()`.
  *
  * @param out New reference object for the updated name.
  *
diff --git a/include/git2/config.h b/include/git2/config.h
index a5486a4..9919447 100644
--- a/include/git2/config.h
+++ b/include/git2/config.h
@@ -122,7 +122,7 @@ typedef struct {
  * global configuration file.
  *
  * This method will not guess the path to the xdg compatible
- * config file (.config/git/config).
+ * config file (`.config/git/config`).
  *
  * @param out Pointer to a user-allocated git_buf in which to store the path
  * @return 0 if a global configuration file has been found. Its path will be stored in `out`.
@@ -149,8 +149,8 @@ GIT_EXTERN(int) git_config_find_xdg(git_buf *out);
 /**
  * Locate the path to the system configuration file
  *
- * If /etc/gitconfig doesn't exist, it will look for
- * %PROGRAMFILES%\Git\etc\gitconfig.
+ * If `/etc/gitconfig` doesn't exist, it will look for
+ * `%PROGRAMFILES%\Git\etc\gitconfig`.
  *
  * @param out Pointer to a user-allocated git_buf in which to store the path
  * @return 0 if a system configuration file has been
@@ -161,7 +161,7 @@ GIT_EXTERN(int) git_config_find_system(git_buf *out);
 /**
  * Locate the path to the configuration file in ProgramData
  *
- * Look for the file in %PROGRAMDATA%\Git\config used by portable git.
+ * Look for the file in `%PROGRAMDATA%\Git\config` used by portable git.
  *
  * @param out Pointer to a user-allocated git_buf in which to store the path
  * @return 0 if a ProgramData configuration file has been
diff --git a/include/git2/merge.h b/include/git2/merge.h
index e90941a..fcce559 100644
--- a/include/git2/merge.h
+++ b/include/git2/merge.h
@@ -603,7 +603,7 @@ GIT_EXTERN(int) git_merge_commits(
  * completes, resolve any conflicts and prepare a commit.
  *
  * For compatibility with git, the repository is put into a merging
- * state. Once the commit is done (or if the uses wishes to abort),
+ * state. Once the commit is done (or if the user wishes to abort),
  * you should clear this state by calling
  * `git_repository_state_cleanup()`.
  *
diff --git a/src/cli/cli.h b/src/cli/cli.h
index 222d53a..7dede67 100644
--- a/src/cli/cli.h
+++ b/src/cli/cli.h
@@ -15,5 +15,6 @@
 #include "error.h"
 #include "opt.h"
 #include "opt_usage.h"
+#include "sighandler.h"
 
 #endif /* CLI_cli_h__ */
diff --git a/src/cli/cmd.h b/src/cli/cmd.h
index 664b502..8b1a1b3 100644
--- a/src/cli/cmd.h
+++ b/src/cli/cmd.h
@@ -26,6 +26,7 @@ extern const cli_cmd_spec *cli_cmd_spec_byname(const char *name);
 
 /* Commands */
 extern int cmd_cat_file(int argc, char **argv);
+extern int cmd_clone(int argc, char **argv);
 extern int cmd_hash_object(int argc, char **argv);
 extern int cmd_help(int argc, char **argv);
 
diff --git a/src/cli/cmd_clone.c b/src/cli/cmd_clone.c
new file mode 100644
index 0000000..a382b58
--- /dev/null
+++ b/src/cli/cmd_clone.c
@@ -0,0 +1,176 @@
+/*
+ * Copyright (C) the libgit2 contributors. All rights reserved.
+ *
+ * This file is part of libgit2, distributed under the GNU GPL v2 with
+ * a Linking Exception. For full terms see the included COPYING file.
+ */
+
+#include <stdio.h>
+#include <git2.h>
+#include "cli.h"
+#include "cmd.h"
+#include "error.h"
+#include "sighandler.h"
+#include "progress.h"
+
+#include "fs_path.h"
+#include "futils.h"
+
+#define COMMAND_NAME "clone"
+
+static char *branch, *remote_path, *local_path;
+static int show_help, quiet, checkout = 1, bare;
+static bool local_path_exists;
+static cli_progress progress = CLI_PROGRESS_INIT;
+
+static const cli_opt_spec opts[] = {
+	{ CLI_OPT_TYPE_SWITCH,    "help",         0,  &show_help,   1,
+	  CLI_OPT_USAGE_HIDDEN | CLI_OPT_USAGE_STOP_PARSING, NULL,
+	  "display help about the " COMMAND_NAME " command" },
+
+	{ CLI_OPT_TYPE_SWITCH,    "quiet",       'q', &quiet,       1,
+	  CLI_OPT_USAGE_DEFAULT,   NULL,         "display the type of the object" },
+	{ CLI_OPT_TYPE_SWITCH,    "no-checkout", 'n', &checkout,    0,
+	  CLI_OPT_USAGE_DEFAULT,   NULL,         "don't checkout HEAD" },
+	{ CLI_OPT_TYPE_SWITCH,    "bare",         0,  &bare,        1,
+	  CLI_OPT_USAGE_DEFAULT,   NULL,         "don't create a working directory" },
+	{ CLI_OPT_TYPE_VALUE,     "branch",      'b', &branch,      0,
+	  CLI_OPT_USAGE_DEFAULT,  "name",        "branch to check out" },
+	{ CLI_OPT_TYPE_LITERAL },
+	{ CLI_OPT_TYPE_ARG,       "repository",   0,  &remote_path, 0,
+	  CLI_OPT_USAGE_REQUIRED, "repository",  "repository path" },
+	{ CLI_OPT_TYPE_ARG,       "directory",    0,  &local_path,  0,
+	  CLI_OPT_USAGE_DEFAULT,  "directory",    "directory to clone into" },
+	{ 0 }
+};
+
+static void print_help(void)
+{
+	cli_opt_usage_fprint(stdout, PROGRAM_NAME, COMMAND_NAME, opts);
+	printf("\n");
+
+	printf("Clone a repository into a new directory.\n");
+	printf("\n");
+
+	printf("Options:\n");
+
+	cli_opt_help_fprint(stdout, opts);
+}
+
+static char *compute_local_path(const char *orig_path)
+{
+	const char *slash;
+	char *local_path;
+
+	if ((slash = strrchr(orig_path, '/')) == NULL &&
+	    (slash = strrchr(orig_path, '\\')) == NULL)
+		local_path = git__strdup(orig_path);
+	else
+		local_path = git__strdup(slash + 1);
+
+	return local_path;
+}
+
+static bool validate_local_path(const char *path)
+{
+	if (!git_fs_path_exists(path))
+		return false;
+
+	if (!git_fs_path_isdir(path) || !git_fs_path_is_empty_dir(path)) {
+		fprintf(stderr, "fatal: destination path '%s' already exists and is not an empty directory.\n",
+			path);
+		exit(128);
+	}
+
+	return true;
+}
+
+static void cleanup(void)
+{
+	int rmdir_flags = GIT_RMDIR_REMOVE_FILES;
+
+	cli_progress_abort(&progress);
+
+	if (local_path_exists)
+		rmdir_flags |= GIT_RMDIR_SKIP_ROOT;
+
+	if (!git_fs_path_isdir(local_path))
+		return;
+
+	git_futils_rmdir_r(local_path, NULL, rmdir_flags);
+}
+
+static void interrupt_cleanup(void)
+{
+	cleanup();
+	exit(130);
+}
+
+int cmd_clone(int argc, char **argv)
+{
+	git_clone_options clone_opts = GIT_CLONE_OPTIONS_INIT;
+	git_repository *repo = NULL;
+	cli_opt invalid_opt;
+	char *computed_path = NULL;
+	int ret = 0;
+
+	if (cli_opt_parse(&invalid_opt, opts, argv + 1, argc - 1, CLI_OPT_PARSE_GNU))
+		return cli_opt_usage_error(COMMAND_NAME, opts, &invalid_opt);
+
+	if (show_help) {
+		print_help();
+		return 0;
+	}
+
+	if (!remote_path) {
+		ret = cli_error_usage("you must specify a repository to clone");
+		goto done;
+	}
+
+	if (bare)
+		clone_opts.bare = 1;
+
+	if (branch)
+		clone_opts.checkout_branch = branch;
+
+	if (!checkout)
+		clone_opts.checkout_opts.checkout_strategy = GIT_CHECKOUT_NONE;
+
+	if (!local_path)
+		local_path = computed_path = compute_local_path(remote_path);
+
+	local_path_exists = validate_local_path(local_path);
+
+	cli_sighandler_set_interrupt(interrupt_cleanup);
+
+	if (!local_path_exists &&
+	    git_futils_mkdir(local_path, 0777, 0) < 0) {
+		ret = cli_error_git();
+		goto done;
+	}
+
+	if (!quiet) {
+		clone_opts.fetch_opts.callbacks.sideband_progress = cli_progress_fetch_sideband;
+		clone_opts.fetch_opts.callbacks.transfer_progress = cli_progress_fetch_transfer;
+		clone_opts.fetch_opts.callbacks.payload = &progress;
+
+		clone_opts.checkout_opts.progress_cb = cli_progress_checkout;
+		clone_opts.checkout_opts.progress_payload = &progress;
+
+		printf("Cloning into '%s'...\n", local_path);
+	}
+
+	if (git_clone(&repo, remote_path, local_path, &clone_opts) < 0) {
+		cleanup();
+		ret = cli_error_git();
+		goto done;
+	}
+
+	cli_progress_finish(&progress);
+
+done:
+	cli_progress_dispose(&progress);
+	git__free(computed_path);
+	git_repository_free(repo);
+	return ret;
+}
diff --git a/src/cli/main.c b/src/cli/main.c
index 08abb32..cbfc50e 100644
--- a/src/cli/main.c
+++ b/src/cli/main.c
@@ -29,6 +29,7 @@ const cli_opt_spec cli_common_opts[] = {
 
 const cli_cmd_spec cli_cmds[] = {
 	{ "cat-file",    cmd_cat_file,    "Display an object in the repository" },
+	{ "clone",       cmd_clone,       "Clone a repository into a new directory" },
 	{ "hash-object", cmd_hash_object, "Hash a raw object and product its object ID" },
 	{ "help",        cmd_help,        "Display help information" },
 	{ NULL }
diff --git a/src/cli/progress.c b/src/cli/progress.c
new file mode 100644
index 0000000..ba52655
--- /dev/null
+++ b/src/cli/progress.c
@@ -0,0 +1,345 @@
+/*
+ * Copyright (C) the libgit2 contributors. All rights reserved.
+ *
+ * This file is part of libgit2, distributed under the GNU GPL v2 with
+ * a Linking Exception. For full terms see the included COPYING file.
+ */
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdint.h>
+
+#include "progress.h"
+#include "error.h"
+
+/*
+ * Show updates to the percentage and number of objects received
+ * separately from the throughput to give an accurate progress while
+ * avoiding too much noise on the screen.
+ */
+#define PROGRESS_UPDATE_TIME 0.10
+#define THROUGHPUT_UPDATE_TIME 1.00
+
+#define is_nl(c) ((c) == '\r' || (c) == '\n')
+
+#define return_os_error(msg) do { \
+	git_error_set(GIT_ERROR_OS, "%s", msg); return -1; } while(0)
+
+GIT_INLINE(size_t) no_nl_len(const char *str, size_t len)
+{
+	size_t i = 0;
+
+	while (i < len && !is_nl(str[i]))
+		i++;
+
+	return i;
+}
+
+GIT_INLINE(size_t) nl_len(bool *has_nl, const char *str, size_t len)
+{
+	size_t i = no_nl_len(str, len);
+
+	*has_nl = false;
+
+	while (i < len && is_nl(str[i])) {
+		*has_nl = true;
+		i++;
+	}
+
+	return i;
+}
+
+static int progress_write(cli_progress *progress, bool force, git_str *line)
+{
+	bool has_nl;
+	size_t no_nl = no_nl_len(line->ptr, line->size);
+	size_t nl = nl_len(&has_nl, line->ptr + no_nl, line->size - no_nl);
+	double now = git__timer();
+	size_t i;
+
+	/* Avoid spamming the console with progress updates */
+	if (!force && line->ptr[line->size - 1] != '\n' && progress->last_update) {
+		if (now - progress->last_update < PROGRESS_UPDATE_TIME) {
+			git_str_clear(&progress->deferred);
+			git_str_put(&progress->deferred, line->ptr, line->size);
+			return git_str_oom(&progress->deferred) ? -1 : 0;
+		}
+	}
+
+	/*
+	 * If there's something on this line already (eg, a progress line
+	 * with only a trailing `\r` that we'll print over) then we need
+	 * to really print over it in case we're writing a shorter line.
+	 */
+	if (printf("%.*s", (int)no_nl, line->ptr) < 0)
+		return_os_error("could not print status");
+
+	if (progress->onscreen.size) {
+		for (i = no_nl; i < progress->onscreen.size; i++) {
+			if (printf(" ") < 0)
+				return_os_error("could not print status");
+		}
+	}
+
+	if (printf("%.*s", (int)nl, line->ptr + no_nl) < 0 ||
+	    fflush(stdout) != 0)
+		return_os_error("could not print status");
+
+	git_str_clear(&progress->onscreen);
+
+	if (line->ptr[line->size - 1] == '\n') {
+		progress->last_update = 0;
+	} else {
+		git_str_put(&progress->onscreen, line->ptr, line->size);
+		progress->last_update = now;
+	}
+
+	git_str_clear(&progress->deferred);
+	return git_str_oom(&progress->onscreen) ? -1 : 0;
+}
+
+static int progress_printf(cli_progress *progress, bool force, const char *fmt, ...)
+	GIT_FORMAT_PRINTF(3, 4);
+
+int progress_printf(cli_progress *progress, bool force, const char *fmt, ...)
+{
+	git_str buf = GIT_BUF_INIT;
+	va_list ap;
+	int error;
+
+	va_start(ap, fmt);
+	error = git_str_vprintf(&buf, fmt, ap);
+	va_end(ap);
+
+	if (error < 0)
+		return error;
+
+	error = progress_write(progress, force, &buf);
+
+	git_str_dispose(&buf);
+	return error;
+}
+
+static int progress_complete(cli_progress *progress)
+{
+	if (progress->deferred.size)
+		progress_write(progress, true, &progress->deferred);
+
+	if (progress->onscreen.size)
+		if (printf("\n") < 0)
+			return_os_error("could not print status");
+
+	git_str_clear(&progress->deferred);
+	git_str_clear(&progress->onscreen);
+	progress->last_update = 0;
+	progress->action_start = 0;
+	progress->action_finish = 0;
+
+	return 0;
+}
+
+GIT_INLINE(int) percent(size_t completed, size_t total)
+{
+	if (total == 0)
+		return (completed == 0) ? 100 : 0;
+
+	return (int)(((double)completed / (double)total) * 100);
+}
+
+int cli_progress_fetch_sideband(const char *str, int len, void *payload)
+{
+	cli_progress *progress = (cli_progress *)payload;
+	size_t remain;
+
+	if (len <= 0)
+		return 0;
+
+	/* Accumulate the sideband data, then print it line-at-a-time. */
+	if (git_str_put(&progress->sideband, str, len) < 0)
+		return -1;
+
+	str = progress->sideband.ptr;
+	remain = progress->sideband.size;
+
+	while (remain) {
+		bool has_nl;
+		size_t line_len = nl_len(&has_nl, str, remain);
+
+		if (!has_nl)
+			break;
+
+		if (line_len < INT_MAX) {
+			int error = progress_printf(progress, true,
+				"remote: %.*s", (int)line_len, str);
+
+			if (error < 0)
+				return error;
+		}
+
+		str += line_len;
+		remain -= line_len;
+	}
+
+	git_str_consume_bytes(&progress->sideband, (progress->sideband.size - remain));
+
+	return 0;
+}
+
+static int fetch_receiving(
+	cli_progress *progress,
+	const git_indexer_progress *stats)
+{
+	char *recv_units[] = { "B", "KiB", "MiB", "GiB", "TiB", NULL };
+	char *rate_units[] = { "B/s", "KiB/s", "MiB/s", "GiB/s", "TiB/s", NULL };
+
+	double now, recv_len, rate, elapsed;
+	size_t recv_unit_idx = 0, rate_unit_idx = 0;
+	bool done = (stats->received_objects == stats->total_objects);
+
+	if (!progress->action_start)
+		progress->action_start = git__timer();
+
+	if (done && progress->action_finish)
+		now = progress->action_finish;
+	else if (done)
+		progress->action_finish = now = git__timer();
+	else
+		now = git__timer();
+
+	if (progress->throughput_update &&
+	    now - progress->throughput_update < THROUGHPUT_UPDATE_TIME) {
+		elapsed = progress->throughput_update -
+		          progress->action_start;
+		recv_len = progress->throughput_bytes;
+	} else {
+		elapsed = now - progress->action_start;
+		recv_len = (double)stats->received_bytes;
+
+		progress->throughput_update = now;
+		progress->throughput_bytes = recv_len;
+	}
+
+	rate = elapsed ? recv_len / elapsed : 0;
+
+	while (recv_len > 1024 && recv_units[recv_unit_idx+1]) {
+		recv_len /= 1024;
+		recv_unit_idx++;
+	}
+
+	while (rate > 1024 && rate_units[rate_unit_idx+1]) {
+		rate /= 1024;
+		rate_unit_idx++;
+	}
+
+	return progress_printf(progress, false,
+		"Receiving objects: %3d%% (%d/%d), %.2f %s | %.2f %s%s\r",
+		percent(stats->received_objects, stats->total_objects),
+		stats->received_objects,
+		stats->total_objects,
+		recv_len, recv_units[recv_unit_idx],
+		rate, rate_units[rate_unit_idx],
+		done ? ", done." : "");
+}
+
+static int fetch_resolving(
+	cli_progress *progress,
+	const git_indexer_progress *stats)
+{
+	bool done = (stats->indexed_deltas == stats->total_deltas);
+
+	return progress_printf(progress, false,
+		"Resolving deltas: %3d%% (%d/%d)%s\r",
+		percent(stats->indexed_deltas, stats->total_deltas),
+		stats->indexed_deltas, stats->total_deltas,
+		done ? ", done." : "");
+}
+
+int cli_progress_fetch_transfer(const git_indexer_progress *stats, void *payload)
+{
+	cli_progress *progress = (cli_progress *)payload;
+	int error = 0;
+
+	switch (progress->action) {
+	case CLI_PROGRESS_NONE:
+		progress->action = CLI_PROGRESS_RECEIVING;
+		/* fall through */
+
+	case CLI_PROGRESS_RECEIVING:
+		if ((error = fetch_receiving(progress, stats)) < 0)
+			break;
+
+		/*
+		 * Upgrade from receiving to resolving; do this after the
+		 * final call to cli_progress_fetch_receiving (above) to
+		 * ensure that we've printed a final "done" string after
+		 * any sideband data.
+		 */
+		if (!stats->indexed_deltas)
+			break;
+
+		progress_complete(progress);
+		progress->action = CLI_PROGRESS_RESOLVING;
+		/* fall through */
+
+	case CLI_PROGRESS_RESOLVING:
+		error = fetch_resolving(progress, stats);
+		break;
+
+	default:
+		/* should not be reached */
+		GIT_ASSERT(!"unexpected progress state");
+	}
+
+	return error;
+}
+
+void cli_progress_checkout(
+	const char *path,
+	size_t completed_steps,
+	size_t total_steps,
+	void *payload)
+{
+	cli_progress *progress = (cli_progress *)payload;
+	bool done = (completed_steps == total_steps);
+
+	GIT_UNUSED(path);
+
+	if (progress->action != CLI_PROGRESS_CHECKING_OUT) {
+		progress_complete(progress);
+		progress->action = CLI_PROGRESS_CHECKING_OUT;
+	}
+
+	progress_printf(progress, false,
+		"Checking out files: %3d%% (%" PRIuZ "/%" PRIuZ ")%s\r",
+		percent(completed_steps, total_steps),
+		completed_steps, total_steps,
+		done ? ", done." : "");
+}
+
+int cli_progress_abort(cli_progress *progress)
+{
+	if (progress->onscreen.size > 0 && printf("\n") < 0)
+	    return_os_error("could not print status");
+
+	return 0;
+}
+
+int cli_progress_finish(cli_progress *progress)
+{
+	int error = progress->action ? progress_complete(progress) : 0;
+
+	progress->action = 0;
+	return error;
+}
+
+void cli_progress_dispose(cli_progress *progress)
+{
+	if (progress == NULL)
+		return;
+
+	git_str_dispose(&progress->sideband);
+	git_str_dispose(&progress->onscreen);
+	git_str_dispose(&progress->deferred);
+
+	memset(progress, 0, sizeof(cli_progress));
+}
diff --git a/src/cli/progress.h b/src/cli/progress.h
new file mode 100644
index 0000000..7a445ec
--- /dev/null
+++ b/src/cli/progress.h
@@ -0,0 +1,117 @@
+/*
+ * Copyright (C) the libgit2 contributors. All rights reserved.
+ *
+ * This file is part of libgit2, distributed under the GNU GPL v2 with
+ * a Linking Exception. For full terms see the included COPYING file.
+ */
+
+#ifndef CLI_progress_h__
+#define CLI_progress_h__
+
+#include <git2.h>
+#include "str.h"
+
+/*
+ * A general purpose set of progress printing functions.  An individual
+ * `cli_progress` object is capable of displaying progress for a single
+ * function, even if that function displays multiple pieces of progress
+ * (like `git_clone`).  `cli_progress_finish` should be called after
+ * any function invocation to re-set state.
+ */
+
+typedef enum {
+	CLI_PROGRESS_NONE,
+	CLI_PROGRESS_RECEIVING,
+	CLI_PROGRESS_RESOLVING,
+	CLI_PROGRESS_CHECKING_OUT
+} cli_progress_t;
+
+typedef struct {
+	cli_progress_t action;
+
+	/* Actions may time themselves (eg fetch) but are not required to */
+	double action_start;
+	double action_finish;
+
+	/* Last console update, avoid too frequent updates. */
+	double last_update;
+
+	/* Accumulators for partial output and deferred updates. */
+	git_str sideband;
+	git_str onscreen;
+	git_str deferred;
+
+	/* Last update about throughput */
+	double throughput_update;
+	double throughput_bytes;
+} cli_progress;
+
+#define CLI_PROGRESS_INIT { 0 }
+
+/**
+ * Prints sideband data from fetch to the console.  Suitable for a
+ * `sideband_progress` callback for `git_fetch_options`.
+ *
+ * @param str The sideband string
+ * @param len The length of the sideband string
+ * @param payload A pointer to the cli_progress
+ * @return 0 on success, -1 on failure
+ */
+extern int cli_progress_fetch_sideband(
+	const char *str,
+	int len,
+	void *payload);
+
+/**
+ * Prints fetch transfer statistics to the console.  Suitable for a
+ * `transfer_progress` callback for `git_fetch_options`.
+ *
+ * @param stats The indexer stats
+ * @param payload A pointer to the cli_progress
+ * @return 0 on success, -1 on failure
+ */
+extern int cli_progress_fetch_transfer(
+	const git_indexer_progress *stats,
+	void *payload);
+
+/**
+ * Prints checkout progress to the console.  Suitable for a
+ * `progress_cb` callback for `git_checkout_options`.
+ *
+ * @param path The path being written
+ * @param completed_steps The completed checkout steps
+ * @param total_steps The total number of checkout steps
+ * @param payload A pointer to the cli_progress
+ */
+extern void cli_progress_checkout(
+	const char *path,
+	size_t completed_steps,
+	size_t total_steps,
+	void *payload);
+
+/**
+ * Stop displaying progress quickly; suitable for stopping an application
+ * quickly.  Does not display any lines that were buffered, just gets the
+ * console back to a sensible place.
+ *
+ * @param progress The progress information
+ * @return 0 on success, -1 on failure
+ */
+extern int cli_progress_abort(cli_progress *progress);
+
+/**
+ * Finishes displaying progress; flushes any buffered output.
+ *
+ * @param progress The progress information
+ * @return 0 on success, -1 on failure
+ */
+extern int cli_progress_finish(cli_progress *progress);
+
+/**
+ * Disposes the progress information.
+ *
+ * @param progress The progress information
+ */
+extern void cli_progress_dispose(cli_progress *progress);
+
+#endif /* CLI_progress_h__ */
diff --git a/src/cli/sighandler.h b/src/cli/sighandler.h
new file mode 100644
index 0000000..877223e
--- /dev/null
+++ b/src/cli/sighandler.h
@@ -0,0 +1,20 @@
+/*
+ * Copyright (C) the libgit2 contributors. All rights reserved.
+ *
+ * This file is part of libgit2, distributed under the GNU GPL v2 with
+ * a Linking Exception. For full terms see the included COPYING file.
+ */
+
+#ifndef CLI_sighandler_h__
+#define CLI_sighandler_h__
+
+/**
+ * Sets up a signal handler that will run when the process is interrupted
+ * (via SIGINT on POSIX or Control-C or Control-Break on Windows).
+ *
+ * @param handler The function to run on interrupt
+ * @return 0 on success, -1 on failure
+ */
+int cli_sighandler_set_interrupt(void (*handler)(void));
+
+#endif /* CLI_sighandler_h__ */
diff --git a/src/cli/unix/sighandler.c b/src/cli/unix/sighandler.c
new file mode 100644
index 0000000..6b4982d
--- /dev/null
+++ b/src/cli/unix/sighandler.c
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) the libgit2 contributors. All rights reserved.
+ *
+ * This file is part of libgit2, distributed under the GNU GPL v2 with
+ * a Linking Exception. For full terms see the included COPYING file.
+ */
+
+#include <stdint.h>
+#include <signal.h>
+#include "git2_util.h"
+#include "cli.h"
+
+static void (*interrupt_handler)(void) = NULL;
+
+static void interrupt_proxy(int signal)
+{
+	GIT_UNUSED(signal);
+	interrupt_handler();
+}
+
+int cli_sighandler_set_interrupt(void (*handler)(void))
+{
+	void (*result)(int);
+
+	if ((interrupt_handler = handler) != NULL)
+		result = signal(SIGINT, interrupt_proxy);
+	else
+		result = signal(SIGINT, SIG_DFL);
+
+	if (result == SIG_ERR) {
+		git_error_set(GIT_ERROR_OS, "could not set signal handler");
+		return -1;
+	}
+
+	return 0;
+}
diff --git a/src/cli/win32/sighandler.c b/src/cli/win32/sighandler.c
new file mode 100644
index 0000000..cc0b646
--- /dev/null
+++ b/src/cli/win32/sighandler.c
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) the libgit2 contributors. All rights reserved.
+ *
+ * This file is part of libgit2, distributed under the GNU GPL v2 with
+ * a Linking Exception. For full terms see the included COPYING file.
+ */
+
+#include "git2_util.h"
+#include <windows.h>
+
+#include "cli.h"
+
+static void (*interrupt_handler)(void) = NULL;
+
+static BOOL WINAPI interrupt_proxy(DWORD signal)
+{
+	GIT_UNUSED(signal);
+	interrupt_handler();
+	return TRUE;
+}
+
+int cli_sighandler_set_interrupt(void (*handler)(void))
+{
+	BOOL result;
+
+	if ((interrupt_handler = handler) != NULL)
+		result = SetConsoleCtrlHandler(interrupt_proxy, FALSE);
+	else
+		result = SetConsoleCtrlHandler(NULL, FALSE);
+
+	if (!result) {
+		git_error_set(GIT_ERROR_OS, "could not set control control handler");
+		return -1;
+	}
+
+	return 0;
+}
diff --git a/src/libgit2/commit_graph.c b/src/libgit2/commit_graph.c
index 70e866b..10947ac 100644
--- a/src/libgit2/commit_graph.c
+++ b/src/libgit2/commit_graph.c
@@ -138,7 +138,7 @@ static int commit_graph_parse_oid_lookup(
 		struct git_commit_graph_chunk *chunk_oid_lookup)
 {
 	uint32_t i;
-	git_oid *oid, *prev_oid, zero_oid = {{0}};
+	unsigned char *oid, *prev_oid, zero_oid[GIT_OID_RAWSZ] = {0};
 
 	if (chunk_oid_lookup->offset == 0)
 		return commit_graph_error("missing OID Lookup chunk");
@@ -147,10 +147,10 @@ static int commit_graph_parse_oid_lookup(
 	if (chunk_oid_lookup->length != file->num_commits * GIT_OID_RAWSZ)
 		return commit_graph_error("OID Lookup chunk has wrong length");
 
-	file->oid_lookup = oid = (git_oid *)(data + chunk_oid_lookup->offset);
-	prev_oid = &zero_oid;
-	for (i = 0; i < file->num_commits; ++i, ++oid) {
-		if (git_oid_cmp(prev_oid, oid) >= 0)
+	file->oid_lookup = oid = (unsigned char *)(data + chunk_oid_lookup->offset);
+	prev_oid = zero_oid;
+	for (i = 0; i < file->num_commits; ++i, oid += GIT_OID_RAWSZ) {
+		if (git_oid_raw_cmp(prev_oid, oid) >= 0)
 			return commit_graph_error("OID Lookup index is non-monotonic");
 		prev_oid = oid;
 	}
@@ -437,7 +437,7 @@ static int git_commit_graph_entry_get_byindex(
 	}
 
 	commit_data = file->commit_data + pos * (GIT_OID_RAWSZ + 4 * sizeof(uint32_t));
-	git_oid_cpy(&e->tree_oid, (const git_oid *)commit_data);
+	git_oid_fromraw(&e->tree_oid, commit_data);
 	e->parent_indices[0] = ntohl(*((uint32_t *)(commit_data + GIT_OID_RAWSZ)));
 	e->parent_indices[1] = ntohl(
 			*((uint32_t *)(commit_data + GIT_OID_RAWSZ + sizeof(uint32_t))));
@@ -470,7 +470,8 @@ static int git_commit_graph_entry_get_byindex(
 			e->parent_count++;
 		}
 	}
-	git_oid_cpy(&e->sha1, &file->oid_lookup[pos]);
+
+	git_oid_fromraw(&e->sha1, &file->oid_lookup[pos * GIT_OID_RAWSZ]);
 	return 0;
 }
 
@@ -514,7 +515,7 @@ int git_commit_graph_entry_find(
 {
 	int pos, found = 0;
 	uint32_t hi, lo;
-	const git_oid *current = NULL;
+	const unsigned char *current = NULL;
 
 	GIT_ASSERT_ARG(e);
 	GIT_ASSERT_ARG(file);
@@ -528,26 +529,25 @@ int git_commit_graph_entry_find(
 	if (pos >= 0) {
 		/* An object matching exactly the oid was found */
 		found = 1;
-		current = file->oid_lookup + pos;
+		current = file->oid_lookup + (pos * GIT_OID_RAWSZ);
 	} else {
 		/* No object was found */
 		/* pos refers to the object with the "closest" oid to short_oid */
 		pos = -1 - pos;
 		if (pos < (int)file->num_commits) {
-			current = file->oid_lookup + pos;
+			current = file->oid_lookup + (pos * GIT_OID_RAWSZ);
 
-			if (!git_oid_ncmp(short_oid, current, len))
+			if (!git_oid_raw_ncmp(short_oid->id, current, len))
 				found = 1;
 		}
 	}
 
 	if (found && len != GIT_OID_HEXSZ && pos + 1 < (int)file->num_commits) {
 		/* Check for ambiguousity */
-		const git_oid *next = current + 1;
+		const unsigned char *next = current + GIT_OID_RAWSZ;
 
-		if (!git_oid_ncmp(short_oid, next, len)) {
+		if (!git_oid_raw_ncmp(short_oid->id, next, len))
 			found = 2;
-		}
 	}
 
 	if (!found)
@@ -1019,7 +1019,9 @@ static int commit_graph_write(
 	/* Fill the OID Lookup table. */
 	git_vector_foreach (&w->commits, i, packed_commit) {
 		error = git_str_put(&oid_lookup,
-			(const char *)&packed_commit->sha1, sizeof(git_oid));
+			(const char *)&packed_commit->sha1.id,
+			GIT_OID_RAWSZ);
+
 		if (error < 0)
 			goto cleanup;
 	}
@@ -1034,8 +1036,9 @@ static int commit_graph_write(
 		unsigned int parentcount = (unsigned int)git_array_size(packed_commit->parents);
 
 		error = git_str_put(&commit_data,
-				(const char *)&packed_commit->tree_oid,
-				sizeof(git_oid));
+			(const char *)&packed_commit->tree_oid.id,
+			GIT_OID_RAWSZ);
+
 		if (error < 0)
 			goto cleanup;
 
diff --git a/src/libgit2/commit_graph.h b/src/libgit2/commit_graph.h
index 45e125b..b78ab81 100644
--- a/src/libgit2/commit_graph.h
+++ b/src/libgit2/commit_graph.h
@@ -36,7 +36,7 @@ typedef struct git_commit_graph_file {
 	uint32_t num_commits;
 
 	/* The OID Lookup table. */
-	git_oid *oid_lookup;
+	unsigned char *oid_lookup;
 
 	/*
 	 * The Commit Data table. Each entry contains the OID of the commit followed
diff --git a/src/libgit2/index.c b/src/libgit2/index.c
index aa97c64..f44c507 100644
--- a/src/libgit2/index.c
+++ b/src/libgit2/index.c
@@ -74,7 +74,7 @@ struct entry_short {
 	uint32_t uid;
 	uint32_t gid;
 	uint32_t file_size;
-	git_oid oid;
+	unsigned char oid[GIT_OID_RAWSZ];
 	uint16_t flags;
 	char path[1]; /* arbitrary length */
 };
@@ -88,7 +88,7 @@ struct entry_long {
 	uint32_t uid;
 	uint32_t gid;
 	uint32_t file_size;
-	git_oid oid;
+	unsigned char oid[GIT_OID_RAWSZ];
 	uint16_t flags;
 	uint16_t flags_extended;
 	char path[1]; /* arbitrary length */
@@ -2480,9 +2480,11 @@ static int read_entry(
 	entry.uid = ntohl(source.uid);
 	entry.gid = ntohl(source.gid);
 	entry.file_size = ntohl(source.file_size);
-	git_oid_cpy(&entry.id, &source.oid);
 	entry.flags = ntohs(source.flags);
 
+	if (git_oid_fromraw(&entry.id, source.oid) < 0)
+		return -1;
+
 	if (entry.flags & GIT_INDEX_ENTRY_EXTENDED) {
 		uint16_t flags_raw;
 		size_t flags_offset;
@@ -2803,9 +2805,7 @@ static int write_disk_entry(git_filebuf *file, git_index_entry *entry, const cha
 	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->id);
-
+	git_oid_raw_cpy(ondisk.oid, entry->id.id);
 	ondisk.flags = htons(entry->flags);
 
 	if (entry->flags & GIT_INDEX_ENTRY_EXTENDED) {
diff --git a/src/libgit2/indexer.c b/src/libgit2/indexer.c
index f9a32e7..afb9ce8 100644
--- a/src/libgit2/indexer.c
+++ b/src/libgit2/indexer.c
@@ -385,7 +385,7 @@ static int check_object_connectivity(git_indexer *idx, const git_rawobj *obj)
 			size_t i;
 
 			git_array_foreach(tree->entries, i, entry)
-				if (add_expected_oid(idx, entry->oid) < 0)
+				if (add_expected_oid(idx, &entry->oid) < 0)
 					goto out;
 
 			break;
@@ -1269,7 +1269,7 @@ int git_indexer_commit(git_indexer *idx, git_indexer_progress *stats)
 
 	/* Write out the object names (SHA-1 hashes) */
 	git_vector_foreach(&idx->objects, i, entry) {
-		git_filebuf_write(&index_file, &entry->oid, sizeof(git_oid));
+		git_filebuf_write(&index_file, &entry->oid.id, GIT_OID_RAWSZ);
 	}
 
 	/* Write out the CRC32 values */
diff --git a/src/libgit2/iterator.c b/src/libgit2/iterator.c
index 15bb63d..bc6f766 100644
--- a/src/libgit2/iterator.c
+++ b/src/libgit2/iterator.c
@@ -613,7 +613,7 @@ GIT_INLINE(int) tree_iterator_frame_push_neighbors(
 			break;
 
 		if ((error = git_tree_lookup(&tree,
-			iter->base.repo, entry->tree_entry->oid)) < 0)
+			iter->base.repo, &entry->tree_entry->oid)) < 0)
 			break;
 
 		if (git_vector_insert(&parent_frame->similar_trees, tree) < 0)
@@ -659,7 +659,7 @@ GIT_INLINE(int) tree_iterator_frame_push(
 	int error;
 
 	if ((error = git_tree_lookup(&tree,
-			iter->base.repo, entry->tree_entry->oid)) < 0 ||
+			iter->base.repo, &entry->tree_entry->oid)) < 0 ||
 		(error = tree_iterator_frame_init(iter, tree, entry)) < 0)
 		goto done;
 
@@ -740,7 +740,7 @@ static void tree_iterator_set_current(
 
 	iter->entry.mode = tree_entry->attr;
 	iter->entry.path = iter->entry_path.ptr;
-	git_oid_cpy(&iter->entry.id, tree_entry->oid);
+	git_oid_cpy(&iter->entry.id, &tree_entry->oid);
 }
 
 static int tree_iterator_advance(const git_index_entry **out, git_iterator *i)
diff --git a/src/libgit2/midx.c b/src/libgit2/midx.c
index 0092601..67eab9a 100644
--- a/src/libgit2/midx.c
+++ b/src/libgit2/midx.c
@@ -115,7 +115,7 @@ static int midx_parse_oid_lookup(
 		struct git_midx_chunk *chunk_oid_lookup)
 {
 	uint32_t i;
-	git_oid *oid, *prev_oid, zero_oid = {{0}};
+	unsigned char *oid, *prev_oid, zero_oid[GIT_OID_RAWSZ] = {0};
 
 	if (chunk_oid_lookup->offset == 0)
 		return midx_error("missing OID Lookup chunk");
@@ -124,10 +124,10 @@ static int midx_parse_oid_lookup(
 	if (chunk_oid_lookup->length != idx->num_objects * GIT_OID_RAWSZ)
 		return midx_error("OID Lookup chunk has wrong length");
 
-	idx->oid_lookup = oid = (git_oid *)(data + chunk_oid_lookup->offset);
-	prev_oid = &zero_oid;
-	for (i = 0; i < idx->num_objects; ++i, ++oid) {
-		if (git_oid_cmp(prev_oid, oid) >= 0)
+	idx->oid_lookup = oid = (unsigned char *)(data + chunk_oid_lookup->offset);
+	prev_oid = zero_oid;
+	for (i = 0; i < idx->num_objects; ++i, oid += GIT_OID_RAWSZ) {
+		if (git_oid_raw_cmp(prev_oid, oid) >= 0)
 			return midx_error("OID Lookup index is non-monotonic");
 		prev_oid = oid;
 	}
@@ -179,7 +179,6 @@ int git_midx_parse(
 	uint32_t i;
 	off64_t last_chunk_offset, chunk_offset, trailer_offset;
 	size_t checksum_size;
-	unsigned char checksum[GIT_HASH_SHA1_SIZE];
 	int error;
 	struct git_midx_chunk chunk_packfile_names = {0},
 					 chunk_oid_fanout = {0},
@@ -217,11 +216,6 @@ int git_midx_parse(
 		return midx_error("wrong index size");
 	memcpy(idx->checksum, data + trailer_offset, checksum_size);
 
-	if (git_hash_buf(checksum, data, (size_t)trailer_offset, GIT_HASH_ALGORITHM_SHA1) < 0)
-		return midx_error("could not calculate signature");
-	if (memcmp(checksum, idx->checksum, checksum_size) != 0)
-		return midx_error("index signature mismatch");
-
 	chunk_hdr = data + sizeof(struct git_midx_header);
 	last_chunk = NULL;
 	for (i = 0; i < hdr->chunks; ++i, chunk_hdr += 12) {
@@ -389,7 +383,7 @@ int git_midx_entry_find(
 	int pos, found = 0;
 	size_t pack_index;
 	uint32_t hi, lo;
-	const git_oid *current = NULL;
+	unsigned char *current = NULL;
 	const unsigned char *object_offset;
 	off64_t offset;
 
@@ -403,26 +397,25 @@ int git_midx_entry_find(
 	if (pos >= 0) {
 		/* An object matching exactly the oid was found */
 		found = 1;
-		current = idx->oid_lookup + pos;
+		current = idx->oid_lookup + (pos * GIT_OID_RAWSZ);
 	} else {
 		/* No object was found */
 		/* pos refers to the object with the "closest" oid to short_oid */
 		pos = -1 - pos;
 		if (pos < (int)idx->num_objects) {
-			current = idx->oid_lookup + pos;
+			current = idx->oid_lookup + (pos * GIT_OID_RAWSZ);
 
-			if (!git_oid_ncmp(short_oid, current, len))
+			if (!git_oid_raw_ncmp(short_oid->id, current, len))
 				found = 1;
 		}
 	}
 
 	if (found && len != GIT_OID_HEXSZ && pos + 1 < (int)idx->num_objects) {
 		/* Check for ambiguousity */
-		const git_oid *next = current + 1;
+		const unsigned char *next = current + GIT_OID_RAWSZ;
 
-		if (!git_oid_ncmp(short_oid, next, len)) {
+		if (!git_oid_raw_ncmp(short_oid->id, next, len))
 			found = 2;
-		}
 	}
 
 	if (!found)
@@ -432,8 +425,8 @@ int git_midx_entry_find(
 
 	object_offset = idx->object_offsets + pos * 8;
 	offset = ntohl(*((uint32_t *)(object_offset + 4)));
-	if (offset & 0x80000000) {
-		uint32_t object_large_offsets_pos = offset & 0x7fffffff;
+	if (idx->object_large_offsets && offset & 0x80000000) {
+		uint32_t object_large_offsets_pos = (uint32_t) (offset ^ 0x80000000);
 		const unsigned char *object_large_offsets_index = idx->object_large_offsets;
 
 		/* Make sure we're not being sent out of bounds */
@@ -450,7 +443,7 @@ int git_midx_entry_find(
 		return midx_error("invalid index into the packfile names table");
 	e->pack_index = pack_index;
 	e->offset = offset;
-	git_oid_cpy(&e->sha1, current);
+	git_oid_fromraw(&e->sha1, current);
 	return 0;
 }
 
@@ -459,13 +452,17 @@ int git_midx_foreach_entry(
 		git_odb_foreach_cb cb,
 		void *data)
 {
+	git_oid oid;
 	size_t i;
 	int error;
 
 	GIT_ASSERT_ARG(idx);
 
 	for (i = 0; i < idx->num_objects; ++i) {
-		if ((error = cb(&idx->oid_lookup[i], data)) != 0)
+		if ((error = git_oid_fromraw(&oid, &idx->oid_lookup[i * GIT_OID_RAWSZ])) < 0)
+			return error;
+
+		if ((error = cb(&oid, data)) != 0)
 			return git_error_set_after_callback(error);
 	}
 
@@ -751,7 +748,7 @@ static int midx_write(
 
 	/* Fill the OID Lookup table. */
 	git_vector_foreach (&object_entries, i, entry) {
-		error = git_str_put(&oid_lookup, (const char *)&entry->sha1, sizeof(entry->sha1));
+		error = git_str_put(&oid_lookup, (char *)&entry->sha1.id, GIT_OID_RAWSZ);
 		if (error < 0)
 			goto cleanup;
 	}
diff --git a/src/libgit2/midx.h b/src/libgit2/midx.h
index 7dd851b..bcb0d9a 100644
--- a/src/libgit2/midx.h
+++ b/src/libgit2/midx.h
@@ -17,6 +17,7 @@
 #include "map.h"
 #include "mwindow.h"
 #include "odb.h"
+#include "oid.h"
 
 /*
  * A multi-pack-index file.
@@ -40,7 +41,7 @@ typedef struct git_midx_file {
 	uint32_t num_objects;
 
 	/* The OID Lookup table. */
-	git_oid *oid_lookup;
+	unsigned char *oid_lookup;
 
 	/* The Object Offsets table. Each entry has two 4-byte fields with the pack index and the offset. */
 	const unsigned char *object_offsets;
diff --git a/src/libgit2/oid.c b/src/libgit2/oid.c
index 19061e8..fb92174 100644
--- a/src/libgit2/oid.c
+++ b/src/libgit2/oid.c
@@ -187,8 +187,7 @@ int git_oid_fromraw(git_oid *out, const unsigned char *raw)
 
 int git_oid_cpy(git_oid *out, const git_oid *src)
 {
-	memcpy(out->id, src->id, sizeof(out->id));
-	return 0;
+	return git_oid_raw_cpy(out->id, src->id);
 }
 
 int git_oid_cmp(const git_oid *a, const git_oid *b)
@@ -203,25 +202,7 @@ int git_oid_equal(const git_oid *a, const git_oid *b)
 
 int git_oid_ncmp(const git_oid *oid_a, const git_oid *oid_b, size_t len)
 {
-	const unsigned char *a = oid_a->id;
-	const unsigned char *b = oid_b->id;
-
-	if (len > GIT_OID_HEXSZ)
-		len = GIT_OID_HEXSZ;
-
-	while (len > 1) {
-		if (*a != *b)
-			return 1;
-		a++;
-		b++;
-		len -= 2;
-	};
-
-	if (len)
-		if ((*a ^ *b) & 0xf0)
-			return 1;
-
-	return 0;
+	return git_oid_raw_ncmp(oid_a->id, oid_b->id, len);
 }
 
 int git_oid_strcmp(const git_oid *oid_a, const char *str)
diff --git a/src/libgit2/oid.h b/src/libgit2/oid.h
index 5baec33..abae9a4 100644
--- a/src/libgit2/oid.h
+++ b/src/libgit2/oid.h
@@ -25,11 +25,44 @@ extern const git_oid git_oid__empty_tree_sha1;
  */
 char *git_oid_allocfmt(const git_oid *id);
 
-GIT_INLINE(int) git_oid__hashcmp(const unsigned char *sha1, const unsigned char *sha2)
+GIT_INLINE(int) git_oid_raw_ncmp(
+	const unsigned char *sha1,
+	const unsigned char *sha2,
+	size_t len)
+{
+	if (len > GIT_OID_HEXSZ)
+		len = GIT_OID_HEXSZ;
+
+	while (len > 1) {
+		if (*sha1 != *sha2)
+			return 1;
+		sha1++;
+		sha2++;
+		len -= 2;
+	};
+
+	if (len)
+		if ((*sha1 ^ *sha2) & 0xf0)
+			return 1;
+
+	return 0;
+}
+
+GIT_INLINE(int) git_oid_raw_cmp(
+	const unsigned char *sha1,
+	const unsigned char *sha2)
 {
 	return memcmp(sha1, sha2, GIT_OID_RAWSZ);
 }
 
+GIT_INLINE(int) git_oid_raw_cpy(
+	unsigned char *dst,
+	const unsigned char *src)
+{
+	memcpy(dst, src, GIT_OID_RAWSZ);
+	return 0;
+}
+
 /*
  * Compare two oid structures.
  *
@@ -39,7 +72,7 @@ GIT_INLINE(int) git_oid__hashcmp(const unsigned char *sha1, const unsigned char 
  */
 GIT_INLINE(int) git_oid__cmp(const git_oid *a, const git_oid *b)
 {
-	return git_oid__hashcmp(a->id, b->id);
+	return git_oid_raw_cmp(a->id, b->id);
 }
 
 GIT_INLINE(void) git_oid__cpy_prefix(
diff --git a/src/libgit2/oidmap.c b/src/libgit2/oidmap.c
index 0ae8bf3..eaf9fa0 100644
--- a/src/libgit2/oidmap.c
+++ b/src/libgit2/oidmap.c
@@ -19,7 +19,7 @@ __KHASH_TYPE(oid, const git_oid *, void *)
 GIT_INLINE(khint_t) git_oidmap_hash(const git_oid *oid)
 {
 	khint_t h;
-	memcpy(&h, oid, sizeof(khint_t));
+	memcpy(&h, oid->id, sizeof(khint_t));
 	return h;
 }
 
diff --git a/src/libgit2/pack.c b/src/libgit2/pack.c
index 5c0cba7..16fe378 100644
--- a/src/libgit2/pack.c
+++ b/src/libgit2/pack.c
@@ -1001,13 +1001,14 @@ int get_delta_base(
 		base_offset = delta_obj_offset - unsigned_base_offset;
 		*curpos += used;
 	} else if (type == GIT_OBJECT_REF_DELTA) {
+		git_oid base_oid;
+		git_oid_fromraw(&base_oid, base_info);
+
 		/* If we have the cooperative cache, search in it first */
 		if (p->has_cache) {
 			struct git_pack_entry *entry;
-			git_oid oid;
 
-			git_oid_fromraw(&oid, base_info);
-			if ((entry = git_oidmap_get(p->idx_cache, &oid)) != NULL) {
+			if ((entry = git_oidmap_get(p->idx_cache, &base_oid)) != NULL) {
 				if (entry->offset == 0)
 					return packfile_error("delta offset is zero");
 
@@ -1024,7 +1025,7 @@ int get_delta_base(
 		}
 
 		/* The base entry _must_ be in the same pack */
-		if (pack_entry_find_offset(&base_offset, &unused, p, (git_oid *)base_info, GIT_OID_HEXSZ) < 0)
+		if (pack_entry_find_offset(&base_offset, &unused, p, &base_oid, GIT_OID_HEXSZ) < 0)
 			return packfile_error("base entry delta is not in the same pack");
 		*curpos += 20;
 	} else
@@ -1082,7 +1083,7 @@ static int packfile_open_locked(struct git_pack_file *p)
 {
 	struct stat st;
 	struct git_pack_header hdr;
-	git_oid sha1;
+	unsigned char sha1[GIT_OID_RAWSZ];
 	unsigned char *idx_sha1;
 
 	if (pack_index_open_locked(p) < 0)
@@ -1130,12 +1131,12 @@ static int packfile_open_locked(struct git_pack_file *p)
 
 	/* Verify the pack matches its index. */
 	if (p->num_objects != ntohl(hdr.hdr_entries) ||
-		p_pread(p->mwf.fd, sha1.id, GIT_OID_RAWSZ, p->mwf.size - GIT_OID_RAWSZ) < 0)
+	    p_pread(p->mwf.fd, sha1, GIT_OID_RAWSZ, p->mwf.size - GIT_OID_RAWSZ) < 0)
 		goto cleanup;
 
 	idx_sha1 = ((unsigned char *)p->index_map.data) + p->index_map.len - 40;
 
-	if (git_oid__cmp(&sha1, (git_oid *)idx_sha1) != 0)
+	if (git_oid_raw_cmp(sha1, idx_sha1) != 0)
 		goto cleanup;
 
 	if (git_mwindow_file_register(&p->mwf) < 0)
@@ -1340,10 +1341,14 @@ int git_pack_foreach_entry(
 		}
 
 		git_vector_free(&offsets);
-		p->oids = (git_oid **)git_vector_detach(NULL, NULL, &oids);
+		p->oids = (unsigned char **)git_vector_detach(NULL, NULL, &oids);
 	}
 
-	/* We need to copy the OIDs to another array before we relinquish the lock to avoid races. */
+	/*
+	 * We need to copy the OIDs to another array before we
+	 * relinquish the lock to avoid races.  We can also take
+	 * this opportunity to put them into normal form.
+	 */
 	git_array_init_to_size(oids, p->num_objects);
 	if (!oids.ptr) {
 		git_mutex_unlock(&p->lock);
@@ -1357,7 +1362,7 @@ int git_pack_foreach_entry(
 			git_array_clear(oids);
 			GIT_ERROR_CHECK_ALLOC(oid);
 		}
-		git_oid_cpy(oid, p->oids[i]);
+		git_oid_fromraw(oid, p->oids[i]);
 	}
 
 	git_mutex_unlock(&p->lock);
@@ -1380,7 +1385,7 @@ int git_pack_foreach_entry_offset(
 {
 	const unsigned char *index;
 	off64_t current_offset;
-	const git_oid *current_oid;
+	git_oid current_oid;
 	uint32_t i;
 	int error = 0;
 
@@ -1422,8 +1427,9 @@ int git_pack_foreach_entry_offset(
 				current_offset = (((off64_t)ntohl(*((uint32_t *)(large_offset_ptr + 0)))) << 32) |
 						ntohl(*((uint32_t *)(large_offset_ptr + 4)));
 			}
-			current_oid = (const git_oid *)(index + 20 * i);
-			if ((error = cb(current_oid, current_offset, data)) != 0) {
+
+			git_oid_fromraw(&current_oid, (index + 20 * i));
+			if ((error = cb(&current_oid, current_offset, data)) != 0) {
 				error = git_error_set_after_callback(error);
 				goto cleanup;
 			}
@@ -1431,8 +1437,8 @@ int git_pack_foreach_entry_offset(
 	} else {
 		for (i = 0; i < p->num_objects; i++) {
 			current_offset = ntohl(*(const uint32_t *)(index + 24 * i));
-			current_oid = (const git_oid *)(index + 24 * i + 4);
-			if ((error = cb(current_oid, current_offset, data)) != 0) {
+			git_oid_fromraw(&current_oid, (index + 24 * i + 4));
+			if ((error = cb(&current_oid, current_offset, data)) != 0) {
 				error = git_error_set_after_callback(error);
 				goto cleanup;
 			}
@@ -1451,7 +1457,7 @@ int git_pack__lookup_sha1(const void *oid_lookup_table, size_t stride, unsigned 
 
 	while (lo < hi) {
 		unsigned mi = (lo + hi) / 2;
-		int cmp = git_oid__hashcmp(base + mi * stride, oid_prefix);
+		int cmp = git_oid_raw_cmp(base + mi * stride, oid_prefix);
 
 		if (!cmp)
 			return mi;
@@ -1530,7 +1536,7 @@ static int pack_entry_find_offset(
 		if (pos < (int)p->num_objects) {
 			current = index + pos * stride;
 
-			if (!git_oid_ncmp(short_oid, (const git_oid *)current, len))
+			if (!git_oid_raw_ncmp(short_oid->id, current, len))
 				found = 1;
 		}
 	}
@@ -1539,7 +1545,7 @@ static int pack_entry_find_offset(
 		/* Check for ambiguousity */
 		const unsigned char *next = current + stride;
 
-		if (!git_oid_ncmp(short_oid, (const git_oid *)next, len)) {
+		if (!git_oid_raw_ncmp(short_oid->id, next, len)) {
 			found = 2;
 		}
 	}
diff --git a/src/libgit2/pack.h b/src/libgit2/pack.h
index bf279c6..f87249b 100644
--- a/src/libgit2/pack.h
+++ b/src/libgit2/pack.h
@@ -19,6 +19,7 @@
 #include "offmap.h"
 #include "oidmap.h"
 #include "zstream.h"
+#include "oid.h"
 
 /**
  * Function type for callbacks from git_pack_foreach_entry_offset.
@@ -104,7 +105,7 @@ struct git_pack_file {
 	git_time_t mtime;
 	unsigned pack_local:1, pack_keep:1, has_cache:1;
 	git_oidmap *idx_cache;
-	git_oid **oids;
+	unsigned char **oids;
 
 	git_pack_cache bases; /* delta base cache */
 
diff --git a/src/libgit2/refdb_fs.c b/src/libgit2/refdb_fs.c
index ef85016..0f49b16 100644
--- a/src/libgit2/refdb_fs.c
+++ b/src/libgit2/refdb_fs.c
@@ -740,7 +740,7 @@ static int packed_lookup(
 			return 0;
 		}
 	}
-	return GIT_ENOTFOUND;
+	return ref_error_notfound(ref_name);
 
 parse_failed:
 	git_error_set(GIT_ERROR_REFERENCE, "corrupted packed references file");
diff --git a/src/libgit2/remote.c b/src/libgit2/remote.c
index 1a79faa..3d05937 100644
--- a/src/libgit2/remote.c
+++ b/src/libgit2/remote.c
@@ -1830,7 +1830,7 @@ static int update_one_tip(
 	}
 
 	if (error == GIT_ENOTFOUND) {
-		memset(&old, 0, GIT_OID_RAWSZ);
+		memset(&old, 0, sizeof(git_oid));
 		error = 0;
 
 		if (autotag && (error = git_vector_insert(update_heads, head)) < 0)
diff --git a/src/libgit2/tree-cache.c b/src/libgit2/tree-cache.c
index 0977c92..cd69e7b 100644
--- a/src/libgit2/tree-cache.c
+++ b/src/libgit2/tree-cache.c
@@ -263,7 +263,7 @@ static void write_tree(git_str *out, git_tree_cache *tree)
 	git_str_printf(out, "%s%c%"PRIdZ" %"PRIuZ"\n", tree->name, 0, tree->entry_count, tree->children_count);
 
 	if (tree->entry_count != -1)
-		git_str_put(out, (const char *) &tree->oid, GIT_OID_RAWSZ);
+		git_str_put(out, (char *)&tree->oid.id, GIT_OID_RAWSZ);
 
 	for (i = 0; i < tree->children_count; i++)
 		write_tree(out, tree->children[i]);
diff --git a/src/libgit2/tree.c b/src/libgit2/tree.c
index a1545dc..a5371fd 100644
--- a/src/libgit2/tree.c
+++ b/src/libgit2/tree.c
@@ -82,6 +82,7 @@ int git_tree_entry_cmp(const git_tree_entry *e1, const git_tree_entry *e2)
 static git_tree_entry *alloc_entry(const char *filename, size_t filename_len, const git_oid *id)
 {
 	git_tree_entry *entry = NULL;
+	char *filename_ptr;
 	size_t tree_len;
 
 	TREE_ENTRY_CHECK_NAMELEN(filename_len);
@@ -95,21 +96,13 @@ static git_tree_entry *alloc_entry(const char *filename, size_t filename_len, co
 	if (!entry)
 		return NULL;
 
-	{
-		char *filename_ptr;
-		void *id_ptr;
-
-		filename_ptr = ((char *) entry) + sizeof(git_tree_entry);
-		memcpy(filename_ptr, filename, filename_len);
-		entry->filename = filename_ptr;
-
-		id_ptr = filename_ptr + filename_len + 1;
-		git_oid_cpy(id_ptr, id);
-		entry->oid = id_ptr;
-	}
-
+	filename_ptr = ((char *) entry) + sizeof(git_tree_entry);
+	memcpy(filename_ptr, filename, filename_len);
+	entry->filename = filename_ptr;
 	entry->filename_len = (uint16_t)filename_len;
 
+	git_oid_cpy(&entry->oid, id);
+
 	return entry;
 }
 
@@ -231,7 +224,7 @@ int git_tree_entry_dup(git_tree_entry **dest, const git_tree_entry *source)
 
 	GIT_ASSERT_ARG(source);
 
-	cpy = alloc_entry(source->filename, source->filename_len, source->oid);
+	cpy = alloc_entry(source->filename, source->filename_len, &source->oid);
 	if (cpy == NULL)
 		return -1;
 
@@ -269,7 +262,7 @@ const char *git_tree_entry_name(const git_tree_entry *entry)
 const git_oid *git_tree_entry_id(const git_tree_entry *entry)
 {
 	GIT_ASSERT_ARG_WITH_RETVAL(entry, NULL);
-	return entry->oid;
+	return &entry->oid;
 }
 
 git_object_t git_tree_entry_type(const git_tree_entry *entry)
@@ -292,7 +285,7 @@ int git_tree_entry_to_object(
 	GIT_ASSERT_ARG(entry);
 	GIT_ASSERT_ARG(object_out);
 
-	return git_object_lookup(object_out, repo, entry->oid, GIT_OBJECT_ANY);
+	return git_object_lookup(object_out, repo, &entry->oid, GIT_OBJECT_ANY);
 }
 
 static const git_tree_entry *entry_fromname(
@@ -331,7 +324,7 @@ const git_tree_entry *git_tree_entry_byid(
 	GIT_ASSERT_ARG_WITH_RETVAL(tree, NULL);
 
 	git_array_foreach(tree->entries, i, e) {
-		if (memcmp(&e->oid->id, &id->id, sizeof(id->id)) == 0)
+		if (git_oid_equal(&e->oid, id))
 			return e;
 	}
 
@@ -432,7 +425,7 @@ int git_tree__parse_raw(void *_tree, const char *data, size_t size)
 			entry->attr = attr;
 			entry->filename_len = (uint16_t)filename_len;
 			entry->filename = buffer;
-			entry->oid = (git_oid *) ((char *) buffer + filename_len + 1);
+			git_oid_fromraw(&entry->oid, ((unsigned char *) buffer + filename_len + 1));
 		}
 
 		buffer += filename_len + 1;
@@ -536,7 +529,7 @@ static int git_treebuilder__write_with_buffer(
 
 		git_str_printf(buf, "%o ", entry->attr);
 		git_str_put(buf, entry->filename, entry->filename_len + 1);
-		git_str_put(buf, (char *)entry->oid->id, GIT_OID_RAWSZ);
+		git_str_put(buf, (char *)entry->oid.id, GIT_OID_RAWSZ);
 
 		if (git_str_oom(buf)) {
 			error = -1;
@@ -765,7 +758,7 @@ int git_treebuilder_new(
 		git_array_foreach(source->entries, i, entry_src) {
 			if (append_entry(
 				bld, entry_src->filename,
-				entry_src->oid,
+				&entry_src->oid,
 				entry_src->attr,
 				false) < 0)
 				goto on_error;
@@ -798,7 +791,7 @@ int git_treebuilder_insert(
 		return error;
 
 	if ((entry = git_strmap_get(bld->map, filename)) != NULL) {
-		git_oid_cpy((git_oid *) entry->oid, id);
+		git_oid_cpy(&entry->oid, id);
 	} else {
 		entry = alloc_entry(filename, strlen(filename), id);
 		GIT_ERROR_CHECK_ALLOC(entry);
@@ -954,7 +947,7 @@ int git_tree_entry_bypath(
 		return git_tree_entry_dup(entry_out, entry);
 	}
 
-	if (git_tree_lookup(&subtree, root->object.repo, entry->oid) < 0)
+	if (git_tree_lookup(&subtree, root->object.repo, &entry->oid) < 0)
 		return -1;
 
 	error = git_tree_entry_bypath(
@@ -995,7 +988,7 @@ static int tree_walk(
 			git_tree *subtree;
 			size_t path_len = git_str_len(path);
 
-			error = git_tree_lookup(&subtree, tree->object.repo, entry->oid);
+			error = git_tree_lookup(&subtree, tree->object.repo, &entry->oid);
 			if (error < 0)
 				break;
 
diff --git a/src/libgit2/tree.h b/src/libgit2/tree.h
index 6bd9ed6..0dd963f 100644
--- a/src/libgit2/tree.h
+++ b/src/libgit2/tree.h
@@ -19,7 +19,7 @@
 struct git_tree_entry {
 	uint16_t attr;
 	uint16_t filename_len;
-	const git_oid *oid;
+	git_oid oid;
 	const char *filename;
 };
 
diff --git a/tests/libgit2/iterator/tree.c b/tests/libgit2/iterator/tree.c
index 4145c8d..06a920a 100644
--- a/tests/libgit2/iterator/tree.c
+++ b/tests/libgit2/iterator/tree.c
@@ -268,7 +268,7 @@ static void check_tree_entry(
 
 	cl_git_pass(git_iterator_current_tree_entry(&te, i));
 	cl_assert(te);
-	cl_assert(git_oid_streq(te->oid, oid) == 0);
+	cl_assert(git_oid_streq(&te->oid, oid) == 0);
 
 	cl_git_pass(git_iterator_current(&ie, i));
 
diff --git a/tests/libgit2/object/raw/hash.c b/tests/libgit2/object/raw/hash.c
index 5a3e818..8f22fe0 100644
--- a/tests/libgit2/object/raw/hash.c
+++ b/tests/libgit2/object/raw/hash.c
@@ -24,20 +24,23 @@ static char *bye_text = "bye world\n";
 void test_object_raw_hash__hash_by_blocks(void)
 {
 	git_hash_ctx ctx;
+	unsigned char hash[GIT_HASH_SHA1_SIZE];
 	git_oid id1, id2;
 
 	cl_git_pass(git_hash_ctx_init(&ctx, GIT_HASH_ALGORITHM_SHA1));
 
 	/* should already be init'd */
 	cl_git_pass(git_hash_update(&ctx, hello_text, strlen(hello_text)));
-	cl_git_pass(git_hash_final(id2.id, &ctx));
+	cl_git_pass(git_hash_final(hash, &ctx));
+	cl_git_pass(git_oid_fromraw(&id2, hash));
 	cl_git_pass(git_oid_fromstr(&id1, hello_id));
 	cl_assert(git_oid_cmp(&id1, &id2) == 0);
 
 	/* reinit should permit reuse */
 	cl_git_pass(git_hash_init(&ctx));
 	cl_git_pass(git_hash_update(&ctx, bye_text, strlen(bye_text)));
-	cl_git_pass(git_hash_final(id2.id, &ctx));
+	cl_git_pass(git_hash_final(hash, &ctx));
+	cl_git_pass(git_oid_fromraw(&id2, hash));
 	cl_git_pass(git_oid_fromstr(&id1, bye_id));
 	cl_assert(git_oid_cmp(&id1, &id2) == 0);
 
@@ -47,9 +50,11 @@ void test_object_raw_hash__hash_by_blocks(void)
 void test_object_raw_hash__hash_buffer_in_single_call(void)
 {
 	git_oid id1, id2;
+	unsigned char hash[GIT_HASH_SHA1_SIZE];
 
 	cl_git_pass(git_oid_fromstr(&id1, hello_id));
-	git_hash_buf(id2.id, hello_text, strlen(hello_text), GIT_HASH_ALGORITHM_SHA1);
+	cl_git_pass(git_hash_buf(hash, hello_text, strlen(hello_text), GIT_HASH_ALGORITHM_SHA1));
+	cl_git_pass(git_oid_fromraw(&id2, hash));
 	cl_assert(git_oid_cmp(&id1, &id2) == 0);
 }
 
diff --git a/tests/libgit2/object/raw/short.c b/tests/libgit2/object/raw/short.c
index e8d2cf5..cc2b5f6 100644
--- a/tests/libgit2/object/raw/short.c
+++ b/tests/libgit2/object/raw/short.c
@@ -28,12 +28,15 @@ static int insert_sequential_oids(
 	int i, min_len = 0;
 	char numbuf[16];
 	git_oid oid;
+	unsigned char hashbuf[GIT_HASH_SHA1_SIZE];
 	char **oids = git__calloc(n, sizeof(char *));
 	cl_assert(oids != NULL);
 
 	for (i = 0; i < n; ++i) {
 		p_snprintf(numbuf, sizeof(numbuf), "%u", (unsigned int)i);
-		git_hash_buf(oid.id, numbuf, strlen(numbuf), GIT_HASH_ALGORITHM_SHA1);
+		git_hash_buf(hashbuf, numbuf, strlen(numbuf), GIT_HASH_ALGORITHM_SHA1);
+
+		git_oid_fromraw(&oid, hashbuf);
 
 		oids[i] = git__malloc(GIT_OID_HEXSZ + 1);
 		cl_assert(oids[i]);
diff --git a/tests/libgit2/object/tree/parse.c b/tests/libgit2/object/tree/parse.c
index 9d76a74..4e871dc 100644
--- a/tests/libgit2/object/tree/parse.c
+++ b/tests/libgit2/object/tree/parse.c
@@ -40,7 +40,7 @@ static void assert_tree_parses(const char *data, size_t datalen,
 		cl_assert(entry = git_tree_entry_byname(tree, expected->filename));
 		cl_assert_equal_s(expected->filename, entry->filename);
 		cl_assert_equal_i(expected->attr, entry->attr);
-		cl_assert_equal_oid(&oid, entry->oid);
+		cl_assert_equal_oid(&oid, &entry->oid);
 	}
 
 	git_object_free(&tree->object);
diff --git a/tests/libgit2/pack/packbuilder.c b/tests/libgit2/pack/packbuilder.c
index f235798..0889f46 100644
--- a/tests/libgit2/pack/packbuilder.c
+++ b/tests/libgit2/pack/packbuilder.c
@@ -68,7 +68,7 @@ static void seed_packbuilder(void)
 	cl_git_pass(git_revwalk_push_ref(_revwalker, "HEAD"));
 
 	while (git_revwalk_next(&oid, _revwalker) == 0) {
-		o = git__malloc(GIT_OID_RAWSZ);
+		o = git__malloc(sizeof(git_oid));
 		cl_assert(o != NULL);
 		git_oid_cpy(o, &oid);
 		cl_git_pass(git_vector_insert(&_commits, o));
diff --git a/tests/libgit2/refs/revparse.c b/tests/libgit2/refs/revparse.c
index 0bd2ae5..56af3c9 100644
--- a/tests/libgit2/refs/revparse.c
+++ b/tests/libgit2/refs/revparse.c
@@ -399,8 +399,6 @@ void test_refs_revparse__date(void)
 	 * a65fedf HEAD@{1335806603 -0900}: commit:
 	 * be3563a HEAD@{1335806563 -0700}: clone: from /Users/ben/src/libgit2/tests/resour
 	 */
-	test_object("HEAD@{10 years ago}", "be3563ae3f795b2b4353bcce3a527ad0a4f7f644");
-
 	test_object("HEAD@{1 second}", "a65fedf39aefe402d3bb6e24df4d4f5fe4547750");
 	test_object("HEAD@{1 second ago}", "a65fedf39aefe402d3bb6e24df4d4f5fe4547750");
 	test_object("HEAD@{2 days ago}", "a65fedf39aefe402d3bb6e24df4d4f5fe4547750");