oid: give oids a type `git_oid`s now have a type, and we require the oid type when creating the object id from creation functions.
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 3244 3245 3246 3247 3248 3249 3250 3251 3252 3253 3254 3255 3256 3257 3258 3259 3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 3280 3281 3282 3283 3284 3285 3286 3287 3288 3289 3290 3291 3292 3293 3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306 3307 3308 3309 3310 3311 3312 3313 3314 3315 3316 3317 3318 3319 3320 3321 3322 3323 3324 3325 3326 3327 3328 3329 3330 3331 3332 3333 3334 3335 3336 3337 3338 3339 3340 3341 3342 3343 3344 3345 3346 3347 3348 3349 3350 3351 3352 3353 3354 3355 3356 3357 3358 3359 3360 3361 3362 3363 3364 3365 3366 3367 3368 3369 3370 3371 3372 3373 3374 3375 3376 3377 3378 3379 3380 3381 3382 3383 3384 3385 3386 3387 3388 3389 3390 3391 3392 3393 3394 3395 3396 3397 3398 3399 3400 3401 3402 3403 3404 3405 3406 3407 3408 3409 3410 3411 3412 3413 3414 3415 3416 3417 3418 3419 3420 3421 3422 3423 3424 3425 3426 3427 3428 3429 3430 3431 3432 3433 3434 3435 3436 3437 3438 3439 3440 3441 3442 3443 3444 3445 3446 3447 3448 3449 3450 3451 3452 3453 3454 3455 3456 3457 3458 3459 3460 3461 3462 3463 3464 3465 3466 3467 3468 3469 3470 3471 3472 3473 3474 3475 3476 3477 3478 3479 3480 3481 3482 3483 3484 3485 3486 3487 3488 3489 3490 3491 3492 3493 3494 3495 3496 3497 3498 3499 3500 3501 3502 3503 3504 3505 3506 3507 3508 3509 3510 3511 3512 3513 3514 3515 3516 3517 3518 3519 3520 3521 3522 3523 3524 3525 3526 3527 3528 3529 3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546 3547 3548 3549 3550 3551 3552 3553 3554 3555 3556 3557 3558 3559 3560 3561 3562 3563 3564 3565 3566 3567 3568 3569 3570 3571 3572 3573 3574 3575 3576 3577 3578 3579 3580 3581 3582 3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 3612 3613 3614 3615 3616 3617 3618 3619 3620 3621 3622 3623 3624 3625 3626 3627 3628 3629 3630 3631 3632 3633 3634 3635 3636 3637 3638 3639 3640 3641 3642 3643 3644 3645 3646 3647 3648 3649 3650 3651 3652 3653 3654 3655 3656 3657 3658 3659 3660 3661 3662 3663 3664 3665 3666 3667 3668 3669 3670 3671 3672 3673 3674 3675 3676 3677 3678 3679 3680 3681 3682 3683 3684 3685 3686 3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773 3774 3775 3776 3777 3778 3779 3780 3781 3782 3783 3784 3785 3786 3787 3788 3789 3790 3791 3792 3793 3794 3795 3796 3797 3798 3799 3800 3801 3802 3803 3804 3805 3806 3807 3808 3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903 3904 3905 3906 3907 3908 3909 3910 3911 3912 3913 3914 3915 3916 3917 3918 3919 3920 3921 3922 3923 3924 3925 3926 3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954 3955 3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 4023 4024 4025 4026 4027 4028 4029 4030 4031 4032 4033 4034 4035 4036 4037 4038 4039 4040 4041 4042 4043 4044 4045 4046 4047 4048 4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173 4174 4175 4176 4177 4178 4179 4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284 4285 4286 4287 4288 4289 4290 4291 4292 4293 4294 4295 4296 4297 4298 4299 4300 4301 4302 4303 4304 4305 4306 4307 4308 4309 4310 4311 4312 4313 4314 4315 4316 4317 4318 4319 4320 4321 4322 4323 4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368 4369 4370 4371 4372 4373 4374 4375 4376 4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440 4441 4442 4443 4444 4445 4446 4447 4448 4449 4450 4451 4452 4453 4454 4455 4456 4457 4458 4459 4460 4461 4462 4463 4464 4465 4466 4467 4468 4469 4470 4471 4472 4473 4474 4475 4476 4477 4478 4479 4480 4481 4482 4483 4484 4485 4486 4487 4488 4489 4490 4491 4492 4493 4494 4495 4496 4497 4498 4499 4500 4501 4502 4503 4504 4505 4506 4507 4508 4509 4510 4511 4512 4513 4514 4515 4516 4517 4518 4519 4520 4521 4522 4523 4524 4525 4526 4527 4528 4529 4530 4531 4532 4533 4534 4535 4536 4537 4538 4539 4540 4541 4542 4543 4544 4545 4546 4547 4548 4549 4550 4551 4552 4553 4554 4555 4556 4557 4558 4559 4560 4561 4562 4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573 4574 4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593 4594 4595 4596 4597 4598 4599 4600 4601 4602 4603 4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636 4637 4638 4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682 4683 4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706 4707 4708 4709 4710 4711 4712 4713 4714 4715 4716 4717 4718 4719 4720 4721 4722 4723 4724 4725 4726 4727 4728 4729 4730 4731 4732 4733 4734 4735 4736 4737 4738 4739 4740 4741 4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755 4756 4757 4758 4759 4760 4761 4762 4763 4764 4765 4766 4767 4768 4769 4770 4771 4772 4773 4774 4775 4776 4777 4778 4779 4780 4781 4782 4783 4784 4785 4786 4787 4788 4789 4790 4791 4792 4793 4794 4795 4796 4797 4798 4799 4800 4801 4802 4803 4804 4805 4806 4807 4808 4809 4810 4811 4812 4813 4814 4815 4816 4817 4818 4819 4820 4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838 4839 4840 4841 4842 4843 4844 4845 4846 4847 4848 4849 4850 4851 4852 4853 4854 4855 4856 4857 4858 4859 4860 4861 4862 4863 4864 4865 4866 4867 4868 4869 4870 4871 4872 4873 4874 4875 4876 4877 4878 4879 4880 4881 4882 4883 4884 4885 4886 4887 4888 4889 4890 4891 4892 4893 4894 4895 4896 4897 4898 4899 4900 4901 4902 4903 4904 4905 4906 4907 4908 4909 4910 4911 4912 4913 4914 4915 4916 4917 4918 4919 4920 4921 4922 4923 4924 4925 4926 4927 4928 4929 4930 4931 4932 4933 4934 4935 4936 4937 4938 4939 4940 4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951 4952 4953 4954 4955 4956 4957 4958 4959 4960 4961 4962 4963 4964 4965 4966 4967 4968 4969 4970 4971 4972 4973 4974 4975 4976 4977 4978 4979 4980 4981 4982 4983 4984 4985 4986 4987 4988 4989 4990 4991 4992 4993 4994 4995 4996 4997 4998 4999 5000 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010 5011 5012 5013 5014 5015 5016 5017 5018 5019 5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030 5031 5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073 5074 5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262 5263 5264 5265 5266 5267 5268 5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304 5305 5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433 5434 5435 5436 5437 5438 5439 5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496 5497 5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513 5514 5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561 5562 5563 5564 5565 5566 5567 5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667 5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793 5794 5795 5796 5797 5798 5799 5800 5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875 5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011 6012 6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125 6126 6127 6128 6129 6130 6131 6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160 6161 6162 6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224 6225 6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237 6238 6239 6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266 6267 6268 6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439 6440 6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470 6471 6472 6473 6474 6475 6476 6477 6478 6479 6480 6481 6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495 6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513 6514 6515 6516 6517 6518 6519 6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606 6607 6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690 6691 6692 6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716 6717 6718 6719 6720 6721 6722 6723 6724 6725 6726 6727 6728 6729 6730 6731 6732 6733 6734 6735 6736 6737 6738 6739 6740 6741 6742 6743 6744 6745 6746 6747 6748 6749 6750 6751 6752 6753 6754 6755 6756 6757 6758 6759 6760 6761 6762 6763 6764 6765 6766 6767 6768 6769 6770 6771 6772 6773 6774 6775 6776 6777 6778 6779 6780 6781 6782 6783 6784 6785 6786 6787 6788 6789 6790 6791 6792 6793 6794 6795 6796 6797 6798 6799 6800 6801 6802 6803 6804 6805 6806 6807 6808 6809 6810 6811 6812 6813 6814 6815 6816 6817 6818 6819 6820 6821 6822 6823 6824 6825 6826 6827 6828 6829 6830 6831 6832 6833 6834 6835 6836 6837 6838 6839 6840 6841 6842 6843 6844 6845 6846 6847 6848 6849 6850 6851 6852 6853 6854 6855 6856 6857 6858 6859 6860 6861 6862 6863 6864 6865 6866 6867 6868 6869 6870 6871 6872 6873 6874 6875 6876 6877 6878 6879 6880 6881 6882 6883 6884 6885 6886 6887 6888 6889 6890 6891 6892 6893 6894 6895 6896 6897 6898 6899 6900 6901 6902 6903 6904 6905 6906 6907 6908 6909 6910 6911 6912 6913 6914 6915 6916 6917 6918 6919 6920 6921 6922 6923 6924 6925 6926 6927 6928 6929 6930 6931 6932 6933 6934 6935 6936 6937 6938 6939 6940 6941 6942 6943 6944 6945 6946 6947 6948 6949 6950 6951 6952 6953 6954 6955 6956 6957 6958 6959 6960 6961 6962 6963 6964 6965 6966 6967 6968 6969 6970 6971 6972 6973 6974 6975 6976 6977 6978 6979 6980 6981 6982 6983 6984 6985 6986 6987 6988 6989 6990 6991 6992 6993 6994 6995 6996 6997 6998 6999 7000 7001 7002 7003 7004 7005 7006 7007 7008 7009 7010 7011 7012 7013 7014 7015 7016 7017 7018 7019 7020 7021 7022 7023 7024 7025 7026 7027 7028 7029 7030 7031 7032 7033 7034 7035 7036 7037 7038 7039 7040 7041 7042 7043 7044 7045 7046 7047 7048 7049 7050 7051 7052 7053 7054 7055 7056 7057 7058 7059 7060 7061 7062 7063 7064 7065 7066 7067 7068 7069 7070 7071 7072 7073 7074 7075 7076 7077 7078 7079 7080 7081 7082 7083 7084 7085 7086 7087 7088 7089 7090 7091 7092 7093 7094 7095 7096 7097 7098 7099 7100 7101 7102 7103 7104 7105 7106 7107 7108 7109 7110 7111 7112 7113 7114 7115 7116 7117 7118 7119 7120 7121 7122 7123 7124 7125 7126 7127 7128 7129 7130 7131 7132 7133 7134 7135 7136 7137 7138 7139 7140 7141 7142 7143 7144 7145 7146 7147 7148 7149 7150 7151 7152 7153 7154 7155 7156 7157 7158 7159 7160 7161 7162 7163 7164 7165 7166 7167 7168 7169 7170 7171 7172 7173 7174 7175 7176 7177 7178 7179 7180 7181 7182 7183 7184 7185 7186 7187 7188 7189 7190 7191 7192 7193 7194 7195 7196 7197 7198 7199 7200 7201 7202 7203 7204 7205 7206 7207 7208 7209 7210 7211 7212 7213 7214 7215 7216 7217 7218 7219 7220 7221 7222 7223 7224 7225 7226 7227 7228 7229 7230 7231 7232 7233 7234 7235 7236 7237 7238 7239 7240 7241 7242 7243 7244 7245 7246 7247 7248 7249 7250 7251 7252 7253 7254 7255 7256 7257 7258 7259 7260 7261 7262 7263 7264 7265 7266 7267 7268 7269 7270 7271 7272 7273 7274 7275 7276 7277 7278 7279 7280 7281 7282 7283 7284 7285 7286 7287 7288 7289 7290 7291 7292 7293 7294 7295 7296 7297 7298 7299 7300 7301 7302 7303 7304 7305 7306 7307 7308 7309 7310 7311 7312 7313 7314 7315 7316 7317 7318 7319 7320 7321 7322 7323 7324 7325 7326 7327 7328 7329 7330 7331 7332 7333 7334 7335 7336 7337 7338 7339 7340 7341 7342 7343 7344 7345 7346 7347 7348 7349 7350 7351 7352 7353 7354 7355 7356 7357 7358 7359 7360 7361 7362 7363 7364 7365 7366 7367 7368 7369 7370 7371 7372 7373 7374 7375 7376 7377 7378 7379 7380 7381 7382 7383 7384 7385 7386 7387 7388 7389 7390 7391 7392 7393 7394 7395 7396 7397 7398 7399 7400 7401 7402 7403 7404 7405 7406 7407 7408 7409 7410 7411 7412 7413 7414 7415 7416 7417 7418 7419 7420 7421 7422 7423 7424 7425 7426 7427 7428 7429 7430 7431 7432 7433 7434 7435 7436 7437 7438 7439 7440 7441 7442 7443 7444 7445 7446 7447 7448 7449 7450 7451 7452 7453 7454 7455 7456 7457 7458 7459 7460 7461 7462 7463 7464 7465 7466 7467 7468 7469 7470 7471 7472 7473 7474 7475 7476 7477 7478 7479 7480 7481 7482 7483 7484 7485 7486 7487 7488 7489 7490 7491 7492 7493 7494 7495 7496 7497 7498 7499 7500 7501 7502 7503 7504 7505 7506 7507 7508 7509 7510 7511 7512 7513 7514 7515 7516 7517 7518 7519 7520 7521 7522 7523 7524 7525 7526 7527 7528 7529 7530 7531 7532 7533 7534 7535 7536 7537 7538 7539 7540 7541 7542 7543 7544 7545 7546 7547 7548 7549 7550 7551 7552 7553 7554 7555 7556 7557 7558 7559 7560 7561 7562 7563 7564 7565 7566 7567 7568 7569 7570 7571 7572 7573 7574 7575 7576 7577 7578 7579 7580 7581 7582 7583 7584 7585 7586 7587 7588 7589 7590 7591 7592 7593 7594 7595 7596 7597 7598 7599 7600 7601 7602 7603 7604 7605 7606 7607 7608 7609 7610 7611 7612 7613 7614 7615 7616 7617 7618 7619 7620 7621 7622 7623 7624 7625 7626 7627 7628 7629 7630 7631 7632 7633 7634 7635 7636 7637 7638 7639 7640 7641 7642 7643 7644 7645 7646 7647 7648 7649 7650 7651 7652 7653 7654 7655 7656 7657 7658 7659 7660 7661 7662 7663 7664 7665 7666 7667 7668 7669 7670 7671 7672 7673 7674 7675 7676 7677 7678 7679 7680 7681 7682 7683 7684 7685 7686 7687 7688 7689 7690 7691 7692 7693 7694 7695 7696 7697 7698 7699 7700 7701 7702 7703 7704 7705 7706 7707 7708 7709 7710 7711 7712 7713 7714 7715 7716 7717 7718 7719 7720 7721 7722 7723 7724 7725 7726 7727 7728 7729 7730 7731 7732 7733 7734 7735 7736 7737 7738 7739 7740 7741 7742 7743 7744 7745 7746 7747 7748 7749 7750 7751 7752 7753 7754 7755 7756 7757 7758 7759 7760 7761 7762 7763 7764 7765 7766 7767 7768 7769 7770 7771 7772 7773 7774 7775 7776 7777 7778 7779 7780 7781 7782 7783 7784 7785 7786 7787 7788 7789 7790 7791 7792 7793 7794 7795 7796 7797 7798 7799 7800 7801 7802 7803 7804 7805 7806 7807 7808 7809 7810 7811 7812 7813 7814 7815 7816 7817 7818 7819 7820 7821 7822 7823 7824 7825 7826 7827 7828 7829 7830 7831 7832 7833 7834 7835 7836 7837 7838 7839 7840 7841 7842 7843 7844 7845 7846 7847 7848 7849 7850 7851 7852 7853 7854 7855 7856 7857 7858 7859 7860 7861 7862 7863 7864 7865 7866 7867 7868 7869 7870 7871 7872 7873 7874 7875 7876 7877 7878 7879 7880 7881 7882 7883 7884 7885 7886 7887 7888 7889 7890 7891 7892 7893 7894 7895 7896 7897 7898 7899 7900 7901 7902 7903 7904 7905 7906 7907 7908 7909 7910 7911 7912 7913 7914 7915 7916 7917 7918 7919 7920 7921 7922 7923 7924 7925 7926 7927 7928 7929 7930 7931 7932 7933 7934 7935 7936 7937 7938 7939 7940 7941 7942 7943 7944 7945 7946 7947 7948 7949 7950 7951 7952 7953 7954 7955 7956 7957 7958 7959 7960 7961 7962 7963 7964 7965 7966 7967 7968 7969 7970 7971 7972 7973 7974 7975 7976 7977 7978 7979 7980 7981 7982 7983 7984 7985 7986 7987 7988 7989 7990 7991 7992 7993 7994 7995 7996 7997 7998 7999 8000 8001 8002 8003 8004 8005 8006 8007 8008 8009 8010 8011 8012 8013 8014 8015 8016 8017 8018 8019 8020 8021 8022 8023 8024 8025 8026 8027 8028 8029 8030 8031 8032 8033 8034 8035 8036 8037 8038 8039 8040 8041 8042 8043 8044 8045 8046 8047 8048 8049 8050 8051 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 8083 8084 8085 8086 8087 8088 8089 8090 8091 8092 8093 8094 8095 8096 8097 8098 8099 8100 8101 8102 8103 8104 8105 8106 8107 8108 8109 8110 8111 8112 8113 8114 8115 8116 8117 8118 8119 8120 8121 8122 8123 8124 8125 8126 8127 8128 8129 8130 8131 8132 8133 8134 8135 8136 8137 8138 8139 8140 8141 8142 8143 8144 8145 8146 8147 8148 8149 8150 8151 8152 8153 8154 8155 8156 8157 8158 8159 8160 8161 8162 8163 8164 8165 8166 8167 8168 8169 8170 8171 8172 8173 8174 8175 8176 8177 8178 8179 8180 8181 8182 8183 8184 8185 8186 8187 8188 8189 8190 8191 8192 8193 8194 8195 8196 8197 8198 8199 8200 8201 8202 8203 8204 8205 8206 8207 8208 8209 8210 8211 8212 8213 8214 8215 8216 8217 8218 8219 8220 8221 8222 8223 8224 8225 8226 8227 8228 8229 8230 8231 8232 8233 8234 8235 8236 8237 8238 8239 8240 8241 8242 8243 8244 8245 8246 8247 8248 8249 8250 8251 8252 8253 8254 8255 8256 8257 8258 8259 8260 8261 8262 8263 8264 8265 8266 8267 8268 8269 8270 8271 8272 8273 8274 8275 8276 8277 8278 8279 8280 8281 8282 8283 8284 8285 8286 8287 8288 8289 8290 8291 8292 8293 8294 8295 8296 8297 8298 8299 8300 8301 8302 8303 8304 8305 8306 8307 8308
diff --git a/examples/general.c b/examples/general.c
index 6b25dd0..a84cdb7 100644
--- a/examples/general.c
+++ b/examples/general.c
@@ -142,7 +142,7 @@ static void oid_parsing(git_oid *oid)
* this throughout the example for storing the value of the current SHA
* key we're working with.
*/
- git_oid_fromstr(oid, hex);
+ git_oid_fromstr(oid, hex, GIT_OID_SHA1);
/*
* Once we've converted the string into the oid value, we can get the raw
@@ -287,9 +287,9 @@ static void commit_writing(git_repository *repo)
* parents. Here we're creating oid objects to create the commit with,
* but you can also use
*/
- git_oid_fromstr(&tree_id, "f60079018b664e4e79329a7ef9559c8d9e0378d1");
+ git_oid_fromstr(&tree_id, "f60079018b664e4e79329a7ef9559c8d9e0378d1", GIT_OID_SHA1);
git_tree_lookup(&tree, repo, &tree_id);
- git_oid_fromstr(&parent_id, "5b5b025afb0b4c913b4c338a42934a3863bf3644");
+ git_oid_fromstr(&parent_id, "5b5b025afb0b4c913b4c338a42934a3863bf3644", GIT_OID_SHA1);
git_commit_lookup(&parent, repo, &parent_id);
/**
@@ -353,7 +353,7 @@ static void commit_parsing(git_repository *repo)
printf("\n*Commit Parsing*\n");
- git_oid_fromstr(&oid, "8496071c1b46c854b31185ea97743be6a8774479");
+ git_oid_fromstr(&oid, "8496071c1b46c854b31185ea97743be6a8774479", GIT_OID_SHA1);
error = git_commit_lookup(&commit, repo, &oid);
check_error(error, "looking up commit");
@@ -422,7 +422,7 @@ static void tag_parsing(git_repository *repo)
* We create an oid for the tag object if we know the SHA and look it up
* the same way that we would a commit (or any other object).
*/
- git_oid_fromstr(&oid, "b25fa35b38051e4ae45d4222e795f9df2e43f1d1");
+ git_oid_fromstr(&oid, "b25fa35b38051e4ae45d4222e795f9df2e43f1d1", GIT_OID_SHA1);
error = git_tag_lookup(&tag, repo, &oid);
check_error(error, "looking up tag");
@@ -470,7 +470,7 @@ static void tree_parsing(git_repository *repo)
/**
* Create the oid and lookup the tree object just like the other objects.
*/
- git_oid_fromstr(&oid, "f60079018b664e4e79329a7ef9559c8d9e0378d1");
+ git_oid_fromstr(&oid, "f60079018b664e4e79329a7ef9559c8d9e0378d1", GIT_OID_SHA1);
git_tree_lookup(&tree, repo, &oid);
/**
@@ -524,7 +524,7 @@ static void blob_parsing(git_repository *repo)
printf("\n*Blob Parsing*\n");
- git_oid_fromstr(&oid, "1385f264afb75a56a5bec74243be9b367ba4ca08");
+ git_oid_fromstr(&oid, "1385f264afb75a56a5bec74243be9b367ba4ca08", GIT_OID_SHA1);
git_blob_lookup(&blob, repo, &oid);
/**
@@ -566,7 +566,7 @@ static void revwalking(git_repository *repo)
printf("\n*Revwalking*\n");
- git_oid_fromstr(&oid, "5b5b025afb0b4c913b4c338a42934a3863bf3644");
+ git_oid_fromstr(&oid, "5b5b025afb0b4c913b4c338a42934a3863bf3644", GIT_OID_SHA1);
/**
* To use the revwalker, create a new walker, tell it how you want to sort
diff --git a/examples/rev-list.c b/examples/rev-list.c
index 0ca40a2..bf5c875 100644
--- a/examples/rev-list.c
+++ b/examples/rev-list.c
@@ -140,7 +140,7 @@ static int revwalk_parse_revs(git_repository *repo, git_revwalk *walk, struct ar
if (push_spec(repo, walk, curr, hide) == 0)
continue;
- if ((error = git_oid_fromstr(&oid, curr)))
+ if ((error = git_oid_fromstr(&oid, curr, GIT_OID_SHA1)))
return error;
if ((error = push_commit(walk, &oid, hide)))
return error;
diff --git a/fuzzers/commit_graph_fuzzer.c b/fuzzers/commit_graph_fuzzer.c
index f037801..9c1443e 100644
--- a/fuzzers/commit_graph_fuzzer.c
+++ b/fuzzers/commit_graph_fuzzer.c
@@ -37,7 +37,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
git_commit_graph_entry e;
git_str commit_graph_buf = GIT_STR_INIT;
unsigned char hash[GIT_HASH_SHA1_SIZE];
- git_oid oid = {{0}};
+ git_oid oid = GIT_OID_NONE;
bool append_hash = false;
if (size < 4)
diff --git a/fuzzers/midx_fuzzer.c b/fuzzers/midx_fuzzer.c
index 8cd1102..21fb903 100644
--- a/fuzzers/midx_fuzzer.c
+++ b/fuzzers/midx_fuzzer.c
@@ -36,7 +36,7 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
git_midx_entry e;
git_str midx_buf = GIT_STR_INIT;
unsigned char hash[GIT_HASH_SHA1_SIZE];
- git_oid oid = {{0}};
+ git_oid oid = GIT_OID_NONE;
bool append_hash = false;
if (size < 4)
diff --git a/include/git2/oid.h b/include/git2/oid.h
index db433a0..8feb0a3 100644
--- a/include/git2/oid.h
+++ b/include/git2/oid.h
@@ -21,16 +21,16 @@ GIT_BEGIN_DECL
/** The type of object id, currently only SHA1. */
typedef enum {
- GIT_OID_SHA1 = 1 /**< SHA1 */
+ GIT_OID_SHA1 = 1 /**< SHA1 */
} git_oid_t;
/** Size (in bytes) of a raw/binary oid */
-#define GIT_OID_SHA1_SIZE 20
-#define GIT_OID_MAX_SIZE GIT_OID_SHA1_SIZE
+#define GIT_OID_SHA1_SIZE 20
+#define GIT_OID_MAX_SIZE GIT_OID_SHA1_SIZE
/** Size (in bytes) of a hex formatted oid */
-#define GIT_OID_SHA1_HEXSIZE (GIT_OID_SHA1_SIZE * 2)
-#define GIT_OID_MAX_HEXSIZE GIT_OID_SHA1_HEXSIZE
+#define GIT_OID_SHA1_HEXSIZE (GIT_OID_SHA1_SIZE * 2)
+#define GIT_OID_MAX_HEXSIZE GIT_OID_SHA1_HEXSIZE
/** Minimum length (in number of hex characters,
* i.e. packets of 4 bits) of an oid prefix */
@@ -38,39 +38,49 @@ typedef enum {
/** Unique identity of any object (commit, tree, blob, tag). */
typedef struct git_oid {
+ /** type of object id */
+ unsigned char type;
+
/** raw binary formatted id */
- unsigned char id[GIT_OID_SHA1_SIZE];
+ unsigned char id[GIT_OID_MAX_SIZE];
} git_oid;
/**
* The binary representation of the null object ID.
*/
-#define GIT_OID_SHA1_ZERO { { 0 } }
+#define GIT_OID_SHA1_ZERO { GIT_OID_SHA1, { 0 } }
/**
* The string representation of the null object ID.
*/
-#define GIT_OID_SHA1_HEXZERO "0000000000000000000000000000000000000000"
+#define GIT_OID_SHA1_HEXZERO "0000000000000000000000000000000000000000"
/**
* Parse a hex formatted object id into a git_oid.
*
+ * The appropriate number of bytes for the given object ID type will
+ * be read from the string - 40 bytes for SHA1, 64 bytes for SHA256.
+ * The given string need not be NUL terminated.
+ *
* @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).
+ * needed for an oid encoded in hex (40 bytes for sha1,
+ * 256 bytes for sha256).
+ * @param type the type of object id
* @return 0 or an error code
*/
-GIT_EXTERN(int) git_oid_fromstr(git_oid *out, const char *str);
+GIT_EXTERN(int) git_oid_fromstr(git_oid *out, const char *str, git_oid_t type);
/**
- * Parse a hex formatted null-terminated string into a git_oid.
+ * Parse a hex formatted NUL-terminated string into a git_oid.
*
* @param out oid structure the result is written into.
* @param str input hex string; must be null-terminated.
+ * @param type the type of object id
* @return 0 or an error code
*/
-GIT_EXTERN(int) git_oid_fromstrp(git_oid *out, const char *str);
+GIT_EXTERN(int) git_oid_fromstrp(git_oid *out, const char *str, git_oid_t type);
/**
* Parse N characters of a hex formatted object id into a git_oid.
@@ -81,9 +91,10 @@ GIT_EXTERN(int) git_oid_fromstrp(git_oid *out, const char *str);
* @param out oid structure the result is written into.
* @param str input hex string of at least size `length`
* @param length length of the input string
+ * @param type the type of object id
* @return 0 or an error code
*/
-GIT_EXTERN(int) git_oid_fromstrn(git_oid *out, const char *str, size_t length);
+GIT_EXTERN(int) git_oid_fromstrn(git_oid *out, const char *str, size_t length, git_oid_t type);
/**
* Copy an already raw oid into a git_oid structure.
@@ -92,16 +103,17 @@ GIT_EXTERN(int) git_oid_fromstrn(git_oid *out, const char *str, size_t length);
* @param raw the raw input bytes to be copied.
* @return 0 on success or error code
*/
-GIT_EXTERN(int) git_oid_fromraw(git_oid *out, const unsigned char *raw);
+GIT_EXTERN(int) git_oid_fromraw(git_oid *out, const unsigned char *raw, git_oid_t type);
/**
* Format a git_oid into a hex string.
*
* @param out 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.
+ * needed for an oid encoded in hex (40 bytes for SHA1,
+ * 64 bytes for SHA256). Only the oid digits are written;
+ * a '\\0' terminator must be added by the caller if it is
+ * required.
* @param id oid structure to format.
* @return 0 on success or error code
*/
@@ -127,9 +139,10 @@ GIT_EXTERN(int) git_oid_nfmt(char *out, size_t n, const git_oid *id);
*
* @param out 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.
+ * needed for an oid encoded in hex (41 bytes for SHA1,
+ * 65 bytes for SHA256). Only the oid digits are written;
+ * a '\\0' terminator must be added by the caller if it
+ * is required.
* @param id oid structure to format.
* @return 0 on success, non-zero callback return value, or error code
*/
@@ -151,7 +164,9 @@ GIT_EXTERN(char *) git_oid_tostr_s(const git_oid *oid);
/**
* Format a git_oid into a buffer as a hex format c-string.
*
- * If the buffer is smaller than GIT_OID_SHA1_HEXSIZE+1, then the resulting
+ * If the buffer is smaller than the size of a hex-formatted oid string
+ * plus an additional byte (GIT_OID_SHA_HEXSIZE + 1 for SHA1 or
+ * GIT_OID_SHA256_HEXSIZE + 1 for SHA256), then the resulting
* oid c-string will be truncated to n-1 characters (but will still be
* NUL-byte terminated).
*
diff --git a/src/libgit2/attr_file.c b/src/libgit2/attr_file.c
index 0eb881a..afa8ec7 100644
--- a/src/libgit2/attr_file.c
+++ b/src/libgit2/attr_file.c
@@ -135,7 +135,7 @@ int git_attr_file__load(
break;
case GIT_ATTR_FILE_SOURCE_INDEX: {
if ((error = attr_file_oid_from_index(&id, repo, entry->path)) < 0 ||
- (error = git_blob_lookup(&blob, repo, &id)) < 0)
+ (error = git_blob_lookup(&blob, repo, &id)) < 0)
return error;
/* Do not assume that data straight from the ODB is NULL-terminated;
diff --git a/src/libgit2/blame.c b/src/libgit2/blame.c
index a6ab43e..b70cd61 100644
--- a/src/libgit2/blame.c
+++ b/src/libgit2/blame.c
@@ -72,6 +72,8 @@ static git_blame_hunk *new_hunk(
hunk->final_start_line_number = start;
hunk->orig_start_line_number = orig_start;
hunk->orig_path = path ? git__strdup(path) : NULL;
+ git_oid_clear(&hunk->orig_commit_id, GIT_OID_SHA1);
+ git_oid_clear(&hunk->final_commit_id, GIT_OID_SHA1);
return hunk;
}
diff --git a/src/libgit2/commit.c b/src/libgit2/commit.c
index 6dc1bbc..114ae6f 100644
--- a/src/libgit2/commit.c
+++ b/src/libgit2/commit.c
@@ -411,7 +411,8 @@ static int commit_parse(git_commit *commit, const char *data, size_t size, unsig
/* The tree is always the first field */
if (!(flags & GIT_COMMIT_PARSE_QUICK)) {
if (git_object__parse_oid_header(&commit->tree_id,
- &buffer, buffer_end, "tree ") < 0)
+ &buffer, buffer_end, "tree ",
+ GIT_OID_SHA1) < 0)
goto bad_buffer;
} else {
size_t tree_len = strlen("tree ") + GIT_OID_SHA1_HEXSIZE + 1;
@@ -425,7 +426,8 @@ static int commit_parse(git_commit *commit, const char *data, size_t size, unsig
*/
while (git_object__parse_oid_header(&parent_id,
- &buffer, buffer_end, "parent ") == 0) {
+ &buffer, buffer_end, "parent ",
+ GIT_OID_SHA1) == 0) {
git_oid *new_id = git_array_alloc(commit->parent_ids);
GIT_ERROR_CHECK_ALLOC(new_id);
diff --git a/src/libgit2/commit_graph.c b/src/libgit2/commit_graph.c
index 7e98ffb..2edf51a 100644
--- a/src/libgit2/commit_graph.c
+++ b/src/libgit2/commit_graph.c
@@ -150,7 +150,7 @@ static int commit_graph_parse_oid_lookup(
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_SHA1_SIZE) {
- if (git_oid_raw_cmp(prev_oid, oid) >= 0)
+ if (git_oid_raw_cmp(prev_oid, oid, GIT_OID_SHA1_SIZE) >= 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_SHA1_SIZE + 4 * sizeof(uint32_t));
- git_oid_fromraw(&e->tree_oid, commit_data);
+ git_oid_fromraw(&e->tree_oid, commit_data, GIT_OID_SHA1);
e->parent_indices[0] = ntohl(*((uint32_t *)(commit_data + GIT_OID_SHA1_SIZE)));
e->parent_indices[1] = ntohl(
*((uint32_t *)(commit_data + GIT_OID_SHA1_SIZE + sizeof(uint32_t))));
@@ -471,7 +471,7 @@ static int git_commit_graph_entry_get_byindex(
}
}
- git_oid_fromraw(&e->sha1, &file->oid_lookup[pos * GIT_OID_SHA1_SIZE]);
+ git_oid_fromraw(&e->sha1, &file->oid_lookup[pos * GIT_OID_SHA1_SIZE], GIT_OID_SHA1);
return 0;
}
diff --git a/src/libgit2/diff.c b/src/libgit2/diff.c
index f593f73..91931e7 100644
--- a/src/libgit2/diff.c
+++ b/src/libgit2/diff.c
@@ -381,6 +381,7 @@ int git_diff_patchid(git_oid *out, git_diff *diff, git_diff_patchid_options *opt
if ((error = (flush_hunk(&args.result, &args.ctx))) < 0)
goto out;
+ args.result.type = GIT_OID_SHA1;
git_oid_cpy(out, &args.result);
out:
diff --git a/src/libgit2/diff_file.c b/src/libgit2/diff_file.c
index 8006b31..3971655 100644
--- a/src/libgit2/diff_file.c
+++ b/src/libgit2/diff_file.c
@@ -144,6 +144,7 @@ int git_diff_file_content__init_from_src(
if (!src->blob && !src->buf) {
fc->flags |= GIT_DIFF_FLAG__NO_DATA;
+ git_oid_clear(&fc->file->id, GIT_OID_SHA1);
} else {
fc->flags |= GIT_DIFF_FLAG__LOADED;
fc->file->flags |= GIT_DIFF_FLAG_VALID_ID;
diff --git a/src/libgit2/diff_generate.c b/src/libgit2/diff_generate.c
index 16efbc7..d22c557 100644
--- a/src/libgit2/diff_generate.c
+++ b/src/libgit2/diff_generate.c
@@ -61,6 +61,9 @@ static git_diff_delta *diff_delta__alloc(
}
delta->status = status;
+ git_oid_clear(&delta->old_file.id, GIT_OID_SHA1);
+ git_oid_clear(&delta->new_file.id, GIT_OID_SHA1);
+
return delta;
}
@@ -188,11 +191,13 @@ static int diff_delta__from_one(
delta->old_file.size = entry->file_size;
delta->old_file.flags |= GIT_DIFF_FLAG_EXISTS;
git_oid_cpy(&delta->old_file.id, &entry->id);
+ git_oid_clear(&delta->new_file.id, GIT_OID_SHA1);
delta->old_file.id_abbrev = GIT_OID_SHA1_HEXSIZE;
} else /* ADDED, IGNORED, UNTRACKED */ {
delta->new_file.mode = entry->mode;
delta->new_file.size = entry->file_size;
delta->new_file.flags |= GIT_DIFF_FLAG_EXISTS;
+ git_oid_clear(&delta->old_file.id, GIT_OID_SHA1);
git_oid_cpy(&delta->new_file.id, &entry->id);
delta->new_file.id_abbrev = GIT_OID_SHA1_HEXSIZE;
}
@@ -598,6 +603,7 @@ int git_diff__oid_for_file(
entry.mode = mode;
entry.file_size = (uint32_t)size;
entry.path = (char *)path;
+ git_oid_clear(&entry.id, GIT_OID_SHA1);
return git_diff__oid_for_entry(out, diff, &entry, mode, NULL);
}
@@ -618,7 +624,7 @@ int git_diff__oid_for_entry(
GIT_ASSERT(d->type == GIT_DIFF_TYPE_GENERATED);
diff = (git_diff_generated *)d;
- memset(out, 0, sizeof(*out));
+ git_oid_clear(out, GIT_OID_SHA1);
if (git_repository_workdir_path(&full_path, diff->base.repo, entry.path) < 0)
return -1;
@@ -778,7 +784,7 @@ static int maybe_modified(
git_diff_generated *diff,
diff_in_progress *info)
{
- git_oid noid;
+ git_oid noid = GIT_OID_SHA1_ZERO;
git_delta_t status = GIT_DELTA_MODIFIED;
const git_index_entry *oitem = info->oitem;
const git_index_entry *nitem = info->nitem;
@@ -792,8 +798,6 @@ static int maybe_modified(
if (!diff_pathspec_match(&matched_pathspec, diff, oitem))
return 0;
- memset(&noid, 0, sizeof(noid));
-
/* on platforms with no symlinks, preserve mode of existing symlinks */
if (S_ISLNK(omode) && S_ISREG(nmode) && new_is_workdir &&
!(diff->diffcaps & GIT_DIFFCAPS_HAS_SYMLINKS))
diff --git a/src/libgit2/diff_tform.c b/src/libgit2/diff_tform.c
index 913d649..8c0c1b7 100644
--- a/src/libgit2/diff_tform.c
+++ b/src/libgit2/diff_tform.c
@@ -364,6 +364,7 @@ static int insert_delete_side_of_split(
memset(&deleted->new_file, 0, sizeof(deleted->new_file));
deleted->new_file.path = deleted->old_file.path;
deleted->new_file.flags |= GIT_DIFF_FLAG_VALID_ID;
+ git_oid_clear(&deleted->new_file.id, GIT_OID_SHA1);
return git_vector_insert(onto, deleted);
}
@@ -397,6 +398,7 @@ static int apply_splits_and_deletes(
memset(&delta->old_file, 0, sizeof(delta->old_file));
delta->old_file.path = delta->new_file.path;
delta->old_file.flags |= GIT_DIFF_FLAG_VALID_ID;
+ git_oid_clear(&delta->old_file.id, GIT_OID_SHA1);
}
/* clean up delta before inserting into new list */
@@ -995,6 +997,7 @@ find_best_matches:
memset(&src->new_file, 0, sizeof(src->new_file));
src->new_file.path = src->old_file.path;
src->new_file.flags |= GIT_DIFF_FLAG_VALID_ID;
+ git_oid_clear(&src->new_file.id, GIT_OID_SHA1);
num_updates++;
@@ -1020,6 +1023,7 @@ find_best_matches:
memset(&src->old_file, 0, sizeof(src->old_file));
src->old_file.path = src->new_file.path;
src->old_file.flags |= GIT_DIFF_FLAG_VALID_ID;
+ git_oid_clear(&src->old_file.id, GIT_OID_SHA1);
src->flags &= ~GIT_DIFF_FLAG__TO_SPLIT;
num_rewrites--;
diff --git a/src/libgit2/fetch.c b/src/libgit2/fetch.c
index e9f30d9..c278570 100644
--- a/src/libgit2/fetch.c
+++ b/src/libgit2/fetch.c
@@ -75,7 +75,7 @@ static int maybe_want_oid(git_remote *remote, git_refspec *spec)
oid_head = git__calloc(1, sizeof(git_remote_head));
GIT_ERROR_CHECK_ALLOC(oid_head);
- git_oid_fromstr(&oid_head->oid, spec->src);
+ git_oid_fromstr(&oid_head->oid, spec->src, GIT_OID_SHA1);
if (spec->dst) {
oid_head->name = git__strdup(spec->dst);
@@ -140,7 +140,7 @@ static int filter_wants(git_remote *remote, const git_fetch_options *opts)
/* Handle explicitly specified OID specs */
git_vector_foreach(&remote->active_refspecs, i, spec) {
- if (!git_oid__is_hexstr(spec->src))
+ if (!git_oid__is_hexstr(spec->src, GIT_OID_SHA1))
continue;
if (!(remote_caps & oid_mask)) {
diff --git a/src/libgit2/fetchhead.c b/src/libgit2/fetchhead.c
index 146d891..117d7a0 100644
--- a/src/libgit2/fetchhead.c
+++ b/src/libgit2/fetchhead.c
@@ -202,7 +202,7 @@ static int fetchhead_ref_parse(
return -1;
}
- if (git_oid_fromstr(oid, oid_str) < 0) {
+ if (git_oid_fromstr(oid, oid_str, GIT_OID_SHA1) < 0) {
const git_error *oid_err = git_error_last();
const char *err_msg = oid_err ? oid_err->message : "invalid object ID";
diff --git a/src/libgit2/index.c b/src/libgit2/index.c
index 977820a..91d74a0 100644
--- a/src/libgit2/index.c
+++ b/src/libgit2/index.c
@@ -2354,14 +2354,16 @@ static int read_reuc(git_index *index, const char *buffer, size_t size)
for (i = 0; i < 3; i++) {
if (!lost->mode[i])
continue;
- if (size < 20) {
+ if (size < GIT_OID_SHA1_SIZE) {
index_entry_reuc_free(lost);
return index_error_invalid("reading reuc entry oid");
}
- git_oid_fromraw(&lost->oid[i], (const unsigned char *) buffer);
- size -= 20;
- buffer += 20;
+ if (git_oid_fromraw(&lost->oid[i], (const unsigned char *) buffer, GIT_OID_SHA1) < 0)
+ return -1;
+
+ size -= GIT_OID_SHA1_SIZE;
+ buffer += GIT_OID_SHA1_SIZE;
}
/* entry was read successfully - insert into reuc vector */
@@ -2482,7 +2484,7 @@ static int read_entry(
entry.file_size = ntohl(source.file_size);
entry.flags = ntohs(source.flags);
- if (git_oid_fromraw(&entry.id, source.oid) < 0)
+ if (git_oid_fromraw(&entry.id, source.oid, GIT_OID_SHA1) < 0)
return -1;
if (entry.flags & GIT_INDEX_ENTRY_EXTENDED) {
@@ -2805,7 +2807,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_raw_cpy(ondisk.oid, entry->id.id);
+ git_oid_raw_cpy(ondisk.oid, entry->id.id, GIT_OID_SHA1_SIZE);
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 f3d701f..e7ea77e 100644
--- a/src/libgit2/indexer.c
+++ b/src/libgit2/indexer.c
@@ -444,6 +444,8 @@ static int store_object(git_indexer *idx)
git__free(pentry);
goto on_error;
}
+ oid.type = GIT_OID_SHA1;
+
entry_size = idx->off - entry_start;
if (entry_start > UINT31_MAX) {
entry->offset = UINT32_MAX;
@@ -1046,7 +1048,7 @@ static int fix_thin_pack(git_indexer *idx, git_indexer_progress *stats)
return -1;
}
- git_oid_fromraw(&base, base_info);
+ git_oid_fromraw(&base, base_info, GIT_OID_SHA1);
git_mwindow_close(&w);
if (has_entry(idx, &base))
diff --git a/src/libgit2/iterator.c b/src/libgit2/iterator.c
index 6b127af..8b204b0 100644
--- a/src/libgit2/iterator.c
+++ b/src/libgit2/iterator.c
@@ -1529,6 +1529,8 @@ static void filesystem_iterator_set_current(
if (iter->base.flags & GIT_ITERATOR_INCLUDE_HASH)
git_oid_cpy(&iter->entry.id, &entry->id);
+ else
+ git_oid_clear(&iter->entry.id, GIT_OID_SHA1);
iter->entry.path = entry->path;
diff --git a/src/libgit2/merge.c b/src/libgit2/merge.c
index e4db262..06c52a6 100644
--- a/src/libgit2/merge.c
+++ b/src/libgit2/merge.c
@@ -617,7 +617,7 @@ int git_repository_mergehead_foreach(
goto cleanup;
}
- if ((error = git_oid_fromstr(&oid, line)) < 0)
+ if ((error = git_oid_fromstr(&oid, line, GIT_OID_SHA1)) < 0)
goto cleanup;
if ((error = cb(&oid, payload)) != 0) {
diff --git a/src/libgit2/midx.c b/src/libgit2/midx.c
index 86803fa..8c0b8df 100644
--- a/src/libgit2/midx.c
+++ b/src/libgit2/midx.c
@@ -127,7 +127,7 @@ static int midx_parse_oid_lookup(
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_SHA1_SIZE) {
- if (git_oid_raw_cmp(prev_oid, oid) >= 0)
+ if (git_oid_raw_cmp(prev_oid, oid, GIT_OID_SHA1_SIZE) >= 0)
return midx_error("OID Lookup index is non-monotonic");
prev_oid = oid;
}
@@ -443,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_fromraw(&e->sha1, current);
+ git_oid_fromraw(&e->sha1, current, GIT_OID_SHA1);
return 0;
}
@@ -459,7 +459,7 @@ int git_midx_foreach_entry(
GIT_ASSERT_ARG(idx);
for (i = 0; i < idx->num_objects; ++i) {
- if ((error = git_oid_fromraw(&oid, &idx->oid_lookup[i * GIT_OID_SHA1_SIZE])) < 0)
+ if ((error = git_oid_fromraw(&oid, &idx->oid_lookup[i * GIT_OID_SHA1_SIZE], GIT_OID_SHA1)) < 0)
return error;
if ((error = cb(&oid, data)) != 0)
diff --git a/src/libgit2/notes.c b/src/libgit2/notes.c
index a154d96..08395ae 100644
--- a/src/libgit2/notes.c
+++ b/src/libgit2/notes.c
@@ -703,7 +703,7 @@ static int process_entry_path(
goto cleanup;
}
- error = git_oid_fromstr(annotated_object_id, buf.ptr);
+ error = git_oid_fromstr(annotated_object_id, buf.ptr, GIT_OID_SHA1);
cleanup:
git_str_dispose(&buf);
diff --git a/src/libgit2/object.c b/src/libgit2/object.c
index a037026..61c7b90 100644
--- a/src/libgit2/object.c
+++ b/src/libgit2/object.c
@@ -521,6 +521,7 @@ static int git_object__short_id(git_str *out, const git_object *obj)
memcpy(&id.id, &obj->cached.oid.id, (len + 1) / 2);
if (len & 1)
id.id[len / 2] &= 0xf0;
+ id.type = GIT_OID_SHA1;
error = git_odb_exists_prefix(NULL, odb, &id, len);
if (error != GIT_EAMBIGUOUS)
@@ -605,7 +606,8 @@ int git_object__parse_oid_header(
git_oid *oid,
const char **buffer_out,
const char *buffer_end,
- const char *header)
+ const char *header,
+ git_oid_t oid_type)
{
const size_t sha_len = GIT_OID_SHA1_HEXSIZE;
const size_t header_len = strlen(header);
@@ -621,7 +623,7 @@ int git_object__parse_oid_header(
if (buffer[header_len + sha_len] != '\n')
return -1;
- if (git_oid_fromstr(oid, buffer + header_len) < 0)
+ if (git_oid_fromstr(oid, buffer + header_len, oid_type) < 0)
return -1;
*buffer_out = buffer + (header_len + sha_len + 1);
@@ -634,11 +636,17 @@ int git_object__write_oid_header(
const char *header,
const git_oid *oid)
{
- char hex_oid[GIT_OID_SHA1_HEXSIZE];
+ size_t hex_size = git_oid_hexsize(oid->type);
+ char hex_oid[GIT_OID_MAX_HEXSIZE];
+
+ if (!hex_size) {
+ git_error_set(GIT_ERROR_INVALID, "unknown type");
+ return -1;
+ }
git_oid_fmt(hex_oid, oid);
git_str_puts(buf, header);
- git_str_put(buf, hex_oid, GIT_OID_SHA1_HEXSIZE);
+ git_str_put(buf, hex_oid, hex_size);
git_str_putc(buf, '\n');
return git_str_oom(buf) ? -1 : 0;
diff --git a/src/libgit2/object.h b/src/libgit2/object.h
index b1fcd95..980e862 100644
--- a/src/libgit2/object.h
+++ b/src/libgit2/object.h
@@ -49,7 +49,8 @@ int git_object__parse_oid_header(
git_oid *oid,
const char **buffer_out,
const char *buffer_end,
- const char *header);
+ const char *header,
+ git_oid_t oid_type);
int git_object__write_oid_header(
git_str *buf,
diff --git a/src/libgit2/odb.c b/src/libgit2/odb.c
index fed103e..3a7d08c 100644
--- a/src/libgit2/odb.c
+++ b/src/libgit2/odb.c
@@ -134,6 +134,7 @@ int git_odb__hashobj(git_oid *id, git_rawobj *obj)
vec[1].data = obj->data;
vec[1].len = obj->len;
+ id->type = GIT_OID_SHA1;
return git_hash_vec(id->id, vec, 2, GIT_HASH_ALGORITHM_SHA1);
}
@@ -236,6 +237,7 @@ int git_odb__hashfd(git_oid *out, git_file fd, size_t size, git_object_t type)
}
error = git_hash_final(out->id, &ctx);
+ out->type = GIT_OID_SHA1;
done:
git_hash_ctx_cleanup(&ctx);
@@ -914,7 +916,7 @@ static int odb_exists_prefix_1(git_oid *out, git_odb *db,
{
size_t i;
int error = GIT_ENOTFOUND, num_found = 0;
- git_oid last_found = GIT_OID_SHA1_ZERO, found;
+ git_oid last_found = GIT_OID_NONE, found;
if ((error = git_mutex_lock(&db->lock)) < 0) {
git_error_set(GIT_ERROR_ODB, "failed to acquire the odb lock");
@@ -965,7 +967,7 @@ int git_odb_exists_prefix(
git_oid *out, git_odb *db, const git_oid *short_id, size_t len)
{
int error;
- git_oid key = GIT_OID_SHA1_ZERO;
+ git_oid key = GIT_OID_NONE;
GIT_ASSERT_ARG(db);
GIT_ASSERT_ARG(short_id);
@@ -1049,7 +1051,7 @@ int git_odb_expand_ids(
/* the object is missing or ambiguous */
case GIT_ENOTFOUND:
case GIT_EAMBIGUOUS:
- memset(&query->id, 0, sizeof(git_oid));
+ git_oid_clear(&query->id, GIT_OID_SHA1);
query->length = 0;
query->type = 0;
break;
@@ -1305,7 +1307,7 @@ static int read_prefix_1(git_odb_object **out, git_odb *db,
{
size_t i;
int error = 0;
- git_oid found_full_oid = GIT_OID_SHA1_ZERO;
+ git_oid found_full_oid = GIT_OID_NONE;
git_rawobj raw = {0};
void *data = NULL;
bool found = false;
@@ -1391,7 +1393,8 @@ out:
int git_odb_read_prefix(
git_odb_object **out, git_odb *db, const git_oid *short_id, size_t len)
{
- git_oid key = GIT_OID_SHA1_ZERO;
+ git_oid key = GIT_OID_NONE;
+ size_t hex_size;
int error;
GIT_ASSERT_ARG(out);
@@ -1611,6 +1614,7 @@ int git_odb_stream_finalize_write(git_oid *out, git_odb_stream *stream)
"stream_finalize_write()");
git_hash_final(out->id, stream->hash_ctx);
+ out->type = GIT_OID_SHA1;
if (git_odb__freshen(stream->backend->odb, out))
return 0;
diff --git a/src/libgit2/odb_loose.c b/src/libgit2/odb_loose.c
index 4700f97..f5013df 100644
--- a/src/libgit2/odb_loose.c
+++ b/src/libgit2/odb_loose.c
@@ -545,7 +545,7 @@ static int locate_object_short_oid(
return git_odb__error_ambiguous("multiple matches in loose objects");
/* Convert obtained hex formatted oid to raw */
- error = git_oid_fromstr(res_oid, (char *)state.res_oid);
+ error = git_oid_fromstr(res_oid, (char *)state.res_oid, GIT_OID_SHA1);
if (error)
return error;
@@ -733,6 +733,8 @@ GIT_INLINE(int) filename_to_oid(git_oid *oid, const char *ptr)
oid->id[1 + i/2] = (unsigned char) v;
}
+ oid->type = GIT_OID_SHA1;
+
return 0;
}
diff --git a/src/libgit2/oid.c b/src/libgit2/oid.c
index 83f0fa5..d3284bd 100644
--- a/src/libgit2/oid.c
+++ b/src/libgit2/oid.c
@@ -14,11 +14,13 @@
#include <limits.h>
const git_oid git_oid__empty_blob_sha1 =
- {{ 0xe6, 0x9d, 0xe2, 0x9b, 0xb2, 0xd1, 0xd6, 0x43, 0x4b, 0x8b,
- 0x29, 0xae, 0x77, 0x5a, 0xd8, 0xc2, 0xe4, 0x8c, 0x53, 0x91 }};
+ { GIT_OID_SHA1,
+ { 0xe6, 0x9d, 0xe2, 0x9b, 0xb2, 0xd1, 0xd6, 0x43, 0x4b, 0x8b,
+ 0x29, 0xae, 0x77, 0x5a, 0xd8, 0xc2, 0xe4, 0x8c, 0x53, 0x91 }};
const git_oid git_oid__empty_tree_sha1 =
- {{ 0x4b, 0x82, 0x5d, 0xc6, 0x42, 0xcb, 0x6e, 0xb9, 0xa0, 0x60,
- 0xe5, 0x4b, 0xf8, 0xd6, 0x92, 0x88, 0xfb, 0xee, 0x49, 0x04 }};
+ { GIT_OID_SHA1,
+ { 0x4b, 0x82, 0x5d, 0xc6, 0x42, 0xcb, 0x6e, 0xb9, 0xa0, 0x60,
+ 0xe5, 0x4b, 0xf8, 0xd6, 0x92, 0x88, 0xfb, 0xee, 0x49, 0x04 }};
static char to_hex[] = "0123456789abcdef";
@@ -28,21 +30,29 @@ static int oid_error_invalid(const char *msg)
return -1;
}
-int git_oid_fromstrn(git_oid *out, const char *str, size_t length)
+int git_oid_fromstrn(
+ git_oid *out,
+ const char *str,
+ size_t length,
+ git_oid_t type)
{
- size_t p;
+ size_t size, p;
int v;
GIT_ASSERT_ARG(out);
GIT_ASSERT_ARG(str);
+ if (!(size = git_oid_size(type)))
+ return oid_error_invalid("unknown type");
+
if (!length)
return oid_error_invalid("too short");
- if (length > GIT_OID_SHA1_HEXSIZE)
+ if (length > git_oid_hexsize(type))
return oid_error_invalid("too long");
- memset(out->id, 0, GIT_OID_SHA1_SIZE);
+ out->type = type;
+ memset(out->id, 0, size);
for (p = 0; p < length; p++) {
v = git__fromhex(str[p]);
@@ -55,14 +65,14 @@ int git_oid_fromstrn(git_oid *out, const char *str, size_t length)
return 0;
}
-int git_oid_fromstrp(git_oid *out, const char *str)
+int git_oid_fromstrp(git_oid *out, const char *str, git_oid_t type)
{
- return git_oid_fromstrn(out, str, strlen(str));
+ return git_oid_fromstrn(out, str, strlen(str), type);
}
-int git_oid_fromstr(git_oid *out, const char *str)
+int git_oid_fromstr(git_oid *out, const char *str, git_oid_t type)
{
- return git_oid_fromstrn(out, str, GIT_OID_SHA1_HEXSIZE);
+ return git_oid_fromstrn(out, str, git_oid_hexsize(type), type);
}
GIT_INLINE(char) *fmt_one(char *str, unsigned int val)
@@ -74,15 +84,19 @@ GIT_INLINE(char) *fmt_one(char *str, unsigned int val)
int git_oid_nfmt(char *str, size_t n, const git_oid *oid)
{
- size_t i, max_i;
+ size_t hex_size, i, max_i;
if (!oid) {
memset(str, 0, n);
return 0;
}
- if (n > GIT_OID_SHA1_HEXSIZE) {
- memset(&str[GIT_OID_SHA1_HEXSIZE], 0, n - GIT_OID_SHA1_HEXSIZE);
- n = GIT_OID_SHA1_HEXSIZE;
+
+ if (!(hex_size = git_oid_hexsize(oid->type)))
+ return oid_error_invalid("unknown type");
+
+ if (n > hex_size) {
+ memset(&str[hex_size], 0, n - hex_size);
+ n = hex_size;
}
max_i = n / 2;
@@ -98,16 +112,19 @@ int git_oid_nfmt(char *str, size_t n, const git_oid *oid)
int git_oid_fmt(char *str, const git_oid *oid)
{
- return git_oid_nfmt(str, GIT_OID_SHA1_HEXSIZE, oid);
+ return git_oid_nfmt(str, git_oid_hexsize(oid->type), oid);
}
int git_oid_pathfmt(char *str, const git_oid *oid)
{
- size_t i;
+ size_t size, i;
+
+ if (!(size = git_oid_size(oid->type)))
+ return oid_error_invalid("unknown type");
str = fmt_one(str, oid->id[0]);
*str++ = '/';
- for (i = 1; i < sizeof(oid->id); i++)
+ for (i = 1; i < size; i++)
str = fmt_one(str, oid->id[i]);
return 0;
@@ -116,26 +133,37 @@ int git_oid_pathfmt(char *str, const git_oid *oid)
char *git_oid_tostr_s(const git_oid *oid)
{
char *str = GIT_THREADSTATE->oid_fmt;
- git_oid_nfmt(str, GIT_OID_SHA1_HEXSIZE + 1, oid);
+ git_oid_nfmt(str, git_oid_hexsize(oid->type) + 1, oid);
return str;
}
char *git_oid_allocfmt(const git_oid *oid)
{
- char *str = git__malloc(GIT_OID_SHA1_HEXSIZE + 1);
- if (!str)
+ size_t hex_size = git_oid_hexsize(oid->type);
+ char *str = git__malloc(hex_size + 1);
+
+ if (!hex_size || !str)
return NULL;
- git_oid_nfmt(str, GIT_OID_SHA1_HEXSIZE + 1, oid);
+
+ if (git_oid_nfmt(str, hex_size + 1, oid) < 0) {
+ git__free(str);
+ return NULL;
+ }
+
return str;
}
char *git_oid_tostr(char *out, size_t n, const git_oid *oid)
{
+ size_t hex_size;
+
if (!out || n == 0)
return "";
- if (n > GIT_OID_SHA1_HEXSIZE + 1)
- n = GIT_OID_SHA1_HEXSIZE + 1;
+ hex_size = oid ? git_oid_hexsize(oid->type) : 0;
+
+ if (n > hex_size + 1)
+ n = hex_size + 1;
git_oid_nfmt(out, n - 1, oid); /* allow room for terminating NUL */
out[n - 1] = '\0';
@@ -143,15 +171,27 @@ char *git_oid_tostr(char *out, size_t n, const git_oid *oid)
return out;
}
-int git_oid_fromraw(git_oid *out, const unsigned char *raw)
+int git_oid_fromraw(git_oid *out, const unsigned char *raw, git_oid_t type)
{
- memcpy(out->id, raw, sizeof(out->id));
+ size_t size;
+
+ if (!(size = git_oid_size(type)))
+ return oid_error_invalid("unknown type");
+
+ out->type = type;
+ memcpy(out->id, raw, size);
return 0;
}
int git_oid_cpy(git_oid *out, const git_oid *src)
{
- return git_oid_raw_cpy(out->id, src->id);
+ size_t size;
+
+ if (!(size = git_oid_size(src->type)))
+ return oid_error_invalid("unknown type");
+
+ out->type = src->type;
+ return git_oid_raw_cpy(out->id, src->id, size);
}
int git_oid_cmp(const git_oid *a, const git_oid *b)
@@ -166,6 +206,9 @@ 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)
{
+ if (oid_a->type != oid_b->type)
+ return oid_a->type - oid_b->type;
+
return git_oid_raw_ncmp(oid_a->id, oid_b->id, len);
}
@@ -173,9 +216,10 @@ int git_oid_strcmp(const git_oid *oid_a, const char *str)
{
const unsigned char *a;
unsigned char strval;
+ long size = (long)git_oid_size(oid_a->type);
int hexval;
- for (a = oid_a->id; *str && (a - oid_a->id) < GIT_OID_SHA1_SIZE; ++a) {
+ for (a = oid_a->id; *str && (a - oid_a->id) < size; ++a) {
if ((hexval = git__fromhex(*str++)) < 0)
return -1;
strval = (unsigned char)(hexval << 4);
@@ -199,8 +243,14 @@ int git_oid_streq(const git_oid *oid_a, const char *str)
int git_oid_is_zero(const git_oid *oid_a)
{
const unsigned char *a = oid_a->id;
- unsigned int i;
- for (i = 0; i < GIT_OID_SHA1_SIZE; ++i, ++a)
+ size_t size = git_oid_size(oid_a->type), i;
+
+ if (!oid_a->type)
+ return 1;
+ else if (!size)
+ return 0;
+
+ for (i = 0; i < size; ++i, ++a)
if (*a != 0)
return 0;
return 1;
diff --git a/src/libgit2/oid.h b/src/libgit2/oid.h
index 9548ba2..f3df9aa 100644
--- a/src/libgit2/oid.h
+++ b/src/libgit2/oid.h
@@ -11,6 +11,8 @@
#include "git2/oid.h"
+#define GIT_OID_NONE { 0, { 0 } }
+
extern const git_oid git_oid__empty_blob_sha1;
extern const git_oid git_oid__empty_tree_sha1;
@@ -50,8 +52,8 @@ GIT_INLINE(int) git_oid_raw_ncmp(
const unsigned char *sha2,
size_t len)
{
- if (len > GIT_OID_SHA1_HEXSIZE)
- len = GIT_OID_SHA1_HEXSIZE;
+ if (len > GIT_OID_MAX_HEXSIZE)
+ len = GIT_OID_MAX_HEXSIZE;
while (len > 1) {
if (*sha1 != *sha2)
@@ -70,16 +72,18 @@ GIT_INLINE(int) git_oid_raw_ncmp(
GIT_INLINE(int) git_oid_raw_cmp(
const unsigned char *sha1,
- const unsigned char *sha2)
+ const unsigned char *sha2,
+ size_t size)
{
- return memcmp(sha1, sha2, GIT_OID_SHA1_SIZE);
+ return memcmp(sha1, sha2, size);
}
GIT_INLINE(int) git_oid_raw_cpy(
unsigned char *dst,
- const unsigned char *src)
+ const unsigned char *src,
+ size_t size)
{
- memcpy(dst, src, GIT_OID_SHA1_SIZE);
+ memcpy(dst, src, size);
return 0;
}
@@ -92,7 +96,10 @@ GIT_INLINE(int) git_oid_raw_cpy(
*/
GIT_INLINE(int) git_oid__cmp(const git_oid *a, const git_oid *b)
{
- return git_oid_raw_cmp(a->id, b->id);
+ if (a->type != b->type)
+ return a->type - b->type;
+
+ return git_oid_raw_cmp(a->id, b->id, git_oid_size(a->type));
}
GIT_INLINE(void) git_oid__cpy_prefix(
@@ -104,7 +111,7 @@ GIT_INLINE(void) git_oid__cpy_prefix(
out->id[len / 2] &= 0xF0;
}
-GIT_INLINE(bool) git_oid__is_hexstr(const char *str)
+GIT_INLINE(bool) git_oid__is_hexstr(const char *str, git_oid_t type)
{
size_t i;
@@ -113,7 +120,13 @@ GIT_INLINE(bool) git_oid__is_hexstr(const char *str)
return false;
}
- return (i == GIT_OID_SHA1_HEXSIZE);
+ return (i == git_oid_hexsize(type));
+}
+
+GIT_INLINE(void) git_oid_clear(git_oid *out, git_oid_t type)
+{
+ memset(out->id, 0, git_oid_size(type));
+ out->type = type;
}
#endif
diff --git a/src/libgit2/pack.c b/src/libgit2/pack.c
index 9559374..18f51d1 100644
--- a/src/libgit2/pack.c
+++ b/src/libgit2/pack.c
@@ -1002,7 +1002,7 @@ int get_delta_base(
*curpos += used;
} else if (type == GIT_OBJECT_REF_DELTA) {
git_oid base_oid;
- git_oid_fromraw(&base_oid, base_info);
+ git_oid_fromraw(&base_oid, base_info, GIT_OID_SHA1);
/* If we have the cooperative cache, search in it first */
if (p->has_cache) {
@@ -1136,7 +1136,7 @@ static int packfile_open_locked(struct git_pack_file *p)
idx_sha1 = ((unsigned char *)p->index_map.data) + p->index_map.len - 40;
- if (git_oid_raw_cmp(sha1, idx_sha1) != 0)
+ if (git_oid_raw_cmp(sha1, idx_sha1, GIT_OID_SHA1_SIZE) != 0)
goto cleanup;
if (git_mwindow_file_register(&p->mwf) < 0)
@@ -1362,7 +1362,7 @@ int git_pack_foreach_entry(
git_array_clear(oids);
GIT_ERROR_CHECK_ALLOC(oid);
}
- git_oid_fromraw(oid, p->oids[i]);
+ git_oid_fromraw(oid, p->oids[i], GIT_OID_SHA1);
}
git_mutex_unlock(&p->lock);
@@ -1428,7 +1428,7 @@ int git_pack_foreach_entry_offset(
ntohl(*((uint32_t *)(large_offset_ptr + 4)));
}
- git_oid_fromraw(¤t_oid, (index + 20 * i));
+ git_oid_fromraw(¤t_oid, (index + 20 * i), GIT_OID_SHA1);
if ((error = cb(¤t_oid, current_offset, data)) != 0) {
error = git_error_set_after_callback(error);
goto cleanup;
@@ -1437,7 +1437,7 @@ int git_pack_foreach_entry_offset(
} else {
for (i = 0; i < p->num_objects; i++) {
current_offset = ntohl(*(const uint32_t *)(index + 24 * i));
- git_oid_fromraw(¤t_oid, (index + 24 * i + 4));
+ git_oid_fromraw(¤t_oid, (index + 24 * i + 4), GIT_OID_SHA1);
if ((error = cb(¤t_oid, current_offset, data)) != 0) {
error = git_error_set_after_callback(error);
goto cleanup;
@@ -1457,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_raw_cmp(base + mi * stride, oid_prefix);
+ int cmp = git_oid_raw_cmp(base + mi * stride, oid_prefix, GIT_OID_SHA1_SIZE);
if (!cmp)
return mi;
@@ -1566,7 +1566,7 @@ static int pack_entry_find_offset(
}
*offset_out = offset;
- git_oid_fromraw(found_oid, current);
+ git_oid_fromraw(found_oid, current, GIT_OID_SHA1);
#ifdef INDEX_DEBUG_LOOKUP
{
diff --git a/src/libgit2/parse.c b/src/libgit2/parse.c
index 7527b55..703a6cd 100644
--- a/src/libgit2/parse.c
+++ b/src/libgit2/parse.c
@@ -105,7 +105,7 @@ int git_parse_advance_oid(git_oid *out, git_parse_ctx *ctx)
{
if (ctx->line_len < GIT_OID_SHA1_HEXSIZE)
return -1;
- if ((git_oid_fromstrn(out, ctx->line, GIT_OID_SHA1_HEXSIZE)) < 0)
+ if ((git_oid_fromstrn(out, ctx->line, GIT_OID_SHA1_HEXSIZE, GIT_OID_SHA1)) < 0)
return -1;
git_parse_advance_chars(ctx, GIT_OID_SHA1_HEXSIZE);
return 0;
diff --git a/src/libgit2/patch_parse.c b/src/libgit2/patch_parse.c
index 0ca1e43..a3c7a64 100644
--- a/src/libgit2/patch_parse.c
+++ b/src/libgit2/patch_parse.c
@@ -174,7 +174,7 @@ static int parse_header_oid(
}
if (len < GIT_OID_MINPREFIXLEN || len > GIT_OID_SHA1_HEXSIZE ||
- git_oid_fromstrn(oid, ctx->parse_ctx.line, len) < 0)
+ git_oid_fromstrn(oid, ctx->parse_ctx.line, len, GIT_OID_SHA1) < 0)
return git_parse_err("invalid hex formatted object id at line %"PRIuZ,
ctx->parse_ctx.line_num);
@@ -1065,12 +1065,12 @@ static int check_patch(git_patch_parsed *patch)
return git_parse_err("patch with no hunks");
if (delta->status == GIT_DELTA_ADDED) {
- memset(&delta->old_file.id, 0x0, sizeof(git_oid));
+ git_oid_clear(&delta->old_file.id, GIT_OID_SHA1);
delta->old_file.id_abbrev = 0;
}
if (delta->status == GIT_DELTA_DELETED) {
- memset(&delta->new_file.id, 0x0, sizeof(git_oid));
+ git_oid_clear(&delta->new_file.id, GIT_OID_SHA1);
delta->new_file.id_abbrev = 0;
}
diff --git a/src/libgit2/push.c b/src/libgit2/push.c
index da8aeba..d477b4f 100644
--- a/src/libgit2/push.c
+++ b/src/libgit2/push.c
@@ -118,6 +118,9 @@ static int parse_refspec(git_push *push, push_spec **spec, const char *str)
s = git__calloc(1, sizeof(*s));
GIT_ERROR_CHECK_ALLOC(s);
+ git_oid_clear(&s->loid, GIT_OID_SHA1);
+ git_oid_clear(&s->roid, GIT_OID_SHA1);
+
if (git_refspec__parse(&s->refspec, str, false) < 0) {
git_error_set(GIT_ERROR_INVALID, "invalid refspec %s", str);
goto on_error;
diff --git a/src/libgit2/rebase.c b/src/libgit2/rebase.c
index f0d528d..4529168 100644
--- a/src/libgit2/rebase.c
+++ b/src/libgit2/rebase.c
@@ -171,7 +171,8 @@ GIT_INLINE(int) rebase_readoid(
if ((error = rebase_readfile(str_out, state_path, filename)) < 0)
return error;
- if (str_out->size != GIT_OID_SHA1_HEXSIZE || git_oid_fromstr(out, str_out->ptr) < 0) {
+ if (str_out->size != GIT_OID_SHA1_HEXSIZE ||
+ git_oid_fromstr(out, str_out->ptr, GIT_OID_SHA1) < 0) {
git_error_set(GIT_ERROR_REBASE, "the file '%s' contains an invalid object ID", filename);
return -1;
}
@@ -353,7 +354,7 @@ int git_rebase_open(
git_str_rtrim(&orig_head_id);
- if ((error = git_oid_fromstr(&rebase->orig_head_id, orig_head_id.ptr)) < 0)
+ if ((error = git_oid_fromstr(&rebase->orig_head_id, orig_head_id.ptr, GIT_OID_SHA1)) < 0)
goto done;
git_str_truncate(&path, state_path_len);
@@ -364,7 +365,7 @@ int git_rebase_open(
git_str_rtrim(&onto_id);
- if ((error = git_oid_fromstr(&rebase->onto_id, onto_id.ptr)) < 0)
+ if ((error = git_oid_fromstr(&rebase->onto_id, onto_id.ptr, GIT_OID_SHA1)) < 0)
goto done;
if (!rebase->head_detached)
@@ -1333,8 +1334,8 @@ static int rebase_copy_notes(
if (strlen(fromstr) != GIT_OID_SHA1_HEXSIZE ||
strlen(tostr) != GIT_OID_SHA1_HEXSIZE ||
- git_oid_fromstr(&from, fromstr) < 0 ||
- git_oid_fromstr(&to, tostr) < 0)
+ git_oid_fromstr(&from, fromstr, GIT_OID_SHA1) < 0 ||
+ git_oid_fromstr(&to, tostr, GIT_OID_SHA1) < 0)
goto on_error;
if ((error = rebase_copy_note(rebase, notes_ref.ptr, &from, &to, committer)) < 0)
diff --git a/src/libgit2/refdb_fs.c b/src/libgit2/refdb_fs.c
index 0d0656a..87fcb91 100644
--- a/src/libgit2/refdb_fs.c
+++ b/src/libgit2/refdb_fs.c
@@ -158,7 +158,7 @@ static int packed_reload(refdb_fs_backend *backend)
/* parse "<OID> <refname>\n" */
- if (git_oid_fromstr(&oid, scan) < 0)
+ if (git_oid_fromstr(&oid, scan, GIT_OID_SHA1) < 0)
goto parse_failed;
scan += GIT_OID_SHA1_HEXSIZE;
@@ -179,7 +179,7 @@ static int packed_reload(refdb_fs_backend *backend)
/* look for optional "^<OID>\n" */
if (*scan == '^') {
- if (git_oid_fromstr(&oid, scan + 1) < 0)
+ if (git_oid_fromstr(&oid, scan + 1, GIT_OID_SHA1) < 0)
goto parse_failed;
scan += GIT_OID_SHA1_HEXSIZE + 1;
@@ -222,7 +222,7 @@ static int loose_parse_oid(
goto corrupted;
/* we need to get 40 OID characters from the file */
- if (git_oid_fromstr(oid, str) < 0)
+ if (git_oid_fromstr(oid, str, GIT_OID_SHA1) < 0)
goto corrupted;
/* If the file is longer than 40 chars, the 41st must be a space */
@@ -709,7 +709,7 @@ static int packed_lookup(
git_oid oid, peel, *peel_ptr = NULL;
if (data_end - rec < GIT_OID_SHA1_HEXSIZE ||
- git_oid_fromstr(&oid, rec) < 0) {
+ git_oid_fromstr(&oid, rec, GIT_OID_SHA1) < 0) {
goto parse_failed;
}
rec += GIT_OID_SHA1_HEXSIZE + 1;
@@ -725,7 +725,7 @@ static int packed_lookup(
if (*rec == '^') {
rec++;
if (data_end - rec < GIT_OID_SHA1_HEXSIZE ||
- git_oid_fromstr(&peel, rec) < 0) {
+ git_oid_fromstr(&peel, rec, GIT_OID_SHA1) < 0) {
goto parse_failed;
}
peel_ptr = &peel;
diff --git a/src/libgit2/reflog.c b/src/libgit2/reflog.c
index ca6d538..1b03e83 100644
--- a/src/libgit2/reflog.c
+++ b/src/libgit2/reflog.c
@@ -104,7 +104,7 @@ int git_reflog_append(git_reflog *reflog, const git_oid *new_oid, const git_sign
previous = git_reflog_entry_byindex(reflog, 0);
if (previous == NULL)
- git_oid_fromstr(&entry->oid_old, GIT_OID_SHA1_HEXZERO);
+ git_oid_fromstr(&entry->oid_old, GIT_OID_SHA1_HEXZERO, GIT_OID_SHA1);
else
git_oid_cpy(&entry->oid_old, &previous->oid_cur);
@@ -218,8 +218,10 @@ int git_reflog_drop(git_reflog *reflog, size_t idx, int rewrite_previous_entry)
/* If the oldest entry has just been removed... */
if (idx == entrycount - 1) {
+ git_oid zero = GIT_OID_SHA1_ZERO;
+
/* ...clear the oid_old member of the "new" oldest entry */
- if (git_oid_fromstr(&entry->oid_old, GIT_OID_SHA1_HEXZERO) < 0)
+ if (git_oid_cpy(&entry->oid_old, &zero) < 0)
return -1;
return 0;
diff --git a/src/libgit2/refs.c b/src/libgit2/refs.c
index 5c875b9..8e4abac 100644
--- a/src/libgit2/refs.c
+++ b/src/libgit2/refs.c
@@ -86,6 +86,8 @@ git_reference *git_reference__alloc(
if (peel != NULL)
git_oid_cpy(&ref->peel, peel);
+ else
+ git_oid_clear(&ref->peel, GIT_OID_SHA1);
return ref;
}
diff --git a/src/libgit2/remote.c b/src/libgit2/remote.c
index 6180559..3330347 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, sizeof(git_oid));
+ git_oid_clear(&old, GIT_OID_SHA1);
error = 0;
if (autotag && (error = git_vector_insert(update_heads, head)) < 0)
@@ -1892,10 +1892,10 @@ static int update_tips_for_spec(
}
/* Handle specified oid sources */
- if (git_oid__is_hexstr(spec->src)) {
+ if (git_oid__is_hexstr(spec->src, GIT_OID_SHA1)) {
git_oid id;
- if ((error = git_oid_fromstr(&id, spec->src)) < 0)
+ if ((error = git_oid_fromstr(&id, spec->src, GIT_OID_SHA1)) < 0)
goto on_error;
if (spec->dst &&
diff --git a/src/libgit2/revparse.c b/src/libgit2/revparse.c
index 3226e28..1f3dc6c 100644
--- a/src/libgit2/revparse.c
+++ b/src/libgit2/revparse.c
@@ -19,7 +19,7 @@ static int maybe_sha_or_abbrev(git_object **out, git_repository *repo, const cha
{
git_oid oid;
- if (git_oid_fromstrn(&oid, spec, speclen) < 0)
+ if (git_oid_fromstrn(&oid, spec, speclen, GIT_OID_SHA1) < 0)
return GIT_ENOTFOUND;
return git_object_lookup_prefix(out, repo, &oid, speclen, GIT_OBJECT_ANY);
diff --git a/src/libgit2/tag.c b/src/libgit2/tag.c
index 28aa6ec..e780279 100644
--- a/src/libgit2/tag.c
+++ b/src/libgit2/tag.c
@@ -76,7 +76,7 @@ static int tag_parse(git_tag *tag, const char *buffer, const char *buffer_end)
int error;
if (git_object__parse_oid_header(&tag->target,
- &buffer, buffer_end, "object ") < 0)
+ &buffer, buffer_end, "object ", GIT_OID_SHA1) < 0)
return tag_error("object field invalid");
if (buffer + 5 >= buffer_end)
diff --git a/src/libgit2/transports/smart_pkt.c b/src/libgit2/transports/smart_pkt.c
index 3b0c344..b11417f 100644
--- a/src/libgit2/transports/smart_pkt.c
+++ b/src/libgit2/transports/smart_pkt.c
@@ -53,7 +53,8 @@ static int ack_pkt(git_pkt **out, const char *line, size_t len)
line += 4;
len -= 4;
- if (len < GIT_OID_SHA1_HEXSIZE || git_oid_fromstr(&pkt->oid, line) < 0)
+ if (len < GIT_OID_SHA1_HEXSIZE ||
+ git_oid_fromstr(&pkt->oid, line, GIT_OID_SHA1) < 0)
goto out_err;
line += GIT_OID_SHA1_HEXSIZE;
len -= GIT_OID_SHA1_HEXSIZE;
@@ -222,7 +223,8 @@ static int ref_pkt(git_pkt **out, const char *line, size_t len)
GIT_ERROR_CHECK_ALLOC(pkt);
pkt->type = GIT_PKT_REF;
- if (len < GIT_OID_SHA1_HEXSIZE || git_oid_fromstr(&pkt->head.oid, line) < 0)
+ if (len < GIT_OID_SHA1_HEXSIZE ||
+ git_oid_fromstr(&pkt->head.oid, line, GIT_OID_SHA1) < 0)
goto out_err;
line += GIT_OID_SHA1_HEXSIZE;
len -= GIT_OID_SHA1_HEXSIZE;
diff --git a/src/libgit2/tree-cache.c b/src/libgit2/tree-cache.c
index 966e7df..59d124c 100644
--- a/src/libgit2/tree-cache.c
+++ b/src/libgit2/tree-cache.c
@@ -114,7 +114,7 @@ static int read_tree_internal(git_tree_cache **out,
if (buffer + GIT_OID_SHA1_SIZE > buffer_end)
goto corrupted;
- git_oid_fromraw(&tree->oid, (const unsigned char *)buffer);
+ git_oid_fromraw(&tree->oid, (const unsigned char *)buffer, GIT_OID_SHA1);
buffer += GIT_OID_SHA1_SIZE;
}
diff --git a/src/libgit2/tree.c b/src/libgit2/tree.c
index 9d3c67d..0676192 100644
--- a/src/libgit2/tree.c
+++ b/src/libgit2/tree.c
@@ -425,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;
- git_oid_fromraw(&entry->oid, ((unsigned char *) buffer + filename_len + 1));
+ git_oid_fromraw(&entry->oid, ((unsigned char *) buffer + filename_len + 1), GIT_OID_SHA1);
}
buffer += filename_len + 1;
diff --git a/tests/libgit2/apply/apply_helpers.c b/tests/libgit2/apply/apply_helpers.c
index 91cc51a..d00e9bd 100644
--- a/tests/libgit2/apply/apply_helpers.c
+++ b/tests/libgit2/apply/apply_helpers.c
@@ -14,7 +14,7 @@ static int iterator_compare(const git_index_entry *entry, void *_data)
struct iterator_compare_data *data = (struct iterator_compare_data *)_data;
cl_assert_equal_i(GIT_INDEX_ENTRY_STAGE(entry), data->expected[data->idx].stage);
- cl_git_pass(git_oid_fromstr(&expected_id, data->expected[data->idx].oid_str));
+ cl_git_pass(git_oid_fromstr(&expected_id, data->expected[data->idx].oid_str, GIT_OID_SHA1));
cl_assert_equal_oid(&entry->id, &expected_id);
cl_assert_equal_i(entry->mode, data->expected[data->idx].mode);
cl_assert_equal_s(entry->path, data->expected[data->idx].path);
diff --git a/tests/libgit2/apply/both.c b/tests/libgit2/apply/both.c
index 1089632..68a04b8 100644
--- a/tests/libgit2/apply/both.c
+++ b/tests/libgit2/apply/both.c
@@ -12,7 +12,7 @@ void test_apply_both__initialize(void)
repo = cl_git_sandbox_init(TEST_REPO_PATH);
- git_oid_fromstr(&oid, "539bd011c4822c560c1d17cab095006b7a10f707");
+ git_oid_fromstr(&oid, "539bd011c4822c560c1d17cab095006b7a10f707", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &oid));
cl_git_pass(git_reset(repo, (git_object *)commit, GIT_RESET_HARD, NULL));
git_commit_free(commit);
@@ -42,8 +42,8 @@ void test_apply_both__generated_diff(void)
size_t both_expected_cnt = sizeof(both_expected) /
sizeof(struct merge_index_entry);
- git_oid_fromstr(&a_oid, "539bd011c4822c560c1d17cab095006b7a10f707");
- git_oid_fromstr(&b_oid, "7c7bf85e978f1d18c0566f702d2cb7766b9c8d4f");
+ git_oid_fromstr(&a_oid, "539bd011c4822c560c1d17cab095006b7a10f707", GIT_OID_SHA1);
+ git_oid_fromstr(&b_oid, "7c7bf85e978f1d18c0566f702d2cb7766b9c8d4f", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&a_commit, repo, &a_oid));
cl_git_pass(git_commit_lookup(&b_commit, repo, &b_oid));
@@ -192,7 +192,7 @@ void test_apply_both__index_must_match_workdir(void)
memset(&idx_entry, 0, sizeof(git_index_entry));
idx_entry.mode = 0100644;
idx_entry.path = "asparagus.txt";
- cl_git_pass(git_oid_fromstr(&idx_entry.id, "06d3fefb8726ab1099acc76e02dfb85e034b2538"));
+ cl_git_pass(git_oid_fromstr(&idx_entry.id, "06d3fefb8726ab1099acc76e02dfb85e034b2538", GIT_OID_SHA1));
cl_git_pass(git_index_add(index, &idx_entry));
cl_git_pass(git_index_write(index));
@@ -290,7 +290,7 @@ void test_apply_both__keeps_nonconflicting_changes(void)
memset(&idx_entry, 0, sizeof(git_index_entry));
idx_entry.mode = 0100644;
idx_entry.path = "beef.txt";
- cl_git_pass(git_oid_fromstr(&idx_entry.id, "898d12687fb35be271c27c795a6b32c8b51da79e"));
+ cl_git_pass(git_oid_fromstr(&idx_entry.id, "898d12687fb35be271c27c795a6b32c8b51da79e", GIT_OID_SHA1));
cl_git_pass(git_index_add(index, &idx_entry));
cl_git_pass(git_index_remove(index, "bouilli.txt", 0));
@@ -386,7 +386,7 @@ void test_apply_both__honors_crlf_attributes(void)
cl_git_rmfile("merge-recursive/asparagus.txt");
cl_git_rmfile("merge-recursive/veal.txt");
- git_oid_fromstr(&oid, "539bd011c4822c560c1d17cab095006b7a10f707");
+ git_oid_fromstr(&oid, "539bd011c4822c560c1d17cab095006b7a10f707", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &oid));
cl_git_pass(git_reset(repo, (git_object *)commit, GIT_RESET_HARD, NULL));
git_commit_free(commit);
diff --git a/tests/libgit2/apply/callbacks.c b/tests/libgit2/apply/callbacks.c
index 1b759dc..7edfd41 100644
--- a/tests/libgit2/apply/callbacks.c
+++ b/tests/libgit2/apply/callbacks.c
@@ -12,7 +12,7 @@ void test_apply_callbacks__initialize(void)
repo = cl_git_sandbox_init(TEST_REPO_PATH);
- git_oid_fromstr(&oid, "539bd011c4822c560c1d17cab095006b7a10f707");
+ git_oid_fromstr(&oid, "539bd011c4822c560c1d17cab095006b7a10f707", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &oid));
cl_git_pass(git_reset(repo, (git_object *)commit, GIT_RESET_HARD, NULL));
git_commit_free(commit);
diff --git a/tests/libgit2/apply/check.c b/tests/libgit2/apply/check.c
index 9e42365..79a4181 100644
--- a/tests/libgit2/apply/check.c
+++ b/tests/libgit2/apply/check.c
@@ -12,7 +12,7 @@ void test_apply_check__initialize(void)
repo = cl_git_sandbox_init(TEST_REPO_PATH);
- git_oid_fromstr(&oid, "539bd011c4822c560c1d17cab095006b7a10f707");
+ git_oid_fromstr(&oid, "539bd011c4822c560c1d17cab095006b7a10f707", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &oid));
cl_git_pass(git_reset(repo, (git_object *)commit, GIT_RESET_HARD, NULL));
git_commit_free(commit);
@@ -32,8 +32,8 @@ void test_apply_check__generate_diff(void)
git_diff_options diff_opts = GIT_DIFF_OPTIONS_INIT;
git_apply_options opts = GIT_APPLY_OPTIONS_INIT;
- cl_git_pass(git_oid_fromstr(&a_oid, "539bd011c4822c560c1d17cab095006b7a10f707"));
- cl_git_pass(git_oid_fromstr(&b_oid, "7c7bf85e978f1d18c0566f702d2cb7766b9c8d4f"));
+ cl_git_pass(git_oid_fromstr(&a_oid, "539bd011c4822c560c1d17cab095006b7a10f707", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&b_oid, "7c7bf85e978f1d18c0566f702d2cb7766b9c8d4f", GIT_OID_SHA1));
cl_git_pass(git_commit_lookup(&a_commit, repo, &a_oid));
cl_git_pass(git_commit_lookup(&b_commit, repo, &b_oid));
diff --git a/tests/libgit2/apply/index.c b/tests/libgit2/apply/index.c
index 9c9094c..43bb89f 100644
--- a/tests/libgit2/apply/index.c
+++ b/tests/libgit2/apply/index.c
@@ -12,7 +12,7 @@ void test_apply_index__initialize(void)
repo = cl_git_sandbox_init(TEST_REPO_PATH);
- git_oid_fromstr(&oid, "539bd011c4822c560c1d17cab095006b7a10f707");
+ git_oid_fromstr(&oid, "539bd011c4822c560c1d17cab095006b7a10f707", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &oid));
cl_git_pass(git_reset(repo, (git_object *)commit, GIT_RESET_HARD, NULL));
git_commit_free(commit);
@@ -42,8 +42,8 @@ void test_apply_index__generate_diff(void)
size_t index_expected_cnt = sizeof(index_expected) /
sizeof(struct merge_index_entry);
- git_oid_fromstr(&a_oid, "539bd011c4822c560c1d17cab095006b7a10f707");
- git_oid_fromstr(&b_oid, "7c7bf85e978f1d18c0566f702d2cb7766b9c8d4f");
+ git_oid_fromstr(&a_oid, "539bd011c4822c560c1d17cab095006b7a10f707", GIT_OID_SHA1);
+ git_oid_fromstr(&b_oid, "7c7bf85e978f1d18c0566f702d2cb7766b9c8d4f", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&a_commit, repo, &a_oid));
cl_git_pass(git_commit_lookup(&b_commit, repo, &b_oid));
@@ -233,7 +233,7 @@ void test_apply_index__keeps_nonconflicting_changes(void)
memset(&idx_entry, 0, sizeof(git_index_entry));
idx_entry.mode = 0100644;
idx_entry.path = "beef.txt";
- cl_git_pass(git_oid_fromstr(&idx_entry.id, "898d12687fb35be271c27c795a6b32c8b51da79e"));
+ cl_git_pass(git_oid_fromstr(&idx_entry.id, "898d12687fb35be271c27c795a6b32c8b51da79e", GIT_OID_SHA1));
cl_git_pass(git_index_add(index, &idx_entry));
cl_git_pass(git_index_remove(index, "bouilli.txt", 0));
@@ -279,7 +279,7 @@ void test_apply_index__can_apply_nonconflicting_file_changes(void)
memset(&idx_entry, 0, sizeof(git_index_entry));
idx_entry.mode = 0100644;
idx_entry.path = "asparagus.txt";
- cl_git_pass(git_oid_fromstr(&idx_entry.id, "06d3fefb8726ab1099acc76e02dfb85e034b2538"));
+ cl_git_pass(git_oid_fromstr(&idx_entry.id, "06d3fefb8726ab1099acc76e02dfb85e034b2538", GIT_OID_SHA1));
cl_git_pass(git_index_add(index, &idx_entry));
cl_git_pass(git_index_write(index));
diff --git a/tests/libgit2/apply/tree.c b/tests/libgit2/apply/tree.c
index 5154f13..bc73893 100644
--- a/tests/libgit2/apply/tree.c
+++ b/tests/libgit2/apply/tree.c
@@ -35,8 +35,8 @@ void test_apply_tree__one(void)
{ 0100644, "a7b066537e6be7109abfe4ff97b675d4e077da20", 0, "veal.txt" },
};
- git_oid_fromstr(&a_oid, "539bd011c4822c560c1d17cab095006b7a10f707");
- git_oid_fromstr(&b_oid, "7c7bf85e978f1d18c0566f702d2cb7766b9c8d4f");
+ git_oid_fromstr(&a_oid, "539bd011c4822c560c1d17cab095006b7a10f707", GIT_OID_SHA1);
+ git_oid_fromstr(&b_oid, "7c7bf85e978f1d18c0566f702d2cb7766b9c8d4f", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&a_commit, repo, &a_oid));
cl_git_pass(git_commit_lookup(&b_commit, repo, &b_oid));
@@ -75,7 +75,7 @@ void test_apply_tree__adds_file(void)
{ 0100644, "94d2c01087f48213bd157222d54edfefd77c9bba", 0, "veal.txt" },
};
- git_oid_fromstr(&a_oid, "539bd011c4822c560c1d17cab095006b7a10f707");
+ git_oid_fromstr(&a_oid, "539bd011c4822c560c1d17cab095006b7a10f707", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&a_commit, repo, &a_oid));
diff --git a/tests/libgit2/apply/workdir.c b/tests/libgit2/apply/workdir.c
index d0d9c1a..bcc4510 100644
--- a/tests/libgit2/apply/workdir.c
+++ b/tests/libgit2/apply/workdir.c
@@ -12,7 +12,7 @@ void test_apply_workdir__initialize(void)
repo = cl_git_sandbox_init(TEST_REPO_PATH);
- git_oid_fromstr(&oid, "539bd011c4822c560c1d17cab095006b7a10f707");
+ git_oid_fromstr(&oid, "539bd011c4822c560c1d17cab095006b7a10f707", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &oid));
cl_git_pass(git_reset(repo, (git_object *)commit, GIT_RESET_HARD, NULL));
git_commit_free(commit);
@@ -42,8 +42,8 @@ void test_apply_workdir__generated_diff(void)
size_t workdir_expected_cnt = sizeof(workdir_expected) /
sizeof(struct merge_index_entry);
- git_oid_fromstr(&a_oid, "539bd011c4822c560c1d17cab095006b7a10f707");
- git_oid_fromstr(&b_oid, "7c7bf85e978f1d18c0566f702d2cb7766b9c8d4f"); cl_git_pass(git_commit_lookup(&a_commit, repo, &a_oid));
+ git_oid_fromstr(&a_oid, "539bd011c4822c560c1d17cab095006b7a10f707", GIT_OID_SHA1);
+ git_oid_fromstr(&b_oid, "7c7bf85e978f1d18c0566f702d2cb7766b9c8d4f", GIT_OID_SHA1); cl_git_pass(git_commit_lookup(&a_commit, repo, &a_oid));
cl_git_pass(git_commit_lookup(&b_commit, repo, &b_oid));
cl_git_pass(git_commit_tree(&a_tree, a_commit));
@@ -171,7 +171,7 @@ void test_apply_workdir__modified_index_with_unmodified_workdir_is_ok(void)
idx_entry.mode = 0100644;
idx_entry.path = "veal.txt";
- cl_git_pass(git_oid_fromstr(&idx_entry.id, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d"));
+ cl_git_pass(git_oid_fromstr(&idx_entry.id, "ffb36e513f5fdf8a6ba850a20142676a2ac4807d", GIT_OID_SHA1));
cl_git_pass(git_index_add(index, &idx_entry));
cl_git_pass(git_index_remove(index, "asparagus.txt", 0));
diff --git a/tests/libgit2/checkout/binaryunicode.c b/tests/libgit2/checkout/binaryunicode.c
index edb5cfa..255b6e0 100644
--- a/tests/libgit2/checkout/binaryunicode.c
+++ b/tests/libgit2/checkout/binaryunicode.c
@@ -35,12 +35,12 @@ static void execute_test(void)
git_commit_free(commit);
/* Verify that the lenna.jpg file was checked out correctly */
- cl_git_pass(git_oid_fromstr(&check, "8ab005d890fe53f65eda14b23672f60d9f4ec5a1"));
+ cl_git_pass(git_oid_fromstr(&check, "8ab005d890fe53f65eda14b23672f60d9f4ec5a1", GIT_OID_SHA1));
cl_git_pass(git_odb_hashfile(&oid, "binaryunicode/lenna.jpg", GIT_OBJECT_BLOB));
cl_assert_equal_oid(&oid, &check);
/* Verify that the text file was checked out correctly */
- cl_git_pass(git_oid_fromstr(&check, "965b223880dd4249e2c66a0cc0b4cffe1dc40f5a"));
+ cl_git_pass(git_oid_fromstr(&check, "965b223880dd4249e2c66a0cc0b4cffe1dc40f5a", GIT_OID_SHA1));
cl_git_pass(git_odb_hashfile(&oid, "binaryunicode/utf16_withbom_noeol_crlf.txt", GIT_OBJECT_BLOB));
cl_assert_equal_oid(&oid, &check);
}
diff --git a/tests/libgit2/checkout/conflict.c b/tests/libgit2/checkout/conflict.c
index 3083894..912b9e9 100644
--- a/tests/libgit2/checkout/conflict.c
+++ b/tests/libgit2/checkout/conflict.c
@@ -104,7 +104,7 @@ static void create_index(struct checkout_index_entry *entries, size_t entries_le
entry.mode = entries[i].mode;
GIT_INDEX_ENTRY_STAGE_SET(&entry, entries[i].stage);
- git_oid_fromstr(&entry.id, entries[i].oid_str);
+ git_oid_fromstr(&entry.id, entries[i].oid_str, GIT_OID_SHA1);
entry.path = entries[i].path;
cl_git_pass(git_index_add(g_index, &entry));
@@ -155,7 +155,7 @@ static void ensure_workdir_oid(const char *path, const char *oid_str)
{
git_oid expected, actual;
- cl_git_pass(git_oid_fromstr(&expected, oid_str));
+ cl_git_pass(git_oid_fromstr(&expected, oid_str, GIT_OID_SHA1));
cl_git_pass(git_repository_hashfile(&actual, g_repo, path, GIT_OBJECT_BLOB, NULL));
cl_assert_equal_oid(&expected, &actual);
}
diff --git a/tests/libgit2/checkout/index.c b/tests/libgit2/checkout/index.c
index 6a80d22..3aa90b4 100644
--- a/tests/libgit2/checkout/index.c
+++ b/tests/libgit2/checkout/index.c
@@ -791,15 +791,15 @@ static void add_conflict(git_index *index, const char *path)
entry.mode = 0100644;
entry.path = path;
- git_oid_fromstr(&entry.id, "d427e0b2e138501a3d15cc376077a3631e15bd46");
+ git_oid_fromstr(&entry.id, "d427e0b2e138501a3d15cc376077a3631e15bd46", GIT_OID_SHA1);
GIT_INDEX_ENTRY_STAGE_SET(&entry, 1);
cl_git_pass(git_index_add(index, &entry));
- git_oid_fromstr(&entry.id, "4e886e602529caa9ab11d71f86634bd1b6e0de10");
+ git_oid_fromstr(&entry.id, "4e886e602529caa9ab11d71f86634bd1b6e0de10", GIT_OID_SHA1);
GIT_INDEX_ENTRY_STAGE_SET(&entry, 2);
cl_git_pass(git_index_add(index, &entry));
- git_oid_fromstr(&entry.id, "2bd0a343aeef7a2cf0d158478966a6e587ff3863");
+ git_oid_fromstr(&entry.id, "2bd0a343aeef7a2cf0d158478966a6e587ff3863", GIT_OID_SHA1);
GIT_INDEX_ENTRY_STAGE_SET(&entry, 3);
cl_git_pass(git_index_add(index, &entry));
}
diff --git a/tests/libgit2/checkout/tree.c b/tests/libgit2/checkout/tree.c
index d4b57f5..b4b61a2 100644
--- a/tests/libgit2/checkout/tree.c
+++ b/tests/libgit2/checkout/tree.c
@@ -139,8 +139,8 @@ void test_checkout_tree__doesnt_write_unrequested_files_to_worktree(void)
git_commit* p_chomped_commit;
git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;
- git_oid_fromstr(&master_oid, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750");
- git_oid_fromstr(&chomped_oid, "e90810b8df3e80c413d903f631643c716887138d");
+ git_oid_fromstr(&master_oid, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", GIT_OID_SHA1);
+ git_oid_fromstr(&chomped_oid, "e90810b8df3e80c413d903f631643c716887138d", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&p_master_commit, g_repo, &master_oid));
cl_git_pass(git_commit_lookup(&p_chomped_commit, g_repo, &chomped_oid));
@@ -615,7 +615,7 @@ void test_checkout_tree__donot_update_deleted_file_by_default(void)
cl_git_pass(git_repository_index(&index, g_repo));
- cl_git_pass(git_oid_fromstr(&old_id, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644"));
+ cl_git_pass(git_oid_fromstr(&old_id, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644", GIT_OID_SHA1));
cl_git_pass(git_commit_lookup(&old_commit, g_repo, &old_id));
cl_git_pass(git_reset(g_repo, (git_object *)old_commit, GIT_RESET_HARD, NULL));
@@ -625,7 +625,7 @@ void test_checkout_tree__donot_update_deleted_file_by_default(void)
cl_assert(!git_fs_path_exists("testrepo/branch_file.txt"));
- cl_git_pass(git_oid_fromstr(&new_id, "099fabac3a9ea935598528c27f866e34089c2eff"));
+ cl_git_pass(git_oid_fromstr(&new_id, "099fabac3a9ea935598528c27f866e34089c2eff", GIT_OID_SHA1));
cl_git_pass(git_commit_lookup(&new_commit, g_repo, &new_id));
@@ -941,16 +941,16 @@ static void create_conflict(const char *path)
memset(&entry, 0x0, sizeof(git_index_entry));
entry.mode = 0100644;
GIT_INDEX_ENTRY_STAGE_SET(&entry, 1);
- git_oid_fromstr(&entry.id, "d427e0b2e138501a3d15cc376077a3631e15bd46");
+ git_oid_fromstr(&entry.id, "d427e0b2e138501a3d15cc376077a3631e15bd46", GIT_OID_SHA1);
entry.path = path;
cl_git_pass(git_index_add(index, &entry));
GIT_INDEX_ENTRY_STAGE_SET(&entry, 2);
- git_oid_fromstr(&entry.id, "ee3fa1b8c00aff7fe02065fdb50864bb0d932ccf");
+ git_oid_fromstr(&entry.id, "ee3fa1b8c00aff7fe02065fdb50864bb0d932ccf", GIT_OID_SHA1);
cl_git_pass(git_index_add(index, &entry));
GIT_INDEX_ENTRY_STAGE_SET(&entry, 3);
- git_oid_fromstr(&entry.id, "2bd0a343aeef7a2cf0d158478966a6e587ff3863");
+ git_oid_fromstr(&entry.id, "2bd0a343aeef7a2cf0d158478966a6e587ff3863", GIT_OID_SHA1);
cl_git_pass(git_index_add(index, &entry));
cl_git_pass(git_index_write(index));
@@ -988,7 +988,7 @@ void test_checkout_tree__filemode_preserved_in_index(void)
cl_git_pass(git_repository_index(&index, g_repo));
/* test a freshly added executable */
- cl_git_pass(git_oid_fromstr(&executable_oid, "afe4393b2b2a965f06acf2ca9658eaa01e0cd6b6"));
+ cl_git_pass(git_oid_fromstr(&executable_oid, "afe4393b2b2a965f06acf2ca9658eaa01e0cd6b6", GIT_OID_SHA1));
cl_git_pass(git_commit_lookup(&commit, g_repo, &executable_oid));
cl_git_pass(git_checkout_tree(g_repo, (const git_object *)commit, &opts));
@@ -999,7 +999,7 @@ void test_checkout_tree__filemode_preserved_in_index(void)
/* Now start with a commit which has a text file */
- cl_git_pass(git_oid_fromstr(&executable_oid, "cf80f8de9f1185bf3a05f993f6121880dd0cfbc9"));
+ cl_git_pass(git_oid_fromstr(&executable_oid, "cf80f8de9f1185bf3a05f993f6121880dd0cfbc9", GIT_OID_SHA1));
cl_git_pass(git_commit_lookup(&commit, g_repo, &executable_oid));
cl_git_pass(git_checkout_tree(g_repo, (const git_object *)commit, &opts));
@@ -1010,7 +1010,7 @@ void test_checkout_tree__filemode_preserved_in_index(void)
/* And then check out to a commit which converts the text file to an executable */
- cl_git_pass(git_oid_fromstr(&executable_oid, "144344043ba4d4a405da03de3844aa829ae8be0e"));
+ cl_git_pass(git_oid_fromstr(&executable_oid, "144344043ba4d4a405da03de3844aa829ae8be0e", GIT_OID_SHA1));
cl_git_pass(git_commit_lookup(&commit, g_repo, &executable_oid));
cl_git_pass(git_checkout_tree(g_repo, (const git_object *)commit, &opts));
@@ -1021,7 +1021,7 @@ void test_checkout_tree__filemode_preserved_in_index(void)
/* Finally, check out the text file again and check that the exec bit is cleared */
- cl_git_pass(git_oid_fromstr(&executable_oid, "cf80f8de9f1185bf3a05f993f6121880dd0cfbc9"));
+ cl_git_pass(git_oid_fromstr(&executable_oid, "cf80f8de9f1185bf3a05f993f6121880dd0cfbc9", GIT_OID_SHA1));
cl_git_pass(git_commit_lookup(&commit, g_repo, &executable_oid));
cl_git_pass(git_checkout_tree(g_repo, (const git_object *)commit, &opts));
@@ -1063,7 +1063,7 @@ void test_checkout_tree__filemode_preserved_in_workdir(void)
opts.checkout_strategy = GIT_CHECKOUT_FORCE;
/* test a freshly added executable */
- cl_git_pass(git_oid_fromstr(&executable_oid, "afe4393b2b2a965f06acf2ca9658eaa01e0cd6b6"));
+ cl_git_pass(git_oid_fromstr(&executable_oid, "afe4393b2b2a965f06acf2ca9658eaa01e0cd6b6", GIT_OID_SHA1));
cl_git_pass(git_commit_lookup(&commit, g_repo, &executable_oid));
cl_git_pass(git_checkout_tree(g_repo, (const git_object *)commit, &opts));
@@ -1073,7 +1073,7 @@ void test_checkout_tree__filemode_preserved_in_workdir(void)
/* Now start with a commit which has a text file */
- cl_git_pass(git_oid_fromstr(&executable_oid, "cf80f8de9f1185bf3a05f993f6121880dd0cfbc9"));
+ cl_git_pass(git_oid_fromstr(&executable_oid, "cf80f8de9f1185bf3a05f993f6121880dd0cfbc9", GIT_OID_SHA1));
cl_git_pass(git_commit_lookup(&commit, g_repo, &executable_oid));
cl_git_pass(git_checkout_tree(g_repo, (const git_object *)commit, &opts));
@@ -1083,7 +1083,7 @@ void test_checkout_tree__filemode_preserved_in_workdir(void)
/* And then check out to a commit which converts the text file to an executable */
- cl_git_pass(git_oid_fromstr(&executable_oid, "144344043ba4d4a405da03de3844aa829ae8be0e"));
+ cl_git_pass(git_oid_fromstr(&executable_oid, "144344043ba4d4a405da03de3844aa829ae8be0e", GIT_OID_SHA1));
cl_git_pass(git_commit_lookup(&commit, g_repo, &executable_oid));
cl_git_pass(git_checkout_tree(g_repo, (const git_object *)commit, &opts));
@@ -1093,7 +1093,7 @@ void test_checkout_tree__filemode_preserved_in_workdir(void)
/* Finally, check out the text file again and check that the exec bit is cleared */
- cl_git_pass(git_oid_fromstr(&executable_oid, "cf80f8de9f1185bf3a05f993f6121880dd0cfbc9"));
+ cl_git_pass(git_oid_fromstr(&executable_oid, "cf80f8de9f1185bf3a05f993f6121880dd0cfbc9", GIT_OID_SHA1));
cl_git_pass(git_commit_lookup(&commit, g_repo, &executable_oid));
cl_git_pass(git_checkout_tree(g_repo, (const git_object *)commit, &opts));
@@ -1112,7 +1112,7 @@ void test_checkout_tree__removes_conflicts(void)
git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;
git_index *index;
- cl_git_pass(git_oid_fromstr(&commit_id, "afe4393b2b2a965f06acf2ca9658eaa01e0cd6b6"));
+ cl_git_pass(git_oid_fromstr(&commit_id, "afe4393b2b2a965f06acf2ca9658eaa01e0cd6b6", GIT_OID_SHA1));
cl_git_pass(git_commit_lookup(&commit, g_repo, &commit_id));
opts.checkout_strategy = GIT_CHECKOUT_FORCE;
@@ -1155,7 +1155,7 @@ void test_checkout_tree__removes_conflicts_only_by_pathscope(void)
git_index *index;
const char *path = "executable.txt";
- cl_git_pass(git_oid_fromstr(&commit_id, "afe4393b2b2a965f06acf2ca9658eaa01e0cd6b6"));
+ cl_git_pass(git_oid_fromstr(&commit_id, "afe4393b2b2a965f06acf2ca9658eaa01e0cd6b6", GIT_OID_SHA1));
cl_git_pass(git_commit_lookup(&commit, g_repo, &commit_id));
opts.checkout_strategy = GIT_CHECKOUT_FORCE;
@@ -1583,7 +1583,7 @@ static void modify_index_ondisk(void)
cl_git_pass(git_repository_open(&other_repo, git_repository_workdir(g_repo)));
cl_git_pass(git_repository_index(&other_index, other_repo));
- cl_git_pass(git_oid_fromstr(&entry.id, "1385f264afb75a56a5bec74243be9b367ba4ca08"));
+ cl_git_pass(git_oid_fromstr(&entry.id, "1385f264afb75a56a5bec74243be9b367ba4ca08", GIT_OID_SHA1));
entry.mode = 0100644;
entry.path = "README";
diff --git a/tests/libgit2/checkout/typechange.c b/tests/libgit2/checkout/typechange.c
index b888843..a1125de 100644
--- a/tests/libgit2/checkout/typechange.c
+++ b/tests/libgit2/checkout/typechange.c
@@ -319,7 +319,7 @@ void test_checkout_typechange__status_char(void)
git_diff_options diffopts = GIT_DIFF_OPTIONS_INIT;
char expected[8] = {'M', 'M', 'R', 'T', 'D', 'R', 'A', 'R'};
- git_oid_fromstr(&oid, "9b19edf33a03a0c59cdfc113bfa5c06179bf9b1a");
+ git_oid_fromstr(&oid, "9b19edf33a03a0c59cdfc113bfa5c06179bf9b1a", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, g_repo, &oid));
diffopts.flags |= GIT_DIFF_INCLUDE_TYPECHANGE;
cl_git_pass(git_diff__commit(&diff, g_repo, commit, &diffopts));
diff --git a/tests/libgit2/cherrypick/bare.c b/tests/libgit2/cherrypick/bare.c
index f90ce02..45054a7 100644
--- a/tests/libgit2/cherrypick/bare.c
+++ b/tests/libgit2/cherrypick/bare.c
@@ -32,10 +32,10 @@ void test_cherrypick_bare__automerge(void)
{ 0100644, "df6b290e0bd6a89b01d69f66687e8abf385283ca", 0, "file3.txt" },
};
- git_oid_fromstr(&head_oid, "d3d77487660ee3c0194ee01dc5eaf478782b1c7e");
+ git_oid_fromstr(&head_oid, "d3d77487660ee3c0194ee01dc5eaf478782b1c7e", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
- git_oid_fromstr(&cherry_oid, "cfc4f0999a8367568e049af4f72e452d40828a15");
+ git_oid_fromstr(&cherry_oid, "cfc4f0999a8367568e049af4f72e452d40828a15", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &cherry_oid));
cl_git_pass(git_cherrypick_commit(&index, repo, commit, head, 0, NULL));
@@ -62,10 +62,10 @@ void test_cherrypick_bare__conflicts(void)
{ 0100644, "e233b9ed408a95e9d4b65fec7fc34943a556deb2", 3, "file3.txt" },
};
- git_oid_fromstr(&head_oid, "bafbf6912c09505ac60575cd43d3f2aba3bd84d8");
+ git_oid_fromstr(&head_oid, "bafbf6912c09505ac60575cd43d3f2aba3bd84d8", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
- git_oid_fromstr(&cherry_oid, "e9b63f3655b2ad80c0ff587389b5a9589a3a7110");
+ git_oid_fromstr(&cherry_oid, "e9b63f3655b2ad80c0ff587389b5a9589a3a7110", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &cherry_oid));
cl_git_pass(git_cherrypick_commit(&index, repo, commit, head, 0, NULL));
@@ -89,10 +89,10 @@ void test_cherrypick_bare__orphan(void)
{ 0100644, "9ccb9bf50c011fd58dcbaa65df917bf79539717f", 0, "orphan.txt" },
};
- git_oid_fromstr(&head_oid, "d3d77487660ee3c0194ee01dc5eaf478782b1c7e");
+ git_oid_fromstr(&head_oid, "d3d77487660ee3c0194ee01dc5eaf478782b1c7e", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
- git_oid_fromstr(&cherry_oid, "74f06b5bfec6d33d7264f73606b57a7c0b963819");
+ git_oid_fromstr(&cherry_oid, "74f06b5bfec6d33d7264f73606b57a7c0b963819", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &cherry_oid));
cl_git_pass(git_cherrypick_commit(&index, repo, commit, head, 0, NULL));
diff --git a/tests/libgit2/cherrypick/workdir.c b/tests/libgit2/cherrypick/workdir.c
index 8fd1ecb..9256029 100644
--- a/tests/libgit2/cherrypick/workdir.c
+++ b/tests/libgit2/cherrypick/workdir.c
@@ -57,7 +57,7 @@ void test_cherrypick_workdir__automerge(void)
cl_git_pass(git_signature_new(&signature, "Picker", "picker@example.org", time(NULL), 0));
- git_oid_fromstr(&head_oid, "d3d77487660ee3c0194ee01dc5eaf478782b1c7e");
+ git_oid_fromstr(&head_oid, "d3d77487660ee3c0194ee01dc5eaf478782b1c7e", GIT_OID_SHA1);
for (i = 0; i < 3; ++i) {
git_commit *head = NULL, *commit = NULL;
@@ -67,7 +67,7 @@ void test_cherrypick_workdir__automerge(void)
cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL));
- git_oid_fromstr(&cherry_oid, cherrypick_oids[i]);
+ git_oid_fromstr(&cherry_oid, cherrypick_oids[i], GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &cherry_oid));
cl_git_pass(git_cherrypick(repo, commit, NULL));
@@ -110,7 +110,7 @@ void test_cherrypick_workdir__empty_result(void)
cl_git_pass(git_signature_new(&signature, "Picker", "picker@example.org", time(NULL), 0));
- git_oid_fromstr(&head_oid, "cfc4f0999a8367568e049af4f72e452d40828a15");
+ git_oid_fromstr(&head_oid, "cfc4f0999a8367568e049af4f72e452d40828a15", GIT_OID_SHA1);
/* Create an untracked file that should not conflict */
cl_git_mkfile(TEST_REPO_PATH "/file4.txt", "");
@@ -119,7 +119,7 @@ void test_cherrypick_workdir__empty_result(void)
cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL));
- git_oid_fromstr(&cherry_oid, cherrypick_oid);
+ git_oid_fromstr(&cherry_oid, cherrypick_oid, GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &cherry_oid));
cl_git_pass(git_cherrypick(repo, commit, NULL));
@@ -151,12 +151,12 @@ void test_cherrypick_workdir__conflicts(void)
{ 0100644, "e233b9ed408a95e9d4b65fec7fc34943a556deb2", 3, "file3.txt" },
};
- git_oid_fromstr(&head_oid, "bafbf6912c09505ac60575cd43d3f2aba3bd84d8");
+ git_oid_fromstr(&head_oid, "bafbf6912c09505ac60575cd43d3f2aba3bd84d8", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL));
- git_oid_fromstr(&cherry_oid, "e9b63f3655b2ad80c0ff587389b5a9589a3a7110");
+ git_oid_fromstr(&cherry_oid, "e9b63f3655b2ad80c0ff587389b5a9589a3a7110", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &cherry_oid));
cl_git_pass(git_cherrypick(repo, commit, NULL));
@@ -259,12 +259,12 @@ void test_cherrypick_workdir__conflict_use_ours(void)
/* leave the index in a conflicted state, but checkout "ours" to the workdir */
opts.checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_USE_OURS;
- git_oid_fromstr(&head_oid, "bafbf6912c09505ac60575cd43d3f2aba3bd84d8");
+ git_oid_fromstr(&head_oid, "bafbf6912c09505ac60575cd43d3f2aba3bd84d8", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL));
- git_oid_fromstr(&cherry_oid, "e9b63f3655b2ad80c0ff587389b5a9589a3a7110");
+ git_oid_fromstr(&cherry_oid, "e9b63f3655b2ad80c0ff587389b5a9589a3a7110", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &cherry_oid));
cl_git_pass(git_cherrypick(repo, commit, &opts));
@@ -302,11 +302,11 @@ void test_cherrypick_workdir__rename(void)
opts.merge_opts.flags |= GIT_MERGE_FIND_RENAMES;
opts.merge_opts.rename_threshold = 50;
- git_oid_fromstr(&head_oid, "cfc4f0999a8367568e049af4f72e452d40828a15");
+ git_oid_fromstr(&head_oid, "cfc4f0999a8367568e049af4f72e452d40828a15", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL));
- git_oid_fromstr(&cherry_oid, "2a26c7e88b285613b302ba76712bc998863f3cbc");
+ git_oid_fromstr(&cherry_oid, "2a26c7e88b285613b302ba76712bc998863f3cbc", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &cherry_oid));
cl_git_pass(git_cherrypick(repo, commit, &opts));
@@ -337,11 +337,11 @@ void test_cherrypick_workdir__both_renamed(void)
opts.merge_opts.flags |= GIT_MERGE_FIND_RENAMES;
opts.merge_opts.rename_threshold = 50;
- git_oid_fromstr(&head_oid, "44cd2ed2052c9c68f9a439d208e9614dc2a55c70");
+ git_oid_fromstr(&head_oid, "44cd2ed2052c9c68f9a439d208e9614dc2a55c70", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL));
- git_oid_fromstr(&cherry_oid, "2a26c7e88b285613b302ba76712bc998863f3cbc");
+ git_oid_fromstr(&cherry_oid, "2a26c7e88b285613b302ba76712bc998863f3cbc", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &cherry_oid));
cl_git_pass(git_cherrypick(repo, commit, &opts));
@@ -388,11 +388,11 @@ void test_cherrypick_workdir__merge_fails_without_mainline_specified(void)
git_commit *head, *commit;
git_oid head_oid, cherry_oid;
- git_oid_fromstr(&head_oid, "cfc4f0999a8367568e049af4f72e452d40828a15");
+ git_oid_fromstr(&head_oid, "cfc4f0999a8367568e049af4f72e452d40828a15", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL));
- git_oid_fromstr(&cherry_oid, "abe4603bc7cd5b8167a267e0e2418fd2348f8cff");
+ git_oid_fromstr(&cherry_oid, "abe4603bc7cd5b8167a267e0e2418fd2348f8cff", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &cherry_oid));
cl_must_fail(git_cherrypick(repo, commit, NULL));
@@ -420,11 +420,11 @@ void test_cherrypick_workdir__merge_first_parent(void)
opts.mainline = 1;
- git_oid_fromstr(&head_oid, "cfc4f0999a8367568e049af4f72e452d40828a15");
+ git_oid_fromstr(&head_oid, "cfc4f0999a8367568e049af4f72e452d40828a15", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL));
- git_oid_fromstr(&cherry_oid, "abe4603bc7cd5b8167a267e0e2418fd2348f8cff");
+ git_oid_fromstr(&cherry_oid, "abe4603bc7cd5b8167a267e0e2418fd2348f8cff", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &cherry_oid));
cl_git_pass(git_cherrypick(repo, commit, &opts));
@@ -452,11 +452,11 @@ void test_cherrypick_workdir__merge_second_parent(void)
opts.mainline = 2;
- git_oid_fromstr(&head_oid, "cfc4f0999a8367568e049af4f72e452d40828a15");
+ git_oid_fromstr(&head_oid, "cfc4f0999a8367568e049af4f72e452d40828a15", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL));
- git_oid_fromstr(&cherry_oid, "abe4603bc7cd5b8167a267e0e2418fd2348f8cff");
+ git_oid_fromstr(&cherry_oid, "abe4603bc7cd5b8167a267e0e2418fd2348f8cff", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &cherry_oid));
cl_git_pass(git_cherrypick(repo, commit, &opts));
diff --git a/tests/libgit2/commit/commit.c b/tests/libgit2/commit/commit.c
index fd574f7..ff57ffb 100644
--- a/tests/libgit2/commit/commit.c
+++ b/tests/libgit2/commit/commit.c
@@ -26,10 +26,10 @@ void test_commit_commit__create_unexisting_update_ref(void)
git_signature *s;
git_reference *ref;
- git_oid_fromstr(&oid, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750");
+ git_oid_fromstr(&oid, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, _repo, &oid));
- git_oid_fromstr(&oid, "944c0f6e4dfa41595e6eb3ceecdb14f50fe18162");
+ git_oid_fromstr(&oid, "944c0f6e4dfa41595e6eb3ceecdb14f50fe18162", GIT_OID_SHA1);
cl_git_pass(git_tree_lookup(&tree, _repo, &oid));
cl_git_pass(git_signature_now(&s, "alice", "alice@example.com"));
@@ -59,10 +59,10 @@ void test_commit_commit__create_initial_commit(void)
git_signature *s;
git_reference *ref;
- git_oid_fromstr(&oid, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750");
+ git_oid_fromstr(&oid, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, _repo, &oid));
- git_oid_fromstr(&oid, "944c0f6e4dfa41595e6eb3ceecdb14f50fe18162");
+ git_oid_fromstr(&oid, "944c0f6e4dfa41595e6eb3ceecdb14f50fe18162", GIT_OID_SHA1);
cl_git_pass(git_tree_lookup(&tree, _repo, &oid));
cl_git_pass(git_signature_now(&s, "alice", "alice@example.com"));
@@ -89,10 +89,10 @@ void test_commit_commit__create_initial_commit_parent_not_current(void)
git_commit *commit;
git_signature *s;
- git_oid_fromstr(&oid, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750");
+ git_oid_fromstr(&oid, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, _repo, &oid));
- git_oid_fromstr(&oid, "944c0f6e4dfa41595e6eb3ceecdb14f50fe18162");
+ git_oid_fromstr(&oid, "944c0f6e4dfa41595e6eb3ceecdb14f50fe18162", GIT_OID_SHA1);
cl_git_pass(git_tree_lookup(&tree, _repo, &oid));
cl_git_pass(git_signature_now(&s, "alice", "alice@example.com"));
diff --git a/tests/libgit2/commit/parent.c b/tests/libgit2/commit/parent.c
index 18ce0bb..5f96ade 100644
--- a/tests/libgit2/commit/parent.c
+++ b/tests/libgit2/commit/parent.c
@@ -9,7 +9,7 @@ void test_commit_parent__initialize(void)
cl_git_pass(git_repository_open(&_repo, cl_fixture("testrepo.git")));
- git_oid_fromstr(&oid, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644");
+ git_oid_fromstr(&oid, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, _repo, &oid));
}
diff --git a/tests/libgit2/commit/parse.c b/tests/libgit2/commit/parse.c
index 653ed08..6e834a0 100644
--- a/tests/libgit2/commit/parse.c
+++ b/tests/libgit2/commit/parse.c
@@ -57,7 +57,7 @@ void test_commit_parse__header(void)
const char *line_end = line + strlen(line);
cl_git_pass(git_object__parse_oid_header(&oid,
- &line, line_end, testcase->header));
+ &line, line_end, testcase->header, GIT_OID_SHA1));
cl_assert(line == line_end);
}
@@ -67,7 +67,7 @@ void test_commit_parse__header(void)
const char *line_end = line + strlen(line);
cl_git_fail(git_object__parse_oid_header(&oid,
- &line, line_end, testcase->header));
+ &line, line_end, testcase->header, GIT_OID_SHA1));
}
}
@@ -343,7 +343,7 @@ void test_commit_parse__details0(void) {
unsigned int parents, p;
git_commit *parent = NULL, *old_parent = NULL;
- git_oid_fromstr(&id, commit_ids[i]);
+ git_oid_fromstr(&id, commit_ids[i], GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, g_repo, &id));
@@ -533,7 +533,7 @@ corrupt signature\n";
git_buf_dispose(&signed_data);
/* Try to parse a tree */
- cl_git_pass(git_oid_fromstr(&commit_id, "45dd856fdd4d89b884c340ba0e047752d9b085d6"));
+ cl_git_pass(git_oid_fromstr(&commit_id, "45dd856fdd4d89b884c340ba0e047752d9b085d6", GIT_OID_SHA1));
cl_git_fail_with(GIT_ENOTFOUND, git_commit_extract_signature(&signature, &signed_data, g_repo, &commit_id, NULL));
cl_assert_equal_i(GIT_ERROR_INVALID, git_error_last()->klass);
diff --git a/tests/libgit2/commit/write.c b/tests/libgit2/commit/write.c
index 5a9c9d5..cc4c2ca 100644
--- a/tests/libgit2/commit/write.c
+++ b/tests/libgit2/commit/write.c
@@ -51,10 +51,10 @@ void test_commit_write__from_memory(void)
git_commit *parent;
git_tree *tree;
- git_oid_fromstr(&tree_id, tree_id_str);
+ git_oid_fromstr(&tree_id, tree_id_str, GIT_OID_SHA1);
cl_git_pass(git_tree_lookup(&tree, g_repo, &tree_id));
- git_oid_fromstr(&parent_id, parent_id_str);
+ git_oid_fromstr(&parent_id, parent_id_str, GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&parent, g_repo, &parent_id));
/* create signatures */
@@ -107,14 +107,14 @@ void test_commit_write__into_buf(void)
git_oid parent_id;
git_buf commit = GIT_BUF_INIT;
- git_oid_fromstr(&tree_id, tree_id_str);
+ git_oid_fromstr(&tree_id, tree_id_str, GIT_OID_SHA1);
cl_git_pass(git_tree_lookup(&tree, g_repo, &tree_id));
/* create signatures */
cl_git_pass(git_signature_new(&committer, committer_name, committer_email, 123456789, 60));
cl_git_pass(git_signature_new(&author, committer_name, committer_email, 987654321, 90));
- git_oid_fromstr(&parent_id, parent_id_str);
+ git_oid_fromstr(&parent_id, parent_id_str, GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&parent, g_repo, &parent_id));
cl_git_pass(git_commit_create_buffer(&commit, g_repo, author, committer,
@@ -148,7 +148,7 @@ void test_commit_write__root(void)
git_reflog *log;
const git_reflog_entry *entry;
- git_oid_fromstr(&tree_id, tree_id_str);
+ git_oid_fromstr(&tree_id, tree_id_str, GIT_OID_SHA1);
cl_git_pass(git_tree_lookup(&tree, g_repo, &tree_id));
/* create signatures */
@@ -242,34 +242,34 @@ void test_commit_write__can_write_invalid_objects(void)
cl_git_pass(git_libgit2_opts(GIT_OPT_ENABLE_STRICT_OBJECT_CREATION, 0));
/* this is a valid tree and parent */
- git_oid_fromstr(&tree_id, tree_id_str);
- git_oid_fromstr(&parent_id, parent_id_str);
+ git_oid_fromstr(&tree_id, tree_id_str, GIT_OID_SHA1);
+ git_oid_fromstr(&parent_id, parent_id_str, GIT_OID_SHA1);
- git_oid_fromstr(&expected_id, "c8571bbec3a72c4bcad31648902e5a453f1adece");
+ git_oid_fromstr(&expected_id, "c8571bbec3a72c4bcad31648902e5a453f1adece", GIT_OID_SHA1);
cl_git_pass(create_commit_from_ids(&commit_id, &tree_id, &parent_id));
cl_assert_equal_oid(&expected_id, &commit_id);
/* this is a wholly invented tree id */
- git_oid_fromstr(&tree_id, "1234567890123456789012345678901234567890");
- git_oid_fromstr(&parent_id, parent_id_str);
+ git_oid_fromstr(&tree_id, "1234567890123456789012345678901234567890", GIT_OID_SHA1);
+ git_oid_fromstr(&parent_id, parent_id_str, GIT_OID_SHA1);
- git_oid_fromstr(&expected_id, "996008340b8e68d69bf3c28d7c57fb7ec3c8e202");
+ git_oid_fromstr(&expected_id, "996008340b8e68d69bf3c28d7c57fb7ec3c8e202", GIT_OID_SHA1);
cl_git_pass(create_commit_from_ids(&commit_id, &tree_id, &parent_id));
cl_assert_equal_oid(&expected_id, &commit_id);
/* this is a wholly invented parent id */
- git_oid_fromstr(&tree_id, tree_id_str);
- git_oid_fromstr(&parent_id, "1234567890123456789012345678901234567890");
+ git_oid_fromstr(&tree_id, tree_id_str, GIT_OID_SHA1);
+ git_oid_fromstr(&parent_id, "1234567890123456789012345678901234567890", GIT_OID_SHA1);
- git_oid_fromstr(&expected_id, "d78f660cab89d9791ca6714b57978bf2a7e709fd");
+ git_oid_fromstr(&expected_id, "d78f660cab89d9791ca6714b57978bf2a7e709fd", GIT_OID_SHA1);
cl_git_pass(create_commit_from_ids(&commit_id, &tree_id, &parent_id));
cl_assert_equal_oid(&expected_id, &commit_id);
/* these are legitimate objects, but of the wrong type */
- git_oid_fromstr(&tree_id, parent_id_str);
- git_oid_fromstr(&parent_id, tree_id_str);
+ git_oid_fromstr(&tree_id, parent_id_str, GIT_OID_SHA1);
+ git_oid_fromstr(&parent_id, tree_id_str, GIT_OID_SHA1);
- git_oid_fromstr(&expected_id, "5d80c07414e3f18792949699dfcacadf7748f361");
+ git_oid_fromstr(&expected_id, "5d80c07414e3f18792949699dfcacadf7748f361", GIT_OID_SHA1);
cl_git_pass(create_commit_from_ids(&commit_id, &tree_id, &parent_id));
cl_assert_equal_oid(&expected_id, &commit_id);
}
@@ -279,23 +279,23 @@ void test_commit_write__can_validate_objects(void)
git_oid tree_id, parent_id, commit_id;
/* this is a valid tree and parent */
- git_oid_fromstr(&tree_id, tree_id_str);
- git_oid_fromstr(&parent_id, parent_id_str);
+ git_oid_fromstr(&tree_id, tree_id_str, GIT_OID_SHA1);
+ git_oid_fromstr(&parent_id, parent_id_str, GIT_OID_SHA1);
cl_git_pass(create_commit_from_ids(&commit_id, &tree_id, &parent_id));
/* this is a wholly invented tree id */
- git_oid_fromstr(&tree_id, "1234567890123456789012345678901234567890");
- git_oid_fromstr(&parent_id, parent_id_str);
+ git_oid_fromstr(&tree_id, "1234567890123456789012345678901234567890", GIT_OID_SHA1);
+ git_oid_fromstr(&parent_id, parent_id_str, GIT_OID_SHA1);
cl_git_fail(create_commit_from_ids(&commit_id, &tree_id, &parent_id));
/* this is a wholly invented parent id */
- git_oid_fromstr(&tree_id, tree_id_str);
- git_oid_fromstr(&parent_id, "1234567890123456789012345678901234567890");
+ git_oid_fromstr(&tree_id, tree_id_str, GIT_OID_SHA1);
+ git_oid_fromstr(&parent_id, "1234567890123456789012345678901234567890", GIT_OID_SHA1);
cl_git_fail(create_commit_from_ids(&commit_id, &tree_id, &parent_id));
/* these are legitimate objects, but of the wrong type */
- git_oid_fromstr(&tree_id, parent_id_str);
- git_oid_fromstr(&parent_id, tree_id_str);
+ git_oid_fromstr(&tree_id, parent_id_str, GIT_OID_SHA1);
+ git_oid_fromstr(&parent_id, tree_id_str, GIT_OID_SHA1);
cl_git_fail(create_commit_from_ids(&commit_id, &tree_id, &parent_id));
}
diff --git a/tests/libgit2/core/oid.c b/tests/libgit2/core/oid.c
index 894fead..9f64468 100644
--- a/tests/libgit2/core/oid.c
+++ b/tests/libgit2/core/oid.c
@@ -10,9 +10,9 @@ const char *str_oid_m = "ae90f12eea699729ed24555e40b9fd669da12a12THIS IS EXTRA T
void test_core_oid__initialize(void)
{
- cl_git_pass(git_oid_fromstr(&id, str_oid));
- cl_git_pass(git_oid_fromstrp(&idp, str_oid_p));
- cl_git_fail(git_oid_fromstrp(&idm, str_oid_m));
+ cl_git_pass(git_oid_fromstr(&id, str_oid, GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstrp(&idp, str_oid_p, GIT_OID_SHA1));
+ cl_git_fail(git_oid_fromstrp(&idm, str_oid_m, GIT_OID_SHA1));
}
void test_core_oid__streq(void)
@@ -72,8 +72,8 @@ void test_core_oid__ncmp(void)
void test_core_oid__is_hexstr(void)
{
- cl_assert(git_oid__is_hexstr("deadbeefdeadbeefdeadbeefdeadbeefdeadbeef"));
- cl_assert(!git_oid__is_hexstr("deadbeefdeadbeef"));
- cl_assert(!git_oid__is_hexstr("zeadbeefdeadbeefdeadbeefdeadbeefdeadbeef"));
- cl_assert(!git_oid__is_hexstr("deadbeefdeadbeefdeadbeefdeadbeefdeadbeef1"));
+ cl_assert(git_oid__is_hexstr("deadbeefdeadbeefdeadbeefdeadbeefdeadbeef", GIT_OID_SHA1));
+ cl_assert(!git_oid__is_hexstr("deadbeefdeadbeef", GIT_OID_SHA1));
+ cl_assert(!git_oid__is_hexstr("zeadbeefdeadbeefdeadbeefdeadbeefdeadbeef", GIT_OID_SHA1));
+ cl_assert(!git_oid__is_hexstr("deadbeefdeadbeefdeadbeefdeadbeefdeadbeef1", GIT_OID_SHA1));
}
diff --git a/tests/libgit2/core/oidmap.c b/tests/libgit2/core/oidmap.c
index 7f549fc..317631c 100644
--- a/tests/libgit2/core/oidmap.c
+++ b/tests/libgit2/core/oidmap.c
@@ -28,6 +28,7 @@ void test_core_oidmap__initialize(void)
test_oids[i].oid.id[ 9] = (unsigned char)(i >> 8);
test_oids[i].oid.id[10] = (unsigned char)(i >> 16);
test_oids[i].oid.id[11] = (unsigned char)(i >> 24);
+ test_oids[i].oid.type = GIT_OID_SHA1;
}
cl_git_pass(git_oidmap_new(&g_map));
@@ -93,9 +94,9 @@ void test_core_oidmap__get_fails_with_nonexisting_key(void)
void test_core_oidmap__setting_oid_persists(void)
{
git_oid oids[] = {
- { { 0x01 }},
- { { 0x02 }},
- { { 0x03 }}
+ { GIT_OID_SHA1, { 0x01 }},
+ { GIT_OID_SHA1, { 0x02 }},
+ { GIT_OID_SHA1, { 0x03 }}
};
cl_git_pass(git_oidmap_set(g_map, &oids[0], "one"));
@@ -110,9 +111,9 @@ void test_core_oidmap__setting_oid_persists(void)
void test_core_oidmap__setting_existing_key_updates(void)
{
git_oid oids[] = {
- { { 0x01 }},
- { { 0x02 }},
- { { 0x03 }}
+ { GIT_OID_SHA1, { 0x01 }},
+ { GIT_OID_SHA1, { 0x02 }},
+ { GIT_OID_SHA1, { 0x03 }}
};
cl_git_pass(git_oidmap_set(g_map, &oids[0], "one"));
diff --git a/tests/libgit2/core/pool.c b/tests/libgit2/core/pool.c
index af13213..21aad32 100644
--- a/tests/libgit2/core/pool.c
+++ b/tests/libgit2/core/pool.c
@@ -22,12 +22,12 @@ void test_core_pool__oid(void)
for (j = 0; j < 8; j++)
oid_hex[j] = to_hex[(i >> (4 * j)) & 0x0f];
- cl_git_pass(git_oid_fromstr(oid, oid_hex));
+ cl_git_pass(git_oid_fromstr(oid, oid_hex, GIT_OID_SHA1));
}
#ifndef GIT_DEBUG_POOL
/* with fixed page size, allocation must end up with these values */
- cl_assert_equal_i(sizeof(void *) == 8 ? 55 : 45, git_pool__open_pages(&p));
+ cl_assert_equal_i(sizeof(void *) == 8 ? 90 : 82, git_pool__open_pages(&p));
#endif
git_pool_clear(&p);
}
diff --git a/tests/libgit2/diff/binary.c b/tests/libgit2/diff/binary.c
index 284a1b1..e26c370 100644
--- a/tests/libgit2/diff/binary.c
+++ b/tests/libgit2/diff/binary.c
@@ -31,12 +31,12 @@ static void test_patch(
git_patch *patch;
git_buf actual = GIT_BUF_INIT;
- cl_git_pass(git_oid_fromstr(&id_one, one));
+ cl_git_pass(git_oid_fromstr(&id_one, one, GIT_OID_SHA1));
cl_git_pass(git_commit_lookup(&commit_one, repo, &id_one));
cl_git_pass(git_commit_tree(&tree_one, commit_one));
if (two) {
- cl_git_pass(git_oid_fromstr(&id_two, two));
+ cl_git_pass(git_oid_fromstr(&id_two, two, GIT_OID_SHA1));
cl_git_pass(git_commit_lookup(&commit_two, repo, &id_two));
cl_git_pass(git_commit_tree(&tree_two, commit_two));
} else {
@@ -289,7 +289,7 @@ void test_diff_binary__empty_for_no_diff(void)
repo = cl_git_sandbox_init("renames");
- cl_git_pass(git_oid_fromstr(&id, "19dd32dfb1520a64e5bbaae8dce6ef423dfa2f13"));
+ cl_git_pass(git_oid_fromstr(&id, "19dd32dfb1520a64e5bbaae8dce6ef423dfa2f13", GIT_OID_SHA1));
cl_git_pass(git_commit_lookup(&commit, repo, &id));
cl_git_pass(git_commit_tree(&tree, commit));
@@ -510,8 +510,8 @@ void test_diff_binary__blob_to_blob(void)
cl_git_pass(git_index_add_bypath(index, "untimely.txt"));
cl_git_pass(git_index_write(index));
- git_oid_fromstr(&old_id, "9a69d960ae94b060f56c2a8702545e2bb1abb935");
- git_oid_fromstr(&new_id, "1111d4f11f4b35bf6759e0fb714fe09731ef0840");
+ git_oid_fromstr(&old_id, "9a69d960ae94b060f56c2a8702545e2bb1abb935", GIT_OID_SHA1);
+ git_oid_fromstr(&new_id, "1111d4f11f4b35bf6759e0fb714fe09731ef0840", GIT_OID_SHA1);
cl_git_pass(git_blob_lookup(&old_blob, repo, &old_id));
cl_git_pass(git_blob_lookup(&new_blob, repo, &new_id));
diff --git a/tests/libgit2/diff/blob.c b/tests/libgit2/diff/blob.c
index d2f4220..f06f884 100644
--- a/tests/libgit2/diff/blob.c
+++ b/tests/libgit2/diff/blob.c
@@ -45,11 +45,11 @@ void test_diff_blob__initialize(void)
memset(&expected, 0, sizeof(expected));
/* tests/resources/attr/root_test4.txt */
- cl_git_pass(git_oid_fromstrn(&oid, "a0f7217a", 8));
+ cl_git_pass(git_oid_fromstrn(&oid, "a0f7217a", 8, GIT_OID_SHA1));
cl_git_pass(git_blob_lookup_prefix(&d, g_repo, &oid, 8));
/* alien.png */
- cl_git_pass(git_oid_fromstrn(&oid, "edf3dcee", 8));
+ cl_git_pass(git_oid_fromstrn(&oid, "edf3dcee", 8, GIT_OID_SHA1));
cl_git_pass(git_blob_lookup_prefix(&alien, g_repo, &oid, 8));
}
@@ -86,10 +86,10 @@ void test_diff_blob__patch_with_freed_blobs(void)
git_buf buf = GIT_BUF_INIT;
/* tests/resources/attr/root_test1 */
- cl_git_pass(git_oid_fromstrn(&a_oid, "45141a79", 8));
+ cl_git_pass(git_oid_fromstrn(&a_oid, "45141a79", 8, GIT_OID_SHA1));
cl_git_pass(git_blob_lookup_prefix(&a, g_repo, &a_oid, 4));
/* tests/resources/attr/root_test2 */
- cl_git_pass(git_oid_fromstrn(&b_oid, "4d713dc4", 8));
+ cl_git_pass(git_oid_fromstrn(&b_oid, "4d713dc4", 8, GIT_OID_SHA1));
cl_git_pass(git_blob_lookup_prefix(&b, g_repo, &b_oid, 4));
cl_git_pass(git_patch_from_blobs(&p, a, NULL, b, NULL, NULL));
@@ -110,15 +110,15 @@ void test_diff_blob__can_compare_text_blobs(void)
git_oid a_oid, b_oid, c_oid;
/* tests/resources/attr/root_test1 */
- cl_git_pass(git_oid_fromstrn(&a_oid, "45141a79", 8));
+ cl_git_pass(git_oid_fromstrn(&a_oid, "45141a79", 8, GIT_OID_SHA1));
cl_git_pass(git_blob_lookup_prefix(&a, g_repo, &a_oid, 4));
/* tests/resources/attr/root_test2 */
- cl_git_pass(git_oid_fromstrn(&b_oid, "4d713dc4", 8));
+ cl_git_pass(git_oid_fromstrn(&b_oid, "4d713dc4", 8, GIT_OID_SHA1));
cl_git_pass(git_blob_lookup_prefix(&b, g_repo, &b_oid, 4));
/* tests/resources/attr/root_test3 */
- cl_git_pass(git_oid_fromstrn(&c_oid, "c96bbb2c2557a832", 16));
+ cl_git_pass(git_oid_fromstrn(&c_oid, "c96bbb2c2557a832", 16, GIT_OID_SHA1));
cl_git_pass(git_blob_lookup_prefix(&c, g_repo, &c_oid, 16));
/* Doing the equivalent of a `git diff -U1` on these files */
@@ -201,15 +201,15 @@ void test_diff_blob__can_compare_text_blobs_with_patch(void)
git_patch *p;
/* tests/resources/attr/root_test1 */
- cl_git_pass(git_oid_fromstrn(&a_oid, "45141a79", 8));
+ cl_git_pass(git_oid_fromstrn(&a_oid, "45141a79", 8, GIT_OID_SHA1));
cl_git_pass(git_blob_lookup_prefix(&a, g_repo, &a_oid, 8));
/* tests/resources/attr/root_test2 */
- cl_git_pass(git_oid_fromstrn(&b_oid, "4d713dc4", 8));
+ cl_git_pass(git_oid_fromstrn(&b_oid, "4d713dc4", 8, GIT_OID_SHA1));
cl_git_pass(git_blob_lookup_prefix(&b, g_repo, &b_oid, 8));
/* tests/resources/attr/root_test3 */
- cl_git_pass(git_oid_fromstrn(&c_oid, "c96bbb2c2557a832", 16));
+ cl_git_pass(git_oid_fromstrn(&c_oid, "c96bbb2c2557a832", 16, GIT_OID_SHA1));
cl_git_pass(git_blob_lookup_prefix(&c, g_repo, &c_oid, 16));
/* Doing the equivalent of a `git diff -U1` on these files */
@@ -475,7 +475,7 @@ void test_diff_blob__can_compare_two_binary_blobs(void)
git_oid h_oid;
/* heart.png */
- cl_git_pass(git_oid_fromstrn(&h_oid, "de863bff", 8));
+ cl_git_pass(git_oid_fromstrn(&h_oid, "de863bff", 8, GIT_OID_SHA1));
cl_git_pass(git_blob_lookup_prefix(&heart, g_repo, &h_oid, 8));
cl_git_pass(git_diff_blobs(
@@ -543,7 +543,7 @@ void test_diff_blob__comparing_two_text_blobs_honors_interhunkcontext(void)
opts.context_lines = 3;
/* tests/resources/attr/root_test1 from commit f5b0af1 */
- cl_git_pass(git_oid_fromstrn(&old_d_oid, "fe773770", 8));
+ cl_git_pass(git_oid_fromstrn(&old_d_oid, "fe773770", 8, GIT_OID_SHA1));
cl_git_pass(git_blob_lookup_prefix(&old_d, g_repo, &old_d_oid, 8));
/* Test with default inter-hunk-context (not set) => default is 0 */
@@ -652,7 +652,7 @@ void test_diff_blob__can_compare_blob_to_buffer(void)
const char *b_content = "Hello from the root\n\nSome additional lines\n\nDown here below\n\n";
/* tests/resources/attr/root_test1 */
- cl_git_pass(git_oid_fromstrn(&a_oid, "45141a79", 8));
+ cl_git_pass(git_oid_fromstrn(&a_oid, "45141a79", 8, GIT_OID_SHA1));
cl_git_pass(git_blob_lookup_prefix(&a, g_repo, &a_oid, 8));
/* diff from blob a to content of b */
@@ -694,7 +694,7 @@ void test_diff_blob__can_compare_blob_to_buffer_with_patch(void)
size_t tc, ta, td;
/* tests/resources/attr/root_test1 */
- cl_git_pass(git_oid_fromstrn(&a_oid, "45141a79", 8));
+ cl_git_pass(git_oid_fromstrn(&a_oid, "45141a79", 8, GIT_OID_SHA1));
cl_git_pass(git_blob_lookup_prefix(&a, g_repo, &a_oid, 8));
/* diff from blob a to content of b */
@@ -773,10 +773,10 @@ void test_diff_blob__binary_data_comparisons(void)
opts.flags |= GIT_DIFF_INCLUDE_UNMODIFIED;
- cl_git_pass(git_oid_fromstrn(&oid, "45141a79", 8));
+ cl_git_pass(git_oid_fromstrn(&oid, "45141a79", 8, GIT_OID_SHA1));
cl_git_pass(git_blob_lookup_prefix(&nonbin, g_repo, &oid, 8));
- cl_git_pass(git_oid_fromstrn(&oid, "b435cd56", 8));
+ cl_git_pass(git_oid_fromstrn(&oid, "b435cd56", 8, GIT_OID_SHA1));
cl_git_pass(git_blob_lookup_prefix(&bin, g_repo, &oid, 8));
/* non-binary to reference content */
@@ -879,11 +879,11 @@ void test_diff_blob__using_path_and_attributes(void)
opts.context_lines = 0;
opts.flags |= GIT_DIFF_INCLUDE_UNMODIFIED;
- cl_git_pass(git_oid_fromstrn(&oid, "45141a79", 8));
+ cl_git_pass(git_oid_fromstrn(&oid, "45141a79", 8, GIT_OID_SHA1));
cl_git_pass(git_blob_lookup_prefix(&nonbin, g_repo, &oid, 8));
/* 20b: "Hello from the root\n" */
- cl_git_pass(git_oid_fromstrn(&oid, "b435cd56", 8));
+ cl_git_pass(git_oid_fromstrn(&oid, "b435cd56", 8, GIT_OID_SHA1));
cl_git_pass(git_blob_lookup_prefix(&bin, g_repo, &oid, 8));
/* 33b: "0123456789\n\x01\x02\x03\x04\x05\x06\x07\x08\x09\n0123456789\n" */
diff --git a/tests/libgit2/diff/diff_helpers.c b/tests/libgit2/diff/diff_helpers.c
index e990033..ae23c48 100644
--- a/tests/libgit2/diff/diff_helpers.c
+++ b/tests/libgit2/diff/diff_helpers.c
@@ -11,7 +11,7 @@ git_tree *resolve_commit_oid_to_tree(
git_object *obj = NULL;
git_tree *tree = NULL;
- if (git_oid_fromstrn(&oid, partial_oid, len) == 0)
+ if (git_oid_fromstrn(&oid, partial_oid, len, GIT_OID_SHA1) == 0)
cl_git_pass(git_object_lookup_prefix(&obj, repo, &oid, len, GIT_OBJECT_ANY));
cl_git_pass(git_object_peel((git_object **) &tree, obj, GIT_OBJECT_TREE));
diff --git a/tests/libgit2/diff/format_email.c b/tests/libgit2/diff/format_email.c
index 612804c..db43178 100644
--- a/tests/libgit2/diff/format_email.c
+++ b/tests/libgit2/diff/format_email.c
@@ -28,7 +28,7 @@ static void assert_email_match(
git_diff *diff = NULL;
git_buf buf = GIT_BUF_INIT;
- git_oid_fromstr(&oid, oidstr);
+ git_oid_fromstr(&oid, oidstr, GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &oid));
@@ -228,7 +228,7 @@ void test_diff_format_email__multiple(void)
"\n";
- git_oid_fromstr(&oid, "10808fe9c9be5a190c0ba68d1a002233fb363508");
+ git_oid_fromstr(&oid, "10808fe9c9be5a190c0ba68d1a002233fb363508", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &oid));
opts.id = git_commit_id(commit);
@@ -245,7 +245,7 @@ void test_diff_format_email__multiple(void)
diff = NULL;
commit = NULL;
- git_oid_fromstr(&oid, "873806f6f27e631eb0b23e4b56bea2bfac14a373");
+ git_oid_fromstr(&oid, "873806f6f27e631eb0b23e4b56bea2bfac14a373", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &oid));
opts.id = git_commit_id(commit);
@@ -324,7 +324,7 @@ void test_diff_format_email__invalid_no(void)
git_diff_format_email_options opts = GIT_DIFF_FORMAT_EMAIL_OPTIONS_INIT;
git_buf buf = GIT_BUF_INIT;
- git_oid_fromstr(&oid, "9264b96c6d104d0e07ae33d3007b6a48246c6f92");
+ git_oid_fromstr(&oid, "9264b96c6d104d0e07ae33d3007b6a48246c6f92", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &oid));
diff --git a/tests/libgit2/diff/index.c b/tests/libgit2/diff/index.c
index b616a37..6b91f88 100644
--- a/tests/libgit2/diff/index.c
+++ b/tests/libgit2/diff/index.c
@@ -185,9 +185,9 @@ static void do_conflicted_diff(diff_expects *exp, unsigned long flags)
ancestor.path = ours.path = theirs.path = "staged_changes";
ancestor.mode = ours.mode = theirs.mode = GIT_FILEMODE_BLOB;
- git_oid_fromstr(&ancestor.id, "d427e0b2e138501a3d15cc376077a3631e15bd46");
- git_oid_fromstr(&ours.id, "ee3fa1b8c00aff7fe02065fdb50864bb0d932ccf");
- git_oid_fromstr(&theirs.id, "2bd0a343aeef7a2cf0d158478966a6e587ff3863");
+ git_oid_fromstr(&ancestor.id, "d427e0b2e138501a3d15cc376077a3631e15bd46", GIT_OID_SHA1);
+ git_oid_fromstr(&ours.id, "ee3fa1b8c00aff7fe02065fdb50864bb0d932ccf", GIT_OID_SHA1);
+ git_oid_fromstr(&theirs.id, "2bd0a343aeef7a2cf0d158478966a6e587ff3863", GIT_OID_SHA1);
cl_git_pass(git_index_conflict_add(index, &ancestor, &ours, &theirs));
cl_git_pass(git_diff_tree_to_index(&diff, g_repo, a, index, &opts));
@@ -255,7 +255,7 @@ void test_diff_index__not_in_head_conflicted(void)
theirs.path = "file_not_in_head";
theirs.mode = GIT_FILEMODE_BLOB;
- git_oid_fromstr(&theirs.id, "2bd0a343aeef7a2cf0d158478966a6e587ff3863");
+ git_oid_fromstr(&theirs.id, "2bd0a343aeef7a2cf0d158478966a6e587ff3863", GIT_OID_SHA1);
cl_git_pass(git_index_conflict_add(index, NULL, NULL, &theirs));
cl_git_pass(git_diff_tree_to_index(&diff, g_repo, a, index, NULL));
diff --git a/tests/libgit2/diff/patchid.c b/tests/libgit2/diff/patchid.c
index 621a720..a79a425 100644
--- a/tests/libgit2/diff/patchid.c
+++ b/tests/libgit2/diff/patchid.c
@@ -6,7 +6,7 @@ static void verify_patch_id(const char *diff_content, const char *expected_id)
git_oid expected_oid, actual_oid;
git_diff *diff;
- cl_git_pass(git_oid_fromstr(&expected_oid, expected_id));
+ cl_git_pass(git_oid_fromstr(&expected_oid, expected_id, GIT_OID_SHA1));
cl_git_pass(git_diff_from_buffer(&diff, diff_content, strlen(diff_content)));
cl_git_pass(git_diff_patchid(&actual_oid, diff, NULL));
diff --git a/tests/libgit2/diff/rename.c b/tests/libgit2/diff/rename.c
index 30e9ea4..69cd062 100644
--- a/tests/libgit2/diff/rename.c
+++ b/tests/libgit2/diff/rename.c
@@ -574,7 +574,7 @@ void test_diff_rename__working_directory_changes(void)
/* again with exact match blob */
- cl_git_pass(git_oid_fromstr(&id, blobsha));
+ cl_git_pass(git_oid_fromstr(&id, blobsha, GIT_OID_SHA1));
cl_git_pass(git_blob_lookup(&blob, g_repo, &id));
cl_git_pass(git_str_set(
&content, git_blob_rawcontent(blob), (size_t)git_blob_rawsize(blob)));
diff --git a/tests/libgit2/diff/stats.c b/tests/libgit2/diff/stats.c
index f69dba9..b00da12 100644
--- a/tests/libgit2/diff/stats.c
+++ b/tests/libgit2/diff/stats.c
@@ -26,7 +26,7 @@ static void diff_stats_from_commit_oid(
git_commit *commit;
git_diff *diff;
- git_oid_fromstr(&oid, oidstr);
+ git_oid_fromstr(&oid, oidstr, GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, _repo, &oid));
cl_git_pass(git_diff__commit(&diff, _repo, commit, NULL));
if (rename)
diff --git a/tests/libgit2/diff/workdir.c b/tests/libgit2/diff/workdir.c
index 20e0009..948ae8e 100644
--- a/tests/libgit2/diff/workdir.c
+++ b/tests/libgit2/diff/workdir.c
@@ -86,11 +86,11 @@ void test_diff_workdir__to_index_with_conflicts(void)
/* Adding an entry that represents a rename gets two files in conflict */
our_entry.path = "subdir/modified_file";
our_entry.mode = 0100644;
- git_oid_fromstr(&our_entry.id, "ee3fa1b8c00aff7fe02065fdb50864bb0d932ccf");
+ git_oid_fromstr(&our_entry.id, "ee3fa1b8c00aff7fe02065fdb50864bb0d932ccf", GIT_OID_SHA1);
their_entry.path = "subdir/rename_conflict";
their_entry.mode = 0100644;
- git_oid_fromstr(&their_entry.id, "2bd0a343aeef7a2cf0d158478966a6e587ff3863");
+ git_oid_fromstr(&their_entry.id, "2bd0a343aeef7a2cf0d158478966a6e587ff3863", GIT_OID_SHA1);
cl_git_pass(git_repository_index(&index, g_repo));
cl_git_pass(git_index_conflict_add(index, NULL, &our_entry, &their_entry));
@@ -1979,9 +1979,9 @@ void test_diff_workdir__to_index_conflicted(void) {
ancestor.path = ours.path = theirs.path = "_file";
ancestor.mode = ours.mode = theirs.mode = 0100644;
- git_oid_fromstr(&ancestor.id, "d427e0b2e138501a3d15cc376077a3631e15bd46");
- git_oid_fromstr(&ours.id, "ee3fa1b8c00aff7fe02065fdb50864bb0d932ccf");
- git_oid_fromstr(&theirs.id, "2bd0a343aeef7a2cf0d158478966a6e587ff3863");
+ git_oid_fromstr(&ancestor.id, "d427e0b2e138501a3d15cc376077a3631e15bd46", GIT_OID_SHA1);
+ git_oid_fromstr(&ours.id, "ee3fa1b8c00aff7fe02065fdb50864bb0d932ccf", GIT_OID_SHA1);
+ git_oid_fromstr(&theirs.id, "2bd0a343aeef7a2cf0d158478966a6e587ff3863", GIT_OID_SHA1);
cl_git_pass(git_index_conflict_add(index, &ancestor, &ours, &theirs));
cl_git_pass(git_diff_tree_to_index(&diff1, g_repo, a, index, NULL));
diff --git a/tests/libgit2/email/create.c b/tests/libgit2/email/create.c
index 27a6655..d0e33a5 100644
--- a/tests/libgit2/email/create.c
+++ b/tests/libgit2/email/create.c
@@ -24,7 +24,7 @@ static void email_for_commit(
git_commit *commit = NULL;
git_diff *diff = NULL;
- git_oid_fromstr(&oid, commit_id);
+ git_oid_fromstr(&oid, commit_id, GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &oid));
@@ -323,7 +323,7 @@ void test_email_create__custom_summary_and_body(void)
opts.subject_prefix = "PPPPPATCH";
- git_oid_fromstr(&oid, "627e7e12d87e07a83fad5b6bfa25e86ead4a5270");
+ git_oid_fromstr(&oid, "627e7e12d87e07a83fad5b6bfa25e86ead4a5270", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &oid));
cl_git_pass(git_diff__commit(&diff, repo, commit, NULL));
cl_git_pass(git_email_create_from_diff(&buf, diff, 2, 4, &oid, summary, body, git_commit_author(commit), &opts));
diff --git a/tests/libgit2/email/create.c.bak b/tests/libgit2/email/create.c.bak
index 3bb95a6..cbb140b 100644
--- a/tests/libgit2/email/create.c.bak
+++ b/tests/libgit2/email/create.c.bak
@@ -25,7 +25,7 @@ static void email_for_commit(
git_commit *commit = NULL;
git_diff *diff = NULL;
- git_oid_fromstr(&oid, commit_id);
+ git_oid_fromstr(&oid, commit_id, GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &oid));
@@ -156,7 +156,7 @@ void test_email_create__custom_summary_and_body(void)
opts.subject_prefix = "PPPPPATCH";
- git_oid_fromstr(&oid, "627e7e12d87e07a83fad5b6bfa25e86ead4a5270");
+ git_oid_fromstr(&oid, "627e7e12d87e07a83fad5b6bfa25e86ead4a5270", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &oid));
cl_git_pass(git_diff__commit(&diff, repo, commit, NULL));
cl_git_pass(git_email_create_from_diff(&buf, diff, 2, 4, &oid, summary, body, git_commit_author(commit), &opts));
diff --git a/tests/libgit2/fetch/local.c b/tests/libgit2/fetch/local.c
index 20bd7ad..f06b757 100644
--- a/tests/libgit2/fetch/local.c
+++ b/tests/libgit2/fetch/local.c
@@ -26,7 +26,7 @@ void test_fetch_local__defaults(void)
cl_fixture("testrepo.git")));
cl_git_pass(git_remote_fetch(remote, NULL, NULL, NULL));
- git_oid_fromstr(&expected_id, "258f0e2a959a364e40ed6603d5d44fbb24765b10");
+ git_oid_fromstr(&expected_id, "258f0e2a959a364e40ed6603d5d44fbb24765b10", GIT_OID_SHA1);
cl_git_pass(git_revparse_single(&obj, repo, "refs/remotes/test/haacked"));
cl_assert_equal_oid(&expected_id, git_object_id(obj));
@@ -47,7 +47,7 @@ void test_fetch_local__reachable_commit(void)
refspecs.strings = &refspec;
refspecs.count = 1;
- git_oid_fromstr(&expected_id, "5b5b025afb0b4c913b4c338a42934a3863bf3644");
+ git_oid_fromstr(&expected_id, "5b5b025afb0b4c913b4c338a42934a3863bf3644", GIT_OID_SHA1);
cl_git_pass(git_remote_create(&remote, repo, "test",
cl_fixture("testrepo.git")));
diff --git a/tests/libgit2/fetchhead/nonetwork.c b/tests/libgit2/fetchhead/nonetwork.c
index aadcc78..937585b 100644
--- a/tests/libgit2/fetchhead/nonetwork.c
+++ b/tests/libgit2/fetchhead/nonetwork.c
@@ -30,42 +30,48 @@ static void populate_fetchhead(git_vector *out, git_repository *repo)
git_oid oid;
cl_git_pass(git_oid_fromstr(&oid,
- "49322bb17d3acc9146f98c97d078513228bbf3c0"));
+ "49322bb17d3acc9146f98c97d078513228bbf3c0",
+ GIT_OID_SHA1));
cl_git_pass(git_fetchhead_ref_create(&fetchhead_ref, &oid, 1,
"refs/heads/master",
"https://github.com/libgit2/TestGitRepository"));
cl_git_pass(git_vector_insert(out, fetchhead_ref));
cl_git_pass(git_oid_fromstr(&oid,
- "0966a434eb1a025db6b71485ab63a3bfbea520b6"));
+ "0966a434eb1a025db6b71485ab63a3bfbea520b6",
+ GIT_OID_SHA1));
cl_git_pass(git_fetchhead_ref_create(&fetchhead_ref, &oid, 0,
"refs/heads/first-merge",
"https://github.com/libgit2/TestGitRepository"));
cl_git_pass(git_vector_insert(out, fetchhead_ref));
cl_git_pass(git_oid_fromstr(&oid,
- "42e4e7c5e507e113ebbb7801b16b52cf867b7ce1"));
+ "42e4e7c5e507e113ebbb7801b16b52cf867b7ce1",
+ GIT_OID_SHA1));
cl_git_pass(git_fetchhead_ref_create(&fetchhead_ref, &oid, 0,
"refs/heads/no-parent",
"https://github.com/libgit2/TestGitRepository"));
cl_git_pass(git_vector_insert(out, fetchhead_ref));
cl_git_pass(git_oid_fromstr(&oid,
- "d96c4e80345534eccee5ac7b07fc7603b56124cb"));
+ "d96c4e80345534eccee5ac7b07fc7603b56124cb",
+ GIT_OID_SHA1));
cl_git_pass(git_fetchhead_ref_create(&fetchhead_ref, &oid, 0,
"refs/tags/annotated_tag",
"https://github.com/libgit2/TestGitRepository"));
cl_git_pass(git_vector_insert(out, fetchhead_ref));
cl_git_pass(git_oid_fromstr(&oid,
- "55a1a760df4b86a02094a904dfa511deb5655905"));
+ "55a1a760df4b86a02094a904dfa511deb5655905",
+ GIT_OID_SHA1));
cl_git_pass(git_fetchhead_ref_create(&fetchhead_ref, &oid, 0,
"refs/tags/blob",
"https://github.com/libgit2/TestGitRepository"));
cl_git_pass(git_vector_insert(out, fetchhead_ref));
cl_git_pass(git_oid_fromstr(&oid,
- "8f50ba15d49353813cc6e20298002c0d17b0a9ee"));
+ "8f50ba15d49353813cc6e20298002c0d17b0a9ee",
+ GIT_OID_SHA1));
cl_git_pass(git_fetchhead_ref_create(&fetchhead_ref, &oid, 0,
"refs/tags/commit_tree",
"https://github.com/libgit2/TestGitRepository"));
@@ -170,7 +176,7 @@ static int read_old_style_cb(const char *name, const char *url,
GIT_UNUSED(payload);
- git_oid_fromstr(&expected, "49322bb17d3acc9146f98c97d078513228bbf3c0");
+ git_oid_fromstr(&expected, "49322bb17d3acc9146f98c97d078513228bbf3c0", GIT_OID_SHA1);
cl_assert(name == NULL);
cl_assert(url == NULL);
@@ -197,7 +203,7 @@ static int read_type_missing(const char *ref_name, const char *remote_url,
GIT_UNUSED(payload);
- git_oid_fromstr(&expected, "49322bb17d3acc9146f98c97d078513228bbf3c0");
+ git_oid_fromstr(&expected, "49322bb17d3acc9146f98c97d078513228bbf3c0", GIT_OID_SHA1);
cl_assert_equal_s("name", ref_name);
cl_assert_equal_s("remote_url", remote_url);
@@ -224,7 +230,7 @@ static int read_name_missing(const char *ref_name, const char *remote_url,
GIT_UNUSED(payload);
- git_oid_fromstr(&expected, "49322bb17d3acc9146f98c97d078513228bbf3c0");
+ git_oid_fromstr(&expected, "49322bb17d3acc9146f98c97d078513228bbf3c0", GIT_OID_SHA1);
cl_assert(ref_name == NULL);
cl_assert_equal_s("remote_url", remote_url);
@@ -528,13 +534,13 @@ void test_fetchhead_nonetwork__credentials_are_stripped(void)
git_fetchhead_ref *ref;
git_oid oid;
- cl_git_pass(git_oid_fromstr(&oid, "49322bb17d3acc9146f98c97d078513228bbf3c0"));
+ cl_git_pass(git_oid_fromstr(&oid, "49322bb17d3acc9146f98c97d078513228bbf3c0", GIT_OID_SHA1));
cl_git_pass(git_fetchhead_ref_create(&ref, &oid, 0,
"refs/tags/commit_tree", "http://foo:bar@github.com/libgit2/TestGitRepository"));
cl_assert_equal_s(ref->remote_url, "http://github.com/libgit2/TestGitRepository");
git_fetchhead_ref_free(ref);
- cl_git_pass(git_oid_fromstr(&oid, "49322bb17d3acc9146f98c97d078513228bbf3c0"));
+ cl_git_pass(git_oid_fromstr(&oid, "49322bb17d3acc9146f98c97d078513228bbf3c0", GIT_OID_SHA1));
cl_git_pass(git_fetchhead_ref_create(&ref, &oid, 0,
"refs/tags/commit_tree", "https://foo:bar@github.com/libgit2/TestGitRepository"));
cl_assert_equal_s(ref->remote_url, "https://github.com/libgit2/TestGitRepository");
diff --git a/tests/libgit2/filter/bare.c b/tests/libgit2/filter/bare.c
index 8402638..07e992b 100644
--- a/tests/libgit2/filter/bare.c
+++ b/tests/libgit2/filter/bare.c
@@ -140,7 +140,7 @@ void test_filter_bare__from_specific_commit_one(void)
opts.flags |= GIT_BLOB_FILTER_NO_SYSTEM_ATTRIBUTES;
opts.flags |= GIT_BLOB_FILTER_ATTRIBUTES_FROM_COMMIT;
- cl_git_pass(git_oid_fromstr(&opts.attr_commit_id, "b8986fec0f7bde90f78ac72706e782d82f24f2f0"));
+ cl_git_pass(git_oid_fromstr(&opts.attr_commit_id, "b8986fec0f7bde90f78ac72706e782d82f24f2f0", GIT_OID_SHA1));
cl_git_pass(git_revparse_single(
(git_object **)&blob, g_repo, "055c872")); /* ident */
@@ -165,7 +165,7 @@ void test_filter_bare__from_specific_commit_with_no_attributes_file(void)
opts.flags |= GIT_BLOB_FILTER_NO_SYSTEM_ATTRIBUTES;
opts.flags |= GIT_BLOB_FILTER_ATTRIBUTES_FROM_COMMIT;
- cl_git_pass(git_oid_fromstr(&opts.attr_commit_id, "5afb6a14a864e30787857dd92af837e8cdd2cb1b"));
+ cl_git_pass(git_oid_fromstr(&opts.attr_commit_id, "5afb6a14a864e30787857dd92af837e8cdd2cb1b", GIT_OID_SHA1));
cl_git_pass(git_revparse_single(
(git_object **)&blob, g_repo, "799770d")); /* all-lf */
diff --git a/tests/libgit2/graph/ahead_behind.c b/tests/libgit2/graph/ahead_behind.c
index 77d7768..e333992 100644
--- a/tests/libgit2/graph/ahead_behind.c
+++ b/tests/libgit2/graph/ahead_behind.c
@@ -10,7 +10,7 @@ void test_graph_ahead_behind__initialize(void)
git_oid oid;
cl_git_pass(git_repository_open(&_repo, cl_fixture("testrepo.git")));
- cl_git_pass(git_oid_fromstr(&oid, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644"));
+ cl_git_pass(git_oid_fromstr(&oid, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644", GIT_OID_SHA1));
cl_git_pass(git_commit_lookup(&commit, _repo, &oid));
}
@@ -29,8 +29,8 @@ void test_graph_ahead_behind__returns_correct_result(void)
git_oid oid2;
git_commit *other;
- cl_git_pass(git_oid_fromstr(&oid, "e90810b8df3e80c413d903f631643c716887138d"));
- cl_git_pass(git_oid_fromstr(&oid2, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644"));
+ cl_git_pass(git_oid_fromstr(&oid, "e90810b8df3e80c413d903f631643c716887138d", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&oid2, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644", GIT_OID_SHA1));
cl_git_pass(git_graph_ahead_behind(&ahead, &behind, _repo, &oid, &oid2));
cl_assert_equal_sz(2, ahead);
diff --git a/tests/libgit2/graph/commitgraph.c b/tests/libgit2/graph/commitgraph.c
index 850f194..8d914ce 100644
--- a/tests/libgit2/graph/commitgraph.c
+++ b/tests/libgit2/graph/commitgraph.c
@@ -19,28 +19,28 @@ void test_graph_commitgraph__parse(void)
cl_git_pass(git_commit_graph_file_open(&file, git_str_cstr(&commit_graph_path)));
cl_assert_equal_i(git_commit_graph_file_needs_refresh(file, git_str_cstr(&commit_graph_path)), 0);
- cl_git_pass(git_oid_fromstr(&id, "5001298e0c09ad9c34e4249bc5801c75e9754fa5"));
+ cl_git_pass(git_oid_fromstr(&id, "5001298e0c09ad9c34e4249bc5801c75e9754fa5", GIT_OID_SHA1));
cl_git_pass(git_commit_graph_entry_find(&e, file, &id, GIT_OID_SHA1_HEXSIZE));
cl_assert_equal_oid(&e.sha1, &id);
- cl_git_pass(git_oid_fromstr(&id, "418382dff1ffb8bdfba833f4d8bbcde58b1e7f47"));
+ cl_git_pass(git_oid_fromstr(&id, "418382dff1ffb8bdfba833f4d8bbcde58b1e7f47", GIT_OID_SHA1));
cl_assert_equal_oid(&e.tree_oid, &id);
cl_assert_equal_i(e.generation, 1);
cl_assert_equal_i(e.commit_time, UINT64_C(1273610423));
cl_assert_equal_i(e.parent_count, 0);
- cl_git_pass(git_oid_fromstr(&id, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644"));
+ cl_git_pass(git_oid_fromstr(&id, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644", GIT_OID_SHA1));
cl_git_pass(git_commit_graph_entry_find(&e, file, &id, GIT_OID_SHA1_HEXSIZE));
cl_assert_equal_oid(&e.sha1, &id);
cl_assert_equal_i(e.generation, 5);
cl_assert_equal_i(e.commit_time, UINT64_C(1274813907));
cl_assert_equal_i(e.parent_count, 2);
- cl_git_pass(git_oid_fromstr(&id, "9fd738e8f7967c078dceed8190330fc8648ee56a"));
+ cl_git_pass(git_oid_fromstr(&id, "9fd738e8f7967c078dceed8190330fc8648ee56a", GIT_OID_SHA1));
cl_git_pass(git_commit_graph_entry_parent(&parent, file, &e, 0));
cl_assert_equal_oid(&parent.sha1, &id);
cl_assert_equal_i(parent.generation, 4);
- cl_git_pass(git_oid_fromstr(&id, "c47800c7266a2be04c571c04d5a6614691ea99bd"));
+ cl_git_pass(git_oid_fromstr(&id, "c47800c7266a2be04c571c04d5a6614691ea99bd", GIT_OID_SHA1));
cl_git_pass(git_commit_graph_entry_parent(&parent, file, &e, 1));
cl_assert_equal_oid(&parent.sha1, &id);
cl_assert_equal_i(parent.generation, 3);
@@ -62,26 +62,26 @@ void test_graph_commitgraph__parse_octopus_merge(void)
cl_git_pass(git_str_joinpath(&commit_graph_path, git_repository_path(repo), "objects/info/commit-graph"));
cl_git_pass(git_commit_graph_file_open(&file, git_str_cstr(&commit_graph_path)));
- cl_git_pass(git_oid_fromstr(&id, "d71c24b3b113fd1d1909998c5bfe33b86a65ee03"));
+ cl_git_pass(git_oid_fromstr(&id, "d71c24b3b113fd1d1909998c5bfe33b86a65ee03", GIT_OID_SHA1));
cl_git_pass(git_commit_graph_entry_find(&e, file, &id, GIT_OID_SHA1_HEXSIZE));
cl_assert_equal_oid(&e.sha1, &id);
- cl_git_pass(git_oid_fromstr(&id, "348f16ffaeb73f319a75cec5b16a0a47d2d5e27c"));
+ cl_git_pass(git_oid_fromstr(&id, "348f16ffaeb73f319a75cec5b16a0a47d2d5e27c", GIT_OID_SHA1));
cl_assert_equal_oid(&e.tree_oid, &id);
cl_assert_equal_i(e.generation, 7);
cl_assert_equal_i(e.commit_time, UINT64_C(1447083009));
cl_assert_equal_i(e.parent_count, 3);
- cl_git_pass(git_oid_fromstr(&id, "ad2ace9e15f66b3d1138922e6ffdc3ea3f967fa6"));
+ cl_git_pass(git_oid_fromstr(&id, "ad2ace9e15f66b3d1138922e6ffdc3ea3f967fa6", GIT_OID_SHA1));
cl_git_pass(git_commit_graph_entry_parent(&parent, file, &e, 0));
cl_assert_equal_oid(&parent.sha1, &id);
cl_assert_equal_i(parent.generation, 6);
- cl_git_pass(git_oid_fromstr(&id, "483065df53c0f4a02cdc6b2910b05d388fc17ffb"));
+ cl_git_pass(git_oid_fromstr(&id, "483065df53c0f4a02cdc6b2910b05d388fc17ffb", GIT_OID_SHA1));
cl_git_pass(git_commit_graph_entry_parent(&parent, file, &e, 1));
cl_assert_equal_oid(&parent.sha1, &id);
cl_assert_equal_i(parent.generation, 2);
- cl_git_pass(git_oid_fromstr(&id, "815b5a1c80ca749d705c7aa0cb294a00cbedd340"));
+ cl_git_pass(git_oid_fromstr(&id, "815b5a1c80ca749d705c7aa0cb294a00cbedd340", GIT_OID_SHA1));
cl_git_pass(git_commit_graph_entry_parent(&parent, file, &e, 2));
cl_assert_equal_oid(&parent.sha1, &id);
cl_assert_equal_i(parent.generation, 6);
diff --git a/tests/libgit2/graph/descendant_of.c b/tests/libgit2/graph/descendant_of.c
index 8e9952a..0eacb31 100644
--- a/tests/libgit2/graph/descendant_of.c
+++ b/tests/libgit2/graph/descendant_of.c
@@ -9,7 +9,7 @@ void test_graph_descendant_of__initialize(void)
cl_git_pass(git_repository_open(&_repo, cl_fixture("testrepo.git")));
- git_oid_fromstr(&oid, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644");
+ git_oid_fromstr(&oid, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, _repo, &oid));
}
@@ -50,6 +50,6 @@ void test_graph_descendant_of__nopath(void)
{
git_oid oid;
- git_oid_fromstr(&oid, "e90810b8df3e80c413d903f631643c716887138d");
+ git_oid_fromstr(&oid, "e90810b8df3e80c413d903f631643c716887138d", GIT_OID_SHA1);
cl_assert_equal_i(0, git_graph_descendant_of(_repo, git_commit_id(commit), &oid));
}
diff --git a/tests/libgit2/graph/reachable_from_any.c b/tests/libgit2/graph/reachable_from_any.c
index 9693d7d..d246cdb 100644
--- a/tests/libgit2/graph/reachable_from_any.c
+++ b/tests/libgit2/graph/reachable_from_any.c
@@ -17,7 +17,7 @@ void test_graph_reachable_from_any__initialize(void)
repo = cl_git_sandbox_init(TEST_REPO_PATH);
- git_oid_fromstr(&oid, "539bd011c4822c560c1d17cab095006b7a10f707");
+ git_oid_fromstr(&oid, "539bd011c4822c560c1d17cab095006b7a10f707", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &oid));
cl_git_pass(git_reset(repo, (git_object *)commit, GIT_RESET_HARD, NULL));
git_commit_free(commit);
diff --git a/tests/libgit2/index/add.c b/tests/libgit2/index/add.c
index f101ea2..6b285fd 100644
--- a/tests/libgit2/index/add.c
+++ b/tests/libgit2/index/add.c
@@ -28,7 +28,7 @@ static void test_add_entry(
{
git_index_entry entry = {{0}};
- cl_git_pass(git_oid_fromstr(&entry.id, idstr));
+ cl_git_pass(git_oid_fromstr(&entry.id, idstr, GIT_OID_SHA1));
entry.path = mode == GIT_FILEMODE_TREE ? "test_folder" : "test_file";
entry.mode = mode;
diff --git a/tests/libgit2/index/bypath.c b/tests/libgit2/index/bypath.c
index b32a0a7..5e6eb83 100644
--- a/tests/libgit2/index/bypath.c
+++ b/tests/libgit2/index/bypath.c
@@ -131,7 +131,7 @@ void test_index_bypath__add_honors_existing_case_2(void)
clar__skip();
dummy.mode = GIT_FILEMODE_BLOB;
- cl_git_pass(git_oid_fromstr(&dummy.id, "f990a25a74d1a8281ce2ab018ea8df66795cd60b"));
+ cl_git_pass(git_oid_fromstr(&dummy.id, "f990a25a74d1a8281ce2ab018ea8df66795cd60b", GIT_OID_SHA1));
/* note that `git_index_add` does no checking to canonical directories */
dummy.path = "Just_a_dir/file0.txt";
@@ -187,7 +187,7 @@ void test_index_bypath__add_honors_existing_case_3(void)
clar__skip();
dummy.mode = GIT_FILEMODE_BLOB;
- cl_git_pass(git_oid_fromstr(&dummy.id, "f990a25a74d1a8281ce2ab018ea8df66795cd60b"));
+ cl_git_pass(git_oid_fromstr(&dummy.id, "f990a25a74d1a8281ce2ab018ea8df66795cd60b", GIT_OID_SHA1));
dummy.path = "just_a_dir/filea.txt";
cl_git_pass(git_index_add(g_idx, &dummy));
@@ -218,7 +218,7 @@ void test_index_bypath__add_honors_existing_case_4(void)
clar__skip();
dummy.mode = GIT_FILEMODE_BLOB;
- cl_git_pass(git_oid_fromstr(&dummy.id, "f990a25a74d1a8281ce2ab018ea8df66795cd60b"));
+ cl_git_pass(git_oid_fromstr(&dummy.id, "f990a25a74d1a8281ce2ab018ea8df66795cd60b", GIT_OID_SHA1));
dummy.path = "just_a_dir/a/b/c/d/e/file1.txt";
cl_git_pass(git_index_add(g_idx, &dummy));
diff --git a/tests/libgit2/index/cache.c b/tests/libgit2/index/cache.c
index 56885af..ce55ac4 100644
--- a/tests/libgit2/index/cache.c
+++ b/tests/libgit2/index/cache.c
@@ -26,7 +26,7 @@ void test_index_cache__write_extension_at_root(void)
cl_git_pass(git_index_open(&index, index_file));
cl_assert(index->tree == NULL);
- cl_git_pass(git_oid_fromstr(&id, tree_id_str));
+ cl_git_pass(git_oid_fromstr(&id, tree_id_str, GIT_OID_SHA1));
cl_git_pass(git_tree_lookup(&tree, g_repo, &id));
cl_git_pass(git_index_read_tree(index, tree));
git_tree_free(tree);
@@ -58,7 +58,7 @@ void test_index_cache__write_extension_invalidated_root(void)
cl_git_pass(git_index_open(&index, index_file));
cl_assert(index->tree == NULL);
- cl_git_pass(git_oid_fromstr(&id, tree_id_str));
+ cl_git_pass(git_oid_fromstr(&id, tree_id_str, GIT_OID_SHA1));
cl_git_pass(git_tree_lookup(&tree, g_repo, &id));
cl_git_pass(git_index_read_tree(index, tree));
git_tree_free(tree);
@@ -98,7 +98,7 @@ void test_index_cache__read_tree_no_children(void)
cl_git_pass(git_index_new(&index));
cl_assert(index->tree == NULL);
- cl_git_pass(git_oid_fromstr(&id, "45dd856fdd4d89b884c340ba0e047752d9b085d6"));
+ cl_git_pass(git_oid_fromstr(&id, "45dd856fdd4d89b884c340ba0e047752d9b085d6", GIT_OID_SHA1));
cl_git_pass(git_tree_lookup(&tree, g_repo, &id));
cl_git_pass(git_index_read_tree(index, tree));
git_tree_free(tree);
@@ -111,7 +111,7 @@ void test_index_cache__read_tree_no_children(void)
memset(&entry, 0x0, sizeof(git_index_entry));
entry.path = "new.txt";
entry.mode = GIT_FILEMODE_BLOB;
- git_oid_fromstr(&entry.id, "d4bcc68acd4410bf836a39f20afb2c2ece09584e");
+ git_oid_fromstr(&entry.id, "d4bcc68acd4410bf836a39f20afb2c2ece09584e", GIT_OID_SHA1);
cl_git_pass(git_index_add(index, &entry));
cl_assert_equal_i(-1, index->tree->entry_count);
@@ -132,7 +132,7 @@ void test_index_cache__two_levels(void)
memset(&entry, 0x0, sizeof(entry));
entry.mode = GIT_FILEMODE_BLOB;
- cl_git_pass(git_oid_fromstr(&entry.id, "a8233120f6ad708f843d861ce2b7228ec4e3dec6"));
+ cl_git_pass(git_oid_fromstr(&entry.id, "a8233120f6ad708f843d861ce2b7228ec4e3dec6", GIT_OID_SHA1));
entry.path = "top-level.txt";
cl_git_pass(git_index_add(index, &entry));
@@ -156,7 +156,7 @@ void test_index_cache__two_levels(void)
cl_assert(git_tree_cache_get(index->tree, "subdir"));
entry.path = "top-level.txt";
- cl_git_pass(git_oid_fromstr(&entry.id, "3697d64be941a53d4ae8f6a271e4e3fa56b022cc"));
+ cl_git_pass(git_oid_fromstr(&entry.id, "3697d64be941a53d4ae8f6a271e4e3fa56b022cc", GIT_OID_SHA1));
cl_git_pass(git_index_add(index, &entry));
/* writ out the index after we invalidate the root */
@@ -191,7 +191,7 @@ void test_index_cache__read_tree_children(void)
memset(&entry, 0x0, sizeof(git_index_entry));
entry.path = "top-level";
entry.mode = GIT_FILEMODE_BLOB;
- git_oid_fromstr(&entry.id, "ee3fa1b8c00aff7fe02065fdb50864bb0d932ccf");
+ git_oid_fromstr(&entry.id, "ee3fa1b8c00aff7fe02065fdb50864bb0d932ccf", GIT_OID_SHA1);
cl_git_pass(git_index_add(index, &entry));
@@ -217,7 +217,7 @@ void test_index_cache__read_tree_children(void)
/* override with a slightly different id, also dummy */
entry.path = "subdir/some-file";
- git_oid_fromstr(&entry.id, "ee3fa1b8c00aff7fe02065fdb50864bb0d932ccf");
+ git_oid_fromstr(&entry.id, "ee3fa1b8c00aff7fe02065fdb50864bb0d932ccf", GIT_OID_SHA1);
cl_git_pass(git_index_add(index, &entry));
cl_assert_equal_i(-1, index->tree->entry_count);
diff --git a/tests/libgit2/index/conflicts.c b/tests/libgit2/index/conflicts.c
index 41d0e21..a837dcf 100644
--- a/tests/libgit2/index/conflicts.c
+++ b/tests/libgit2/index/conflicts.c
@@ -37,17 +37,17 @@ void test_index_conflicts__add(void)
ancestor_entry.path = "test-one.txt";
ancestor_entry.mode = 0100644;
GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 1);
- git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID);
+ git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID, GIT_OID_SHA1);
our_entry.path = "test-one.txt";
our_entry.mode = 0100644;
GIT_INDEX_ENTRY_STAGE_SET(&our_entry, 2);
- git_oid_fromstr(&our_entry.id, CONFLICTS_ONE_OUR_OID);
+ git_oid_fromstr(&our_entry.id, CONFLICTS_ONE_OUR_OID, GIT_OID_SHA1);
their_entry.path = "test-one.txt";
their_entry.mode = 0100644;
GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 2);
- git_oid_fromstr(&their_entry.id, CONFLICTS_ONE_THEIR_OID);
+ git_oid_fromstr(&their_entry.id, CONFLICTS_ONE_THEIR_OID, GIT_OID_SHA1);
cl_git_pass(git_index_conflict_add(repo_index, &ancestor_entry, &our_entry, &their_entry));
@@ -68,17 +68,17 @@ void test_index_conflicts__add_fixes_incorrect_stage(void)
ancestor_entry.path = "test-one.txt";
ancestor_entry.mode = 0100644;
GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 3);
- git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID);
+ git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID, GIT_OID_SHA1);
our_entry.path = "test-one.txt";
our_entry.mode = 0100644;
GIT_INDEX_ENTRY_STAGE_SET(&our_entry, 1);
- git_oid_fromstr(&our_entry.id, CONFLICTS_ONE_OUR_OID);
+ git_oid_fromstr(&our_entry.id, CONFLICTS_ONE_OUR_OID, GIT_OID_SHA1);
their_entry.path = "test-one.txt";
their_entry.mode = 0100644;
GIT_INDEX_ENTRY_STAGE_SET(&their_entry, 2);
- git_oid_fromstr(&their_entry.id, CONFLICTS_ONE_THEIR_OID);
+ git_oid_fromstr(&their_entry.id, CONFLICTS_ONE_THEIR_OID, GIT_OID_SHA1);
cl_git_pass(git_index_conflict_add(repo_index, &ancestor_entry, &our_entry, &their_entry));
@@ -111,17 +111,17 @@ void test_index_conflicts__add_detects_invalid_filemode(void)
ancestor_entry.path = "test-one.txt";
ancestor_entry.mode = 0100644;
GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 3);
- git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID);
+ git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID, GIT_OID_SHA1);
our_entry.path = "test-one.txt";
our_entry.mode = 0100644;
GIT_INDEX_ENTRY_STAGE_SET(&our_entry, 1);
- git_oid_fromstr(&our_entry.id, CONFLICTS_ONE_OUR_OID);
+ git_oid_fromstr(&our_entry.id, CONFLICTS_ONE_OUR_OID, GIT_OID_SHA1);
their_entry.path = "test-one.txt";
their_entry.mode = 0100644;
GIT_INDEX_ENTRY_STAGE_SET(&their_entry, 2);
- git_oid_fromstr(&their_entry.id, CONFLICTS_ONE_THEIR_OID);
+ git_oid_fromstr(&their_entry.id, CONFLICTS_ONE_THEIR_OID, GIT_OID_SHA1);
/* Corrupt the conflict entry's mode */
conflict_entry[i]->mode = 027431745;
@@ -151,17 +151,17 @@ void test_index_conflicts__add_removes_stage_zero(void)
ancestor_entry.path = "test-one.txt";
ancestor_entry.mode = 0100644;
GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 3);
- git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID);
+ git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID, GIT_OID_SHA1);
our_entry.path = "test-one.txt";
our_entry.mode = 0100644;
GIT_INDEX_ENTRY_STAGE_SET(&our_entry, 1);
- git_oid_fromstr(&our_entry.id, CONFLICTS_ONE_OUR_OID);
+ git_oid_fromstr(&our_entry.id, CONFLICTS_ONE_OUR_OID, GIT_OID_SHA1);
their_entry.path = "test-one.txt";
their_entry.mode = 0100644;
GIT_INDEX_ENTRY_STAGE_SET(&their_entry, 2);
- git_oid_fromstr(&their_entry.id, CONFLICTS_ONE_THEIR_OID);
+ git_oid_fromstr(&their_entry.id, CONFLICTS_ONE_THEIR_OID, GIT_OID_SHA1);
cl_git_pass(git_index_conflict_add(repo_index, &ancestor_entry, &our_entry, &their_entry));
@@ -189,13 +189,13 @@ void test_index_conflicts__get(void)
cl_assert_equal_s("conflicts-one.txt", conflict_entry[0]->path);
- git_oid_fromstr(&oid, CONFLICTS_ONE_ANCESTOR_OID);
+ git_oid_fromstr(&oid, CONFLICTS_ONE_ANCESTOR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&oid, &conflict_entry[0]->id);
- git_oid_fromstr(&oid, CONFLICTS_ONE_OUR_OID);
+ git_oid_fromstr(&oid, CONFLICTS_ONE_OUR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&oid, &conflict_entry[1]->id);
- git_oid_fromstr(&oid, CONFLICTS_ONE_THEIR_OID);
+ git_oid_fromstr(&oid, CONFLICTS_ONE_THEIR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&oid, &conflict_entry[2]->id);
cl_git_pass(git_index_conflict_get(&conflict_entry[0], &conflict_entry[1],
@@ -203,13 +203,13 @@ void test_index_conflicts__get(void)
cl_assert_equal_s("conflicts-two.txt", conflict_entry[0]->path);
- git_oid_fromstr(&oid, CONFLICTS_TWO_ANCESTOR_OID);
+ git_oid_fromstr(&oid, CONFLICTS_TWO_ANCESTOR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&oid, &conflict_entry[0]->id);
- git_oid_fromstr(&oid, CONFLICTS_TWO_OUR_OID);
+ git_oid_fromstr(&oid, CONFLICTS_TWO_OUR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&oid, &conflict_entry[1]->id);
- git_oid_fromstr(&oid, CONFLICTS_TWO_THEIR_OID);
+ git_oid_fromstr(&oid, CONFLICTS_TWO_THEIR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&oid, &conflict_entry[2]->id);
}
@@ -223,29 +223,29 @@ void test_index_conflicts__iterate(void)
cl_git_pass(git_index_conflict_next(&conflict_entry[0], &conflict_entry[1], &conflict_entry[2], iterator));
- git_oid_fromstr(&oid, CONFLICTS_ONE_ANCESTOR_OID);
+ git_oid_fromstr(&oid, CONFLICTS_ONE_ANCESTOR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&oid, &conflict_entry[0]->id);
cl_assert(git__strcmp(conflict_entry[0]->path, "conflicts-one.txt") == 0);
- git_oid_fromstr(&oid, CONFLICTS_ONE_OUR_OID);
+ git_oid_fromstr(&oid, CONFLICTS_ONE_OUR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&oid, &conflict_entry[1]->id);
cl_assert(git__strcmp(conflict_entry[0]->path, "conflicts-one.txt") == 0);
- git_oid_fromstr(&oid, CONFLICTS_ONE_THEIR_OID);
+ git_oid_fromstr(&oid, CONFLICTS_ONE_THEIR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&oid, &conflict_entry[2]->id);
cl_assert(git__strcmp(conflict_entry[0]->path, "conflicts-one.txt") == 0);
cl_git_pass(git_index_conflict_next(&conflict_entry[0], &conflict_entry[1], &conflict_entry[2], iterator));
- git_oid_fromstr(&oid, CONFLICTS_TWO_ANCESTOR_OID);
+ git_oid_fromstr(&oid, CONFLICTS_TWO_ANCESTOR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&oid, &conflict_entry[0]->id);
cl_assert(git__strcmp(conflict_entry[0]->path, "conflicts-two.txt") == 0);
- git_oid_fromstr(&oid, CONFLICTS_TWO_OUR_OID);
+ git_oid_fromstr(&oid, CONFLICTS_TWO_OUR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&oid, &conflict_entry[1]->id);
cl_assert(git__strcmp(conflict_entry[0]->path, "conflicts-two.txt") == 0);
- git_oid_fromstr(&oid, CONFLICTS_TWO_THEIR_OID);
+ git_oid_fromstr(&oid, CONFLICTS_TWO_THEIR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&oid, &conflict_entry[2]->id);
cl_assert(git__strcmp(conflict_entry[0]->path, "conflicts-two.txt") == 0);
@@ -357,7 +357,7 @@ void test_index_conflicts__partial(void)
ancestor_entry.path = "test-one.txt";
ancestor_entry.mode = 0100644;
GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 1);
- git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID);
+ git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID, GIT_OID_SHA1);
cl_git_pass(git_index_conflict_add(repo_index, &ancestor_entry, NULL, NULL));
cl_assert(git_index_entrycount(repo_index) == 9);
@@ -387,17 +387,17 @@ void test_index_conflicts__case_matters(void)
ancestor_entry.path = upper_case;
GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, GIT_INDEX_STAGE_ANCESTOR);
- git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID);
+ git_oid_fromstr(&ancestor_entry.id, CONFLICTS_ONE_ANCESTOR_OID, GIT_OID_SHA1);
ancestor_entry.mode = GIT_FILEMODE_BLOB;
our_entry.path = upper_case;
GIT_INDEX_ENTRY_STAGE_SET(&our_entry, GIT_INDEX_STAGE_OURS);
- git_oid_fromstr(&our_entry.id, CONFLICTS_ONE_OUR_OID);
+ git_oid_fromstr(&our_entry.id, CONFLICTS_ONE_OUR_OID, GIT_OID_SHA1);
our_entry.mode = GIT_FILEMODE_BLOB;
their_entry.path = upper_case;
GIT_INDEX_ENTRY_STAGE_SET(&their_entry, GIT_INDEX_STAGE_THEIRS);
- git_oid_fromstr(&their_entry.id, CONFLICTS_ONE_THEIR_OID);
+ git_oid_fromstr(&their_entry.id, CONFLICTS_ONE_THEIR_OID, GIT_OID_SHA1);
their_entry.mode = GIT_FILEMODE_BLOB;
cl_git_pass(git_index_conflict_add(repo_index,
@@ -405,17 +405,17 @@ void test_index_conflicts__case_matters(void)
ancestor_entry.path = mixed_case;
GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, GIT_INDEX_STAGE_ANCESTOR);
- git_oid_fromstr(&ancestor_entry.id, CONFLICTS_TWO_ANCESTOR_OID);
+ git_oid_fromstr(&ancestor_entry.id, CONFLICTS_TWO_ANCESTOR_OID, GIT_OID_SHA1);
ancestor_entry.mode = GIT_FILEMODE_BLOB;
our_entry.path = mixed_case;
GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, GIT_INDEX_STAGE_ANCESTOR);
- git_oid_fromstr(&our_entry.id, CONFLICTS_TWO_OUR_OID);
+ git_oid_fromstr(&our_entry.id, CONFLICTS_TWO_OUR_OID, GIT_OID_SHA1);
ancestor_entry.mode = GIT_FILEMODE_BLOB;
their_entry.path = mixed_case;
GIT_INDEX_ENTRY_STAGE_SET(&their_entry, GIT_INDEX_STAGE_THEIRS);
- git_oid_fromstr(&their_entry.id, CONFLICTS_TWO_THEIR_OID);
+ git_oid_fromstr(&their_entry.id, CONFLICTS_TWO_THEIR_OID, GIT_OID_SHA1);
their_entry.mode = GIT_FILEMODE_BLOB;
cl_git_pass(git_index_conflict_add(repo_index,
@@ -434,29 +434,29 @@ void test_index_conflicts__case_matters(void)
correct_case = upper_case;
cl_assert_equal_s(correct_case, conflict_entry[0]->path);
- git_oid_fromstr(&oid, ignorecase ? CONFLICTS_TWO_ANCESTOR_OID : CONFLICTS_ONE_ANCESTOR_OID);
+ git_oid_fromstr(&oid, ignorecase ? CONFLICTS_TWO_ANCESTOR_OID : CONFLICTS_ONE_ANCESTOR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&oid, &conflict_entry[0]->id);
cl_assert_equal_s(correct_case, conflict_entry[1]->path);
- git_oid_fromstr(&oid, ignorecase ? CONFLICTS_TWO_OUR_OID : CONFLICTS_ONE_OUR_OID);
+ git_oid_fromstr(&oid, ignorecase ? CONFLICTS_TWO_OUR_OID : CONFLICTS_ONE_OUR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&oid, &conflict_entry[1]->id);
cl_assert_equal_s(correct_case, conflict_entry[2]->path);
- git_oid_fromstr(&oid, ignorecase ? CONFLICTS_TWO_THEIR_OID : CONFLICTS_ONE_THEIR_OID);
+ git_oid_fromstr(&oid, ignorecase ? CONFLICTS_TWO_THEIR_OID : CONFLICTS_ONE_THEIR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&oid, &conflict_entry[2]->id);
cl_git_pass(git_index_conflict_get(&conflict_entry[0], &conflict_entry[1],
&conflict_entry[2], repo_index, mixed_case));
cl_assert_equal_s(mixed_case, conflict_entry[0]->path);
- git_oid_fromstr(&oid, CONFLICTS_TWO_ANCESTOR_OID);
+ git_oid_fromstr(&oid, CONFLICTS_TWO_ANCESTOR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&oid, &conflict_entry[0]->id);
cl_assert_equal_s(mixed_case, conflict_entry[1]->path);
- git_oid_fromstr(&oid, CONFLICTS_TWO_OUR_OID);
+ git_oid_fromstr(&oid, CONFLICTS_TWO_OUR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&oid, &conflict_entry[1]->id);
cl_assert_equal_s(mixed_case, conflict_entry[2]->path);
- git_oid_fromstr(&oid, CONFLICTS_TWO_THEIR_OID);
+ git_oid_fromstr(&oid, CONFLICTS_TWO_THEIR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&oid, &conflict_entry[2]->id);
}
diff --git a/tests/libgit2/index/crlf.c b/tests/libgit2/index/crlf.c
index 7520c23..a0eb94b 100644
--- a/tests/libgit2/index/crlf.c
+++ b/tests/libgit2/index/crlf.c
@@ -244,7 +244,8 @@ void test_index_crlf__autocrlf_false_no_attrs(void)
entry = git_index_get_bypath(g_index, "newfile.txt", 0);
cl_git_pass(git_oid_fromstr(&oid,
- (GIT_EOL_NATIVE == GIT_EOL_CRLF) ? FILE_OID_CRLF : FILE_OID_LF));
+ (GIT_EOL_NATIVE == GIT_EOL_CRLF) ? FILE_OID_CRLF : FILE_OID_LF,
+ GIT_OID_SHA1));
cl_assert_equal_oid(&oid, &entry->id);
}
@@ -261,7 +262,7 @@ void test_index_crlf__autocrlf_true_no_attrs(void)
cl_git_pass(git_index_add_bypath(g_index, "newfile.txt"));
entry = git_index_get_bypath(g_index, "newfile.txt", 0);
- cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF));
+ cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF, GIT_OID_SHA1));
cl_assert_equal_oid(&oid, &entry->id);
}
@@ -278,7 +279,7 @@ void test_index_crlf__autocrlf_input_no_attrs(void)
cl_git_pass(git_index_add_bypath(g_index, "newfile.txt"));
entry = git_index_get_bypath(g_index, "newfile.txt", 0);
- cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF));
+ cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF, GIT_OID_SHA1));
cl_assert_equal_oid(&oid, &entry->id);
}
@@ -297,7 +298,7 @@ void test_index_crlf__autocrlf_false_text_auto_attr(void)
cl_git_pass(git_index_add_bypath(g_index, "newfile.txt"));
entry = git_index_get_bypath(g_index, "newfile.txt", 0);
- cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF));
+ cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF, GIT_OID_SHA1));
cl_assert_equal_oid(&oid, &entry->id);
}
@@ -316,7 +317,7 @@ void test_index_crlf__autocrlf_true_text_auto_attr(void)
cl_git_pass(git_index_add_bypath(g_index, "newfile.txt"));
entry = git_index_get_bypath(g_index, "newfile.txt", 0);
- cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF));
+ cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF, GIT_OID_SHA1));
cl_assert_equal_oid(&oid, &entry->id);
}
@@ -335,7 +336,7 @@ void test_index_crlf__autocrlf_input_text_auto_attr(void)
cl_git_pass(git_index_add_bypath(g_index, "newfile.txt"));
entry = git_index_get_bypath(g_index, "newfile.txt", 0);
- cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF));
+ cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF, GIT_OID_SHA1));
cl_assert_equal_oid(&oid, &entry->id);
}
@@ -355,7 +356,7 @@ void test_index_crlf__safecrlf_true_autocrlf_input_text_auto_attr(void)
entry = git_index_get_bypath(g_index, "newfile.txt", 0);
cl_assert(entry);
- cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF));
+ cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF, GIT_OID_SHA1));
cl_assert_equal_oid(&oid, &entry->id);
cl_git_mkfile("./crlf/newfile2.txt", FILE_CONTENTS_CRLF);
@@ -376,7 +377,7 @@ void test_index_crlf__safecrlf_true_autocrlf_input_text__no_attr(void)
entry = git_index_get_bypath(g_index, "newfile.txt", 0);
cl_assert(entry);
- cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF));
+ cl_git_pass(git_oid_fromstr(&oid, FILE_OID_LF, GIT_OID_SHA1));
cl_assert_equal_oid(&oid, &entry->id);
cl_git_mkfile("./crlf/newfile2.txt", FILE_CONTENTS_CRLF);
diff --git a/tests/libgit2/index/names.c b/tests/libgit2/index/names.c
index 369318b..48934de 100644
--- a/tests/libgit2/index/names.c
+++ b/tests/libgit2/index/names.c
@@ -42,21 +42,21 @@ static void index_add_conflicts(void)
entry.path = conflict[0];
entry.mode = GIT_FILEMODE_BLOB;
GIT_INDEX_ENTRY_STAGE_SET(&entry, GIT_INDEX_STAGE_ANCESTOR);
- git_oid_fromstr(&entry.id, "1f85ca51b8e0aac893a621b61a9c2661d6aa6d81");
+ git_oid_fromstr(&entry.id, "1f85ca51b8e0aac893a621b61a9c2661d6aa6d81", GIT_OID_SHA1);
cl_git_pass(git_index_add(repo_index, &entry));
/* ours */
entry.path = conflict[1];
entry.mode = GIT_FILEMODE_BLOB;
GIT_INDEX_ENTRY_STAGE_SET(&entry, GIT_INDEX_STAGE_OURS);
- git_oid_fromstr(&entry.id, "1f85ca51b8e0aac893a621b61a9c2661d6aa6d81");
+ git_oid_fromstr(&entry.id, "1f85ca51b8e0aac893a621b61a9c2661d6aa6d81", GIT_OID_SHA1);
cl_git_pass(git_index_add(repo_index, &entry));
/* theirs */
entry.path = conflict[2];
entry.mode = GIT_FILEMODE_BLOB;
GIT_INDEX_ENTRY_STAGE_SET(&entry, GIT_INDEX_STAGE_THEIRS);
- git_oid_fromstr(&entry.id, "1f85ca51b8e0aac893a621b61a9c2661d6aa6d81");
+ git_oid_fromstr(&entry.id, "1f85ca51b8e0aac893a621b61a9c2661d6aa6d81", GIT_OID_SHA1);
cl_git_pass(git_index_add(repo_index, &entry));
}
}
diff --git a/tests/libgit2/index/read_index.c b/tests/libgit2/index/read_index.c
index 836c12b..e44574d 100644
--- a/tests/libgit2/index/read_index.c
+++ b/tests/libgit2/index/read_index.c
@@ -49,7 +49,7 @@ void test_index_read_index__maintains_stat_cache(void)
/* add a new entry that will not have stat data */
memset(&new_entry, 0, sizeof(git_index_entry));
new_entry.path = "Hello";
- git_oid_fromstr(&new_entry.id, "0123456789012345678901234567890123456789");
+ git_oid_fromstr(&new_entry.id, "0123456789012345678901234567890123456789", GIT_OID_SHA1);
new_entry.file_size = 1234;
new_entry.mode = 0100644;
cl_git_pass(git_index_add(new_index, &new_entry));
@@ -79,7 +79,7 @@ static bool roundtrip_with_read_index(const char *tree_idstr)
git_tree *tree;
git_index *tree_index;
- cl_git_pass(git_oid_fromstr(&tree_id, tree_idstr));
+ cl_git_pass(git_oid_fromstr(&tree_id, tree_idstr, GIT_OID_SHA1));
cl_git_pass(git_tree_lookup(&tree, _repo, &tree_id));
cl_git_pass(git_index_new(&tree_index));
cl_git_pass(git_index_read_tree(tree_index, tree));
@@ -111,7 +111,7 @@ void test_index_read_index__read_and_writes(void)
git_tree *tree;
git_index *tree_index, *new_index;
- cl_git_pass(git_oid_fromstr(&tree_id, "ae90f12eea699729ed24555e40b9fd669da12a12"));
+ cl_git_pass(git_oid_fromstr(&tree_id, "ae90f12eea699729ed24555e40b9fd669da12a12", GIT_OID_SHA1));
cl_git_pass(git_tree_lookup(&tree, _repo, &tree_id));
cl_git_pass(git_index_new(&tree_index));
cl_git_pass(git_index_read_tree(tree_index, tree));
@@ -148,17 +148,17 @@ static void add_conflicts(git_index *index, const char *filename)
ancestor_entry.path = filename;
ancestor_entry.mode = 0100644;
GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 1);
- git_oid_fromstr(&ancestor_entry.id, ancestor_ids[conflict_idx]);
+ git_oid_fromstr(&ancestor_entry.id, ancestor_ids[conflict_idx], GIT_OID_SHA1);
our_entry.path = filename;
our_entry.mode = 0100644;
GIT_INDEX_ENTRY_STAGE_SET(&our_entry, 2);
- git_oid_fromstr(&our_entry.id, our_ids[conflict_idx]);
+ git_oid_fromstr(&our_entry.id, our_ids[conflict_idx], GIT_OID_SHA1);
their_entry.path = filename;
their_entry.mode = 0100644;
GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 2);
- git_oid_fromstr(&their_entry.id, their_ids[conflict_idx]);
+ git_oid_fromstr(&their_entry.id, their_ids[conflict_idx], GIT_OID_SHA1);
cl_git_pass(git_index_conflict_add(index, &ancestor_entry,
&our_entry, &their_entry));
@@ -172,7 +172,7 @@ void test_index_read_index__handles_conflicts(void)
git_index_conflict_iterator *conflict_iterator;
const git_index_entry *ancestor, *ours, *theirs;
- cl_git_pass(git_oid_fromstr(&tree_id, "ae90f12eea699729ed24555e40b9fd669da12a12"));
+ cl_git_pass(git_oid_fromstr(&tree_id, "ae90f12eea699729ed24555e40b9fd669da12a12", GIT_OID_SHA1));
cl_git_pass(git_tree_lookup(&tree, _repo, &tree_id));
cl_git_pass(git_index_new(&index));
cl_git_pass(git_index_new(&new_index));
diff --git a/tests/libgit2/index/rename.c b/tests/libgit2/index/rename.c
index 86eaf00..8d5d59d 100644
--- a/tests/libgit2/index/rename.c
+++ b/tests/libgit2/index/rename.c
@@ -22,7 +22,7 @@ void test_index_rename__single_file(void)
cl_git_pass(git_index_add_bypath(index, "lame.name.txt"));
cl_assert(git_index_entrycount(index) == 1);
- cl_git_pass(git_oid_fromstr(&expected, "d4fa8600b4f37d7516bef4816ae2c64dbf029e3a"));
+ cl_git_pass(git_oid_fromstr(&expected, "d4fa8600b4f37d7516bef4816ae2c64dbf029e3a", GIT_OID_SHA1));
cl_assert(!git_index_find(&position, index, "lame.name.txt"));
diff --git a/tests/libgit2/index/reuc.c b/tests/libgit2/index/reuc.c
index 1f95c41..7468884 100644
--- a/tests/libgit2/index/reuc.c
+++ b/tests/libgit2/index/reuc.c
@@ -38,9 +38,9 @@ void test_index_reuc__add(void)
git_oid ancestor_oid, our_oid, their_oid;
const git_index_reuc_entry *reuc;
- git_oid_fromstr(&ancestor_oid, ONE_ANCESTOR_OID);
- git_oid_fromstr(&our_oid, ONE_OUR_OID);
- git_oid_fromstr(&their_oid, ONE_THEIR_OID);
+ git_oid_fromstr(&ancestor_oid, ONE_ANCESTOR_OID, GIT_OID_SHA1);
+ git_oid_fromstr(&our_oid, ONE_OUR_OID, GIT_OID_SHA1);
+ git_oid_fromstr(&their_oid, ONE_THEIR_OID, GIT_OID_SHA1);
cl_git_pass(git_index_reuc_add(repo_index, "newfile.txt",
0100644, &ancestor_oid,
@@ -66,8 +66,8 @@ void test_index_reuc__add_no_ancestor(void)
const git_index_reuc_entry *reuc;
memset(&ancestor_oid, 0x0, sizeof(git_oid));
- git_oid_fromstr(&our_oid, ONE_OUR_OID);
- git_oid_fromstr(&their_oid, ONE_THEIR_OID);
+ git_oid_fromstr(&our_oid, ONE_OUR_OID, GIT_OID_SHA1);
+ git_oid_fromstr(&their_oid, ONE_THEIR_OID, GIT_OID_SHA1);
cl_git_pass(git_index_reuc_add(repo_index, "newfile.txt",
0, NULL,
@@ -100,11 +100,11 @@ void test_index_reuc__read_bypath(void)
cl_assert(reuc->mode[0] == 0100644);
cl_assert(reuc->mode[1] == 0100644);
cl_assert(reuc->mode[2] == 0100644);
- git_oid_fromstr(&oid, TWO_ANCESTOR_OID);
+ git_oid_fromstr(&oid, TWO_ANCESTOR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&reuc->oid[0], &oid);
- git_oid_fromstr(&oid, TWO_OUR_OID);
+ git_oid_fromstr(&oid, TWO_OUR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&reuc->oid[1], &oid);
- git_oid_fromstr(&oid, TWO_THEIR_OID);
+ git_oid_fromstr(&oid, TWO_THEIR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&reuc->oid[2], &oid);
cl_assert(reuc = git_index_reuc_get_bypath(repo_index, "one.txt"));
@@ -113,11 +113,11 @@ void test_index_reuc__read_bypath(void)
cl_assert(reuc->mode[0] == 0100644);
cl_assert(reuc->mode[1] == 0100644);
cl_assert(reuc->mode[2] == 0100644);
- git_oid_fromstr(&oid, ONE_ANCESTOR_OID);
+ git_oid_fromstr(&oid, ONE_ANCESTOR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&reuc->oid[0], &oid);
- git_oid_fromstr(&oid, ONE_OUR_OID);
+ git_oid_fromstr(&oid, ONE_OUR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&reuc->oid[1], &oid);
- git_oid_fromstr(&oid, ONE_THEIR_OID);
+ git_oid_fromstr(&oid, ONE_THEIR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&reuc->oid[2], &oid);
}
@@ -145,11 +145,11 @@ void test_index_reuc__ignore_case(void)
cl_assert(reuc->mode[0] == 0100644);
cl_assert(reuc->mode[1] == 0100644);
cl_assert(reuc->mode[2] == 0100644);
- git_oid_fromstr(&oid, TWO_ANCESTOR_OID);
+ git_oid_fromstr(&oid, TWO_ANCESTOR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&reuc->oid[0], &oid);
- git_oid_fromstr(&oid, TWO_OUR_OID);
+ git_oid_fromstr(&oid, TWO_OUR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&reuc->oid[1], &oid);
- git_oid_fromstr(&oid, TWO_THEIR_OID);
+ git_oid_fromstr(&oid, TWO_THEIR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&reuc->oid[2], &oid);
}
@@ -166,11 +166,11 @@ void test_index_reuc__read_byindex(void)
cl_assert(reuc->mode[0] == 0100644);
cl_assert(reuc->mode[1] == 0100644);
cl_assert(reuc->mode[2] == 0100644);
- git_oid_fromstr(&oid, ONE_ANCESTOR_OID);
+ git_oid_fromstr(&oid, ONE_ANCESTOR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&reuc->oid[0], &oid);
- git_oid_fromstr(&oid, ONE_OUR_OID);
+ git_oid_fromstr(&oid, ONE_OUR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&reuc->oid[1], &oid);
- git_oid_fromstr(&oid, ONE_THEIR_OID);
+ git_oid_fromstr(&oid, ONE_THEIR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&reuc->oid[2], &oid);
cl_assert(reuc = git_index_reuc_get_byindex(repo_index, 1));
@@ -179,11 +179,11 @@ void test_index_reuc__read_byindex(void)
cl_assert(reuc->mode[0] == 0100644);
cl_assert(reuc->mode[1] == 0100644);
cl_assert(reuc->mode[2] == 0100644);
- git_oid_fromstr(&oid, TWO_ANCESTOR_OID);
+ git_oid_fromstr(&oid, TWO_ANCESTOR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&reuc->oid[0], &oid);
- git_oid_fromstr(&oid, TWO_OUR_OID);
+ git_oid_fromstr(&oid, TWO_OUR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&reuc->oid[1], &oid);
- git_oid_fromstr(&oid, TWO_THEIR_OID);
+ git_oid_fromstr(&oid, TWO_THEIR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&reuc->oid[2], &oid);
}
@@ -200,9 +200,9 @@ void test_index_reuc__updates_existing(void)
index_caps |= GIT_INDEX_CAPABILITY_IGNORE_CASE;
cl_git_pass(git_index_set_caps(repo_index, index_caps));
- git_oid_fromstr(&ancestor_oid, TWO_ANCESTOR_OID);
- git_oid_fromstr(&our_oid, TWO_OUR_OID);
- git_oid_fromstr(&their_oid, TWO_THEIR_OID);
+ git_oid_fromstr(&ancestor_oid, TWO_ANCESTOR_OID, GIT_OID_SHA1);
+ git_oid_fromstr(&our_oid, TWO_OUR_OID, GIT_OID_SHA1);
+ git_oid_fromstr(&their_oid, TWO_THEIR_OID, GIT_OID_SHA1);
cl_git_pass(git_index_reuc_add(repo_index, "two.txt",
0100644, &ancestor_oid,
@@ -219,11 +219,11 @@ void test_index_reuc__updates_existing(void)
cl_assert(reuc = git_index_reuc_get_byindex(repo_index, 0));
cl_assert_equal_s("TWO.txt", reuc->path);
- git_oid_fromstr(&oid, TWO_OUR_OID);
+ git_oid_fromstr(&oid, TWO_OUR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&reuc->oid[0], &oid);
- git_oid_fromstr(&oid, TWO_THEIR_OID);
+ git_oid_fromstr(&oid, TWO_THEIR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&reuc->oid[1], &oid);
- git_oid_fromstr(&oid, TWO_ANCESTOR_OID);
+ git_oid_fromstr(&oid, TWO_ANCESTOR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&reuc->oid[2], &oid);
}
@@ -245,11 +245,11 @@ void test_index_reuc__remove(void)
cl_assert(reuc->mode[0] == 0100644);
cl_assert(reuc->mode[1] == 0100644);
cl_assert(reuc->mode[2] == 0100644);
- git_oid_fromstr(&oid, TWO_ANCESTOR_OID);
+ git_oid_fromstr(&oid, TWO_ANCESTOR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&reuc->oid[0], &oid);
- git_oid_fromstr(&oid, TWO_OUR_OID);
+ git_oid_fromstr(&oid, TWO_OUR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&reuc->oid[1], &oid);
- git_oid_fromstr(&oid, TWO_THEIR_OID);
+ git_oid_fromstr(&oid, TWO_THEIR_OID, GIT_OID_SHA1);
cl_assert_equal_oid(&reuc->oid[2], &oid);
}
@@ -261,18 +261,18 @@ void test_index_reuc__write(void)
git_index_clear(repo_index);
/* Write out of order to ensure sorting is correct */
- git_oid_fromstr(&ancestor_oid, TWO_ANCESTOR_OID);
- git_oid_fromstr(&our_oid, TWO_OUR_OID);
- git_oid_fromstr(&their_oid, TWO_THEIR_OID);
+ git_oid_fromstr(&ancestor_oid, TWO_ANCESTOR_OID, GIT_OID_SHA1);
+ git_oid_fromstr(&our_oid, TWO_OUR_OID, GIT_OID_SHA1);
+ git_oid_fromstr(&their_oid, TWO_THEIR_OID, GIT_OID_SHA1);
cl_git_pass(git_index_reuc_add(repo_index, "two.txt",
0100644, &ancestor_oid,
0100644, &our_oid,
0100644, &their_oid));
- git_oid_fromstr(&ancestor_oid, ONE_ANCESTOR_OID);
- git_oid_fromstr(&our_oid, ONE_OUR_OID);
- git_oid_fromstr(&their_oid, ONE_THEIR_OID);
+ git_oid_fromstr(&ancestor_oid, ONE_ANCESTOR_OID, GIT_OID_SHA1);
+ git_oid_fromstr(&our_oid, ONE_OUR_OID, GIT_OID_SHA1);
+ git_oid_fromstr(&their_oid, ONE_THEIR_OID, GIT_OID_SHA1);
cl_git_pass(git_index_reuc_add(repo_index, "one.txt",
0100644, &ancestor_oid,
diff --git a/tests/libgit2/index/tests.c b/tests/libgit2/index/tests.c
index 205d12e..4df1e98 100644
--- a/tests/libgit2/index/tests.c
+++ b/tests/libgit2/index/tests.c
@@ -259,7 +259,7 @@ void test_index_tests__add(void)
* This has been generated by executing the following
* $ echo "hey there" | git hash-object --stdin
*/
- cl_git_pass(git_oid_fromstr(&id1, "a8233120f6ad708f843d861ce2b7228ec4e3dec6"));
+ cl_git_pass(git_oid_fromstr(&id1, "a8233120f6ad708f843d861ce2b7228ec4e3dec6", GIT_OID_SHA1));
/* Add the new file to the index */
cl_git_pass(git_index_add_bypath(index, "test.txt"));
@@ -304,7 +304,7 @@ void test_index_tests__add_frombuffer(void)
* This has been generated by executing the following
* $ echo "hey there" | git hash-object --stdin
*/
- cl_git_pass(git_oid_fromstr(&id1, "a8233120f6ad708f843d861ce2b7228ec4e3dec6"));
+ cl_git_pass(git_oid_fromstr(&id1, "a8233120f6ad708f843d861ce2b7228ec4e3dec6", GIT_OID_SHA1));
/* Add the new file to the index */
memset(&entry, 0x0, sizeof(git_index_entry));
@@ -447,7 +447,7 @@ void test_index_tests__add_frombuffer_reset_entry(void)
* This has been generated by executing the following
* $ echo "hey there" | git hash-object --stdin
*/
- cl_git_pass(git_oid_fromstr(&id1, "a8233120f6ad708f843d861ce2b7228ec4e3dec6"));
+ cl_git_pass(git_oid_fromstr(&id1, "a8233120f6ad708f843d861ce2b7228ec4e3dec6", GIT_OID_SHA1));
cl_git_pass(git_index_add_bypath(index, "test.txt"));
@@ -511,7 +511,7 @@ void test_index_tests__add_issue_1397(void)
* This has been generated by executing the following
* $ git hash-object crlf_file.txt
*/
- cl_git_pass(git_oid_fromstr(&id1, "8312e0889a9cbab77c732b6bc39b51a683e3a318"));
+ cl_git_pass(git_oid_fromstr(&id1, "8312e0889a9cbab77c732b6bc39b51a683e3a318", GIT_OID_SHA1));
/* Make sure the initial SHA-1 is correct */
cl_assert((entry = git_index_get_bypath(index, "crlf_file.txt", 0)) != NULL);
@@ -600,7 +600,7 @@ static void assert_add_fails(git_repository *repo, const char *fn)
entry.path = fn;
entry.mode = GIT_FILEMODE_BLOB;
- cl_git_pass(git_oid_fromstr(&entry.id, "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"));
+ cl_git_pass(git_oid_fromstr(&entry.id, "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", GIT_OID_SHA1));
cl_git_fail(git_index_add(index, &entry));
@@ -705,7 +705,7 @@ void test_index_tests__write_tree_invalid_unowned_index(void)
cl_git_pass(git_index_new(&idx));
- cl_git_pass(git_oid_fromstr(&entry.id, "8312e0a89a9cbab77c732b6bc39b51a783e3a318"));
+ cl_git_pass(git_oid_fromstr(&entry.id, "8312e0a89a9cbab77c732b6bc39b51a783e3a318", GIT_OID_SHA1));
entry.path = "foo";
entry.mode = GIT_FILEMODE_BLOB;
cl_git_pass(git_index_add(idx, &entry));
@@ -1147,12 +1147,12 @@ void test_index_tests__can_modify_while_iterating(void)
* ensure that our iterator is backed by a snapshot and thus returns
* the number of entries from when the iterator was created.
*/
- cl_git_pass(git_oid_fromstr(&new_entry.id, "8312e0a89a9cbab77c732b6bc39b51a783e3a318"));
+ cl_git_pass(git_oid_fromstr(&new_entry.id, "8312e0a89a9cbab77c732b6bc39b51a783e3a318", GIT_OID_SHA1));
new_entry.path = "newfile";
new_entry.mode = GIT_FILEMODE_BLOB;
cl_git_pass(git_index_add(index, &new_entry));
- cl_git_pass(git_oid_fromstr(&new_entry.id, "4141414141414141414141414141414141414141"));
+ cl_git_pass(git_oid_fromstr(&new_entry.id, "4141414141414141414141414141414141414141", GIT_OID_SHA1));
new_entry.path = "Makefile";
new_entry.mode = GIT_FILEMODE_BLOB;
cl_git_pass(git_index_add(index, &new_entry));
diff --git a/tests/libgit2/iterator/index.c b/tests/libgit2/iterator/index.c
index 7218b4f..a4a3447 100644
--- a/tests/libgit2/iterator/index.c
+++ b/tests/libgit2/iterator/index.c
@@ -52,7 +52,7 @@ static void index_iterator_test(
if (expected_oids != NULL) {
git_oid oid;
- cl_git_pass(git_oid_fromstr(&oid, expected_oids[count]));
+ cl_git_pass(git_oid_fromstr(&oid, expected_oids[count], GIT_OID_SHA1));
cl_assert_equal_oid(&oid, &entry->id);
}
@@ -999,7 +999,7 @@ static void create_paths(git_index *index, const char *root, int depth)
memset(&entry, 0, sizeof(git_index_entry));
entry.path = fullpath.ptr;
entry.mode = GIT_FILEMODE_BLOB;
- git_oid_fromstr(&entry.id, "d44e18fb93b7107b5cd1b95d601591d77869a1b6");
+ git_oid_fromstr(&entry.id, "d44e18fb93b7107b5cd1b95d601591d77869a1b6", GIT_OID_SHA1);
cl_git_pass(git_index_add(index, &entry));
} else if (depth > 0) {
@@ -1296,17 +1296,17 @@ static void add_conflict(
ancestor.path = ancestor_path;
ancestor.mode = GIT_FILEMODE_BLOB;
- git_oid_fromstr(&ancestor.id, "d44e18fb93b7107b5cd1b95d601591d77869a1b6");
+ git_oid_fromstr(&ancestor.id, "d44e18fb93b7107b5cd1b95d601591d77869a1b6", GIT_OID_SHA1);
GIT_INDEX_ENTRY_STAGE_SET(&ancestor, 1);
ours.path = our_path;
ours.mode = GIT_FILEMODE_BLOB;
- git_oid_fromstr(&ours.id, "d44e18fb93b7107b5cd1b95d601591d77869a1b6");
+ git_oid_fromstr(&ours.id, "d44e18fb93b7107b5cd1b95d601591d77869a1b6", GIT_OID_SHA1);
GIT_INDEX_ENTRY_STAGE_SET(&ours, 2);
theirs.path = their_path;
theirs.mode = GIT_FILEMODE_BLOB;
- git_oid_fromstr(&theirs.id, "d44e18fb93b7107b5cd1b95d601591d77869a1b6");
+ git_oid_fromstr(&theirs.id, "d44e18fb93b7107b5cd1b95d601591d77869a1b6", GIT_OID_SHA1);
GIT_INDEX_ENTRY_STAGE_SET(&theirs, 3);
cl_git_pass(git_index_conflict_add(index, &ancestor, &ours, &theirs));
diff --git a/tests/libgit2/iterator/tree.c b/tests/libgit2/iterator/tree.c
index 06a920a..30d87f8 100644
--- a/tests/libgit2/iterator/tree.c
+++ b/tests/libgit2/iterator/tree.c
@@ -675,7 +675,7 @@ void test_iterator_tree__case_conflicts_0(void)
g_repo = cl_git_sandbox_init("icase");
- cl_git_pass(git_oid_fromstr(&blob_id, blob_sha)); /* lookup blob */
+ cl_git_pass(git_oid_fromstr(&blob_id, blob_sha, GIT_OID_SHA1)); /* lookup blob */
/* create tree with: A/1.file, A/3.file, a/2.file, a/4.file */
build_test_tree(
@@ -729,7 +729,7 @@ void test_iterator_tree__case_conflicts_1(void)
g_repo = cl_git_sandbox_init("icase");
- cl_git_pass(git_oid_fromstr(&blob_id, blob_sha)); /* lookup blob */
+ cl_git_pass(git_oid_fromstr(&blob_id, blob_sha, GIT_OID_SHA1)); /* lookup blob */
/* create: A/a A/b/1 A/c a/a a/b a/C */
build_test_tree(&Ab_id, g_repo, "b|1|", &blob_id);
@@ -798,7 +798,7 @@ void test_iterator_tree__case_conflicts_2(void)
g_repo = cl_git_sandbox_init("icase");
- cl_git_pass(git_oid_fromstr(&blob_id, blob_sha)); /* lookup blob */
+ cl_git_pass(git_oid_fromstr(&blob_id, blob_sha, GIT_OID_SHA1)); /* lookup blob */
build_test_tree(&d1, g_repo, "b|16|,b|foo|", &blob_id, &blob_id);
build_test_tree(&d2, g_repo, "b|15|,b|FOO|", &blob_id, &blob_id);
diff --git a/tests/libgit2/iterator/workdir.c b/tests/libgit2/iterator/workdir.c
index 112cd9a..b2f481e 100644
--- a/tests/libgit2/iterator/workdir.c
+++ b/tests/libgit2/iterator/workdir.c
@@ -1514,7 +1514,7 @@ void test_iterator_workdir__hash_when_requested(void)
for (i = 0; i < sizeof(expected) / sizeof(struct merge_index_entry); i++) {
cl_git_pass(git_iterator_advance(&entry, iter));
- cl_git_pass(git_oid_fromstr(&expected_id, expected[i].oid_str));
+ cl_git_pass(git_oid_fromstr(&expected_id, expected[i].oid_str, GIT_OID_SHA1));
cl_assert_equal_oid(&expected_id, &entry->id);
cl_assert_equal_s(expected[i].path, entry->path);
}
diff --git a/tests/libgit2/merge/driver.c b/tests/libgit2/merge/driver.c
index b7d320c..3483feb 100644
--- a/tests/libgit2/merge/driver.c
+++ b/tests/libgit2/merge/driver.c
@@ -22,7 +22,7 @@ void test_merge_driver__initialize(void)
repo = cl_git_sandbox_init(TEST_REPO_PATH);
git_repository_index(&repo_index, repo);
- git_oid_fromstr(&automergeable_id, AUTOMERGEABLE_IDSTR);
+ git_oid_fromstr(&automergeable_id, AUTOMERGEABLE_IDSTR, GIT_OID_SHA1);
/* Ensure that the user's merge.conflictstyle doesn't interfere */
cl_git_pass(git_repository_config(&cfg, repo));
@@ -145,7 +145,7 @@ static void merge_branch(void)
git_oid their_id;
git_annotated_commit *their_head;
- cl_git_pass(git_oid_fromstr(&their_id, BRANCH_ID));
+ cl_git_pass(git_oid_fromstr(&their_id, BRANCH_ID, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&their_head, repo, &their_id));
cl_git_pass(git_merge(repo, (const git_annotated_commit **)&their_head,
@@ -299,7 +299,7 @@ void test_merge_driver__default_can_be_specified(void)
merge_opts.default_driver = "custom";
- cl_git_pass(git_oid_fromstr(&their_id, BRANCH_ID));
+ cl_git_pass(git_oid_fromstr(&their_id, BRANCH_ID, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&their_head, repo, &their_id));
cl_git_pass(git_merge(repo, (const git_annotated_commit **)&their_head,
diff --git a/tests/libgit2/merge/files.c b/tests/libgit2/merge/files.c
index 6296f3b..8d24255 100644
--- a/tests/libgit2/merge/files.c
+++ b/tests/libgit2/merge/files.c
@@ -149,15 +149,15 @@ void test_merge_files__automerge_from_index(void)
git_merge_file_result result = {0};
git_index_entry ancestor, ours, theirs;
- git_oid_fromstr(&ancestor.id, "6212c31dab5e482247d7977e4f0dd3601decf13b");
+ git_oid_fromstr(&ancestor.id, "6212c31dab5e482247d7977e4f0dd3601decf13b", GIT_OID_SHA1);
ancestor.path = "automergeable.txt";
ancestor.mode = 0100644;
- git_oid_fromstr(&ours.id, "ee3fa1b8c00aff7fe02065fdb50864bb0d932ccf");
+ git_oid_fromstr(&ours.id, "ee3fa1b8c00aff7fe02065fdb50864bb0d932ccf", GIT_OID_SHA1);
ours.path = "automergeable.txt";
ours.mode = 0100755;
- git_oid_fromstr(&theirs.id, "058541fc37114bfc1dddf6bd6bffc7fae5c2e6fe");
+ git_oid_fromstr(&theirs.id, "058541fc37114bfc1dddf6bd6bffc7fae5c2e6fe", GIT_OID_SHA1);
theirs.path = "newname.txt";
theirs.mode = 0100644;
diff --git a/tests/libgit2/merge/merge_helpers.c b/tests/libgit2/merge/merge_helpers.c
index ce3cd22..6efd3b9 100644
--- a/tests/libgit2/merge/merge_helpers.c
+++ b/tests/libgit2/merge/merge_helpers.c
@@ -165,7 +165,7 @@ static int index_entry_eq_merge_index_entry(const struct merge_index_entry *expe
bool test_oid;
if (strlen(expected->oid_str) != 0) {
- cl_git_pass(git_oid_fromstr(&expected_oid, expected->oid_str));
+ cl_git_pass(git_oid_fromstr(&expected_oid, expected->oid_str, GIT_OID_SHA1));
test_oid = 1;
} else
test_oid = 0;
@@ -304,21 +304,21 @@ int merge_test_reuc(git_index *index, const struct merge_reuc_entry expected[],
return 0;
if (expected[i].ancestor_mode > 0) {
- cl_git_pass(git_oid_fromstr(&expected_oid, expected[i].ancestor_oid_str));
+ cl_git_pass(git_oid_fromstr(&expected_oid, expected[i].ancestor_oid_str, GIT_OID_SHA1));
if (git_oid_cmp(&reuc_entry->oid[0], &expected_oid) != 0)
return 0;
}
if (expected[i].our_mode > 0) {
- cl_git_pass(git_oid_fromstr(&expected_oid, expected[i].our_oid_str));
+ cl_git_pass(git_oid_fromstr(&expected_oid, expected[i].our_oid_str, GIT_OID_SHA1));
if (git_oid_cmp(&reuc_entry->oid[1], &expected_oid) != 0)
return 0;
}
if (expected[i].their_mode > 0) {
- cl_git_pass(git_oid_fromstr(&expected_oid, expected[i].their_oid_str));
+ cl_git_pass(git_oid_fromstr(&expected_oid, expected[i].their_oid_str, GIT_OID_SHA1));
if (git_oid_cmp(&reuc_entry->oid[2], &expected_oid) != 0)
return 0;
@@ -353,7 +353,7 @@ int merge_test_workdir(git_repository *repo, const struct merge_index_entry expe
for (i = 0; i < expected_len; i++) {
git_blob_create_from_workdir(&actual_oid, repo, expected[i].path);
- git_oid_fromstr(&expected_oid, expected[i].oid_str);
+ git_oid_fromstr(&expected_oid, expected[i].oid_str, GIT_OID_SHA1);
if (git_oid_cmp(&actual_oid, &expected_oid) != 0)
return 0;
diff --git a/tests/libgit2/merge/trees/renames.c b/tests/libgit2/merge/trees/renames.c
index 26f6d33..08574f9 100644
--- a/tests/libgit2/merge/trees/renames.c
+++ b/tests/libgit2/merge/trees/renames.c
@@ -286,7 +286,7 @@ void test_merge_trees_renames__cache_recomputation(void)
void *data;
size_t i;
- cl_git_pass(git_oid_fromstr(&blob, "a2d8d1824c68541cca94ffb90f79291eba495921"));
+ cl_git_pass(git_oid_fromstr(&blob, "a2d8d1824c68541cca94ffb90f79291eba495921", GIT_OID_SHA1));
/*
* Create a 50MB blob that consists of NUL bytes only. It is important
diff --git a/tests/libgit2/merge/trees/treediff.c b/tests/libgit2/merge/trees/treediff.c
index cd2cf78..c5810f5 100644
--- a/tests/libgit2/merge/trees/treediff.c
+++ b/tests/libgit2/merge/trees/treediff.c
@@ -61,9 +61,9 @@ static void test_find_differences(
opts.metric->similarity = git_diff_find_similar__calc_similarity;
opts.metric->payload = (void *)GIT_HASHSIG_SMART_WHITESPACE;
- cl_git_pass(git_oid_fromstr(&ancestor_oid, ancestor_oidstr));
- cl_git_pass(git_oid_fromstr(&ours_oid, ours_oidstr));
- cl_git_pass(git_oid_fromstr(&theirs_oid, theirs_oidstr));
+ cl_git_pass(git_oid_fromstr(&ancestor_oid, ancestor_oidstr, GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&ours_oid, ours_oidstr, GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&theirs_oid, theirs_oidstr, GIT_OID_SHA1));
cl_git_pass(git_tree_lookup(&ancestor_tree, repo, &ancestor_oid));
cl_git_pass(git_tree_lookup(&ours_tree, repo, &ours_oid));
diff --git a/tests/libgit2/merge/trees/trivial.c b/tests/libgit2/merge/trees/trivial.c
index dce392c..5b0003b 100644
--- a/tests/libgit2/merge/trees/trivial.c
+++ b/tests/libgit2/merge/trees/trivial.c
@@ -258,7 +258,7 @@ void test_merge_trees_trivial__13(void)
cl_git_pass(merge_trivial(&result, "trivial-13", "trivial-13-branch"));
cl_assert(entry = git_index_get_bypath(result, "modified-in-13.txt", 0));
- cl_git_pass(git_oid_fromstr(&expected_oid, "1cff9ec6a47a537380dedfdd17c9e76d74259a2b"));
+ cl_git_pass(git_oid_fromstr(&expected_oid, "1cff9ec6a47a537380dedfdd17c9e76d74259a2b", GIT_OID_SHA1));
cl_assert_equal_oid(&expected_oid, &entry->id);
cl_assert(git_index_reuc_entrycount(result) == 0);
@@ -277,7 +277,7 @@ void test_merge_trees_trivial__14(void)
cl_git_pass(merge_trivial(&result, "trivial-14", "trivial-14-branch"));
cl_assert(entry = git_index_get_bypath(result, "modified-in-14-branch.txt", 0));
- cl_git_pass(git_oid_fromstr(&expected_oid, "26153a3ff3649b6c2bb652d3f06878c6e0a172f9"));
+ cl_git_pass(git_oid_fromstr(&expected_oid, "26153a3ff3649b6c2bb652d3f06878c6e0a172f9", GIT_OID_SHA1));
cl_assert(git_oid_cmp(&entry->id, &expected_oid) == 0);
cl_assert(git_index_reuc_entrycount(result) == 0);
diff --git a/tests/libgit2/merge/workdir/dirty.c b/tests/libgit2/merge/workdir/dirty.c
index b9c2ad0..6820ceb 100644
--- a/tests/libgit2/merge/workdir/dirty.c
+++ b/tests/libgit2/merge/workdir/dirty.c
@@ -94,7 +94,7 @@ static int merge_branch(void)
git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT;
int error;
- cl_git_pass(git_oid_fromstr(&their_oids[0], MERGE_BRANCH_OID));
+ cl_git_pass(git_oid_fromstr(&their_oids[0], MERGE_BRANCH_OID, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&their_head, repo, &their_oids[0]));
checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE;
diff --git a/tests/libgit2/merge/workdir/setup.c b/tests/libgit2/merge/workdir/setup.c
index 3db2d07..fd633be 100644
--- a/tests/libgit2/merge/workdir/setup.c
+++ b/tests/libgit2/merge/workdir/setup.c
@@ -78,7 +78,7 @@ void test_merge_workdir_setup__one_branch(void)
git_reference *octo1_ref;
git_annotated_commit *our_head, *their_heads[1];
- cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD));
+ cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&our_head, repo, &our_oid));
cl_git_pass(git_reference_lookup(&octo1_ref, repo, GIT_REFS_HEADS_DIR OCTO1_BRANCH));
@@ -104,10 +104,10 @@ void test_merge_workdir_setup__one_oid(void)
git_oid octo1_oid;
git_annotated_commit *our_head, *their_heads[1];
- cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD));
+ cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&our_head, repo, &our_oid));
- cl_git_pass(git_oid_fromstr(&octo1_oid, OCTO1_OID));
+ cl_git_pass(git_oid_fromstr(&octo1_oid, OCTO1_OID, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&their_heads[0], repo, &octo1_oid));
cl_git_pass(git_merge__setup(repo, our_head, (const git_annotated_commit **)their_heads, 1));
@@ -129,7 +129,7 @@ void test_merge_workdir_setup__two_branches(void)
git_reference *octo2_ref;
git_annotated_commit *our_head, *their_heads[2];
- cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD));
+ cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&our_head, repo, &our_oid));
cl_git_pass(git_reference_lookup(&octo1_ref, repo, GIT_REFS_HEADS_DIR OCTO1_BRANCH));
@@ -162,7 +162,7 @@ void test_merge_workdir_setup__three_branches(void)
git_reference *octo3_ref;
git_annotated_commit *our_head, *their_heads[3];
- cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD));
+ cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&our_head, repo, &our_oid));
cl_git_pass(git_reference_lookup(&octo1_ref, repo, GIT_REFS_HEADS_DIR OCTO1_BRANCH));
@@ -200,16 +200,16 @@ void test_merge_workdir_setup__three_oids(void)
git_oid octo3_oid;
git_annotated_commit *our_head, *their_heads[3];
- cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD));
+ cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&our_head, repo, &our_oid));
- cl_git_pass(git_oid_fromstr(&octo1_oid, OCTO1_OID));
+ cl_git_pass(git_oid_fromstr(&octo1_oid, OCTO1_OID, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&their_heads[0], repo, &octo1_oid));
- cl_git_pass(git_oid_fromstr(&octo2_oid, OCTO2_OID));
+ cl_git_pass(git_oid_fromstr(&octo2_oid, OCTO2_OID, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&their_heads[1], repo, &octo2_oid));
- cl_git_pass(git_oid_fromstr(&octo3_oid, OCTO3_OID));
+ cl_git_pass(git_oid_fromstr(&octo3_oid, OCTO3_OID, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&their_heads[2], repo, &octo3_oid));
cl_git_pass(git_merge__setup(repo, our_head, (const git_annotated_commit **)their_heads, 3));
@@ -233,13 +233,13 @@ void test_merge_workdir_setup__branches_and_oids_1(void)
git_oid octo2_oid;
git_annotated_commit *our_head, *their_heads[2];
- cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD));
+ cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&our_head, repo, &our_oid));
cl_git_pass(git_reference_lookup(&octo1_ref, repo, GIT_REFS_HEADS_DIR OCTO1_BRANCH));
cl_git_pass(git_annotated_commit_from_ref(&their_heads[0], repo, octo1_ref));
- cl_git_pass(git_oid_fromstr(&octo2_oid, OCTO2_OID));
+ cl_git_pass(git_oid_fromstr(&octo2_oid, OCTO2_OID, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&their_heads[1], repo, &octo2_oid));
cl_git_pass(git_merge__setup(repo, our_head, (const git_annotated_commit **)their_heads, 2));
@@ -266,19 +266,19 @@ void test_merge_workdir_setup__branches_and_oids_2(void)
git_oid octo4_oid;
git_annotated_commit *our_head, *their_heads[4];
- cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD));
+ cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&our_head, repo, &our_oid));
cl_git_pass(git_reference_lookup(&octo1_ref, repo, GIT_REFS_HEADS_DIR OCTO1_BRANCH));
cl_git_pass(git_annotated_commit_from_ref(&their_heads[0], repo, octo1_ref));
- cl_git_pass(git_oid_fromstr(&octo2_oid, OCTO2_OID));
+ cl_git_pass(git_oid_fromstr(&octo2_oid, OCTO2_OID, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&their_heads[1], repo, &octo2_oid));
cl_git_pass(git_reference_lookup(&octo3_ref, repo, GIT_REFS_HEADS_DIR OCTO3_BRANCH));
cl_git_pass(git_annotated_commit_from_ref(&their_heads[2], repo, octo3_ref));
- cl_git_pass(git_oid_fromstr(&octo4_oid, OCTO4_OID));
+ cl_git_pass(git_oid_fromstr(&octo4_oid, OCTO4_OID, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&their_heads[3], repo, &octo4_oid));
cl_git_pass(git_merge__setup(repo, our_head, (const git_annotated_commit **)their_heads, 4));
@@ -308,16 +308,16 @@ void test_merge_workdir_setup__branches_and_oids_3(void)
git_reference *octo4_ref;
git_annotated_commit *our_head, *their_heads[4];
- cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD));
+ cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&our_head, repo, &our_oid));
- cl_git_pass(git_oid_fromstr(&octo1_oid, OCTO1_OID));
+ cl_git_pass(git_oid_fromstr(&octo1_oid, OCTO1_OID, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&their_heads[0], repo, &octo1_oid));
cl_git_pass(git_reference_lookup(&octo2_ref, repo, GIT_REFS_HEADS_DIR OCTO2_BRANCH));
cl_git_pass(git_annotated_commit_from_ref(&their_heads[1], repo, octo2_ref));
- cl_git_pass(git_oid_fromstr(&octo3_oid, OCTO3_OID));
+ cl_git_pass(git_oid_fromstr(&octo3_oid, OCTO3_OID, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&their_heads[2], repo, &octo3_oid));
cl_git_pass(git_reference_lookup(&octo4_ref, repo, GIT_REFS_HEADS_DIR OCTO4_BRANCH));
@@ -351,16 +351,16 @@ void test_merge_workdir_setup__branches_and_oids_4(void)
git_reference *octo5_ref;
git_annotated_commit *our_head, *their_heads[5];
- cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD));
+ cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&our_head, repo, &our_oid));
- cl_git_pass(git_oid_fromstr(&octo1_oid, OCTO1_OID));
+ cl_git_pass(git_oid_fromstr(&octo1_oid, OCTO1_OID, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&their_heads[0], repo, &octo1_oid));
cl_git_pass(git_reference_lookup(&octo2_ref, repo, GIT_REFS_HEADS_DIR OCTO2_BRANCH));
cl_git_pass(git_annotated_commit_from_ref(&their_heads[1], repo, octo2_ref));
- cl_git_pass(git_oid_fromstr(&octo3_oid, OCTO3_OID));
+ cl_git_pass(git_oid_fromstr(&octo3_oid, OCTO3_OID, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&their_heads[2], repo, &octo3_oid));
cl_git_pass(git_reference_lookup(&octo4_ref, repo, GIT_REFS_HEADS_DIR OCTO4_BRANCH));
@@ -397,7 +397,7 @@ void test_merge_workdir_setup__three_same_branches(void)
git_reference *octo1_3_ref;
git_annotated_commit *our_head, *their_heads[3];
- cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD));
+ cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&our_head, repo, &our_oid));
cl_git_pass(git_reference_lookup(&octo1_1_ref, repo, GIT_REFS_HEADS_DIR OCTO1_BRANCH));
@@ -435,16 +435,16 @@ void test_merge_workdir_setup__three_same_oids(void)
git_oid octo1_3_oid;
git_annotated_commit *our_head, *their_heads[3];
- cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD));
+ cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&our_head, repo, &our_oid));
- cl_git_pass(git_oid_fromstr(&octo1_1_oid, OCTO1_OID));
+ cl_git_pass(git_oid_fromstr(&octo1_1_oid, OCTO1_OID, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&their_heads[0], repo, &octo1_1_oid));
- cl_git_pass(git_oid_fromstr(&octo1_2_oid, OCTO1_OID));
+ cl_git_pass(git_oid_fromstr(&octo1_2_oid, OCTO1_OID, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&their_heads[1], repo, &octo1_2_oid));
- cl_git_pass(git_oid_fromstr(&octo1_3_oid, OCTO1_OID));
+ cl_git_pass(git_oid_fromstr(&octo1_3_oid, OCTO1_OID, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&their_heads[2], repo, &octo1_3_oid));
cl_git_pass(git_merge__setup(repo, our_head, (const git_annotated_commit **)their_heads, 3));
@@ -512,7 +512,7 @@ void test_merge_workdir_setup__remote_tracking_one_branch(void)
cl_git_pass(create_remote_tracking_branch(OCTO1_BRANCH, OCTO1_OID));
- cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD));
+ cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&our_head, repo, &our_oid));
cl_git_pass(git_reference_lookup(&octo1_ref, repo, GIT_REFS_REMOTES_DIR "origin/" OCTO1_BRANCH));
@@ -542,7 +542,7 @@ void test_merge_workdir_setup__remote_tracking_two_branches(void)
cl_git_pass(create_remote_tracking_branch(OCTO1_BRANCH, OCTO1_OID));
cl_git_pass(create_remote_tracking_branch(OCTO2_BRANCH, OCTO2_OID));
- cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD));
+ cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&our_head, repo, &our_oid));
cl_git_pass(git_reference_lookup(&octo1_ref, repo, GIT_REFS_REMOTES_DIR "origin/" OCTO1_BRANCH));
@@ -579,7 +579,7 @@ void test_merge_workdir_setup__remote_tracking_three_branches(void)
cl_git_pass(create_remote_tracking_branch(OCTO2_BRANCH, OCTO2_OID));
cl_git_pass(create_remote_tracking_branch(OCTO3_BRANCH, OCTO3_OID));
- cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD));
+ cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&our_head, repo, &our_oid));
cl_git_pass(git_reference_lookup(&octo1_ref, repo, GIT_REFS_REMOTES_DIR "origin/" OCTO1_BRANCH));
@@ -618,7 +618,7 @@ void test_merge_workdir_setup__normal_branch_and_remote_tracking_branch(void)
cl_git_pass(create_remote_tracking_branch(OCTO2_BRANCH, OCTO2_OID));
- cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD));
+ cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&our_head, repo, &our_oid));
cl_git_pass(git_reference_lookup(&octo1_ref, repo, GIT_REFS_HEADS_DIR OCTO1_BRANCH));
@@ -652,7 +652,7 @@ void test_merge_workdir_setup__remote_tracking_branch_and_normal_branch(void)
cl_git_pass(create_remote_tracking_branch(OCTO1_BRANCH, OCTO1_OID));
- cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD));
+ cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&our_head, repo, &our_oid));
cl_git_pass(git_reference_lookup(&octo1_ref, repo, GIT_REFS_REMOTES_DIR "origin/" OCTO1_BRANCH));
@@ -689,7 +689,7 @@ void test_merge_workdir_setup__two_remote_tracking_branch_and_two_normal_branche
cl_git_pass(create_remote_tracking_branch(OCTO2_BRANCH, OCTO2_OID));
cl_git_pass(create_remote_tracking_branch(OCTO4_BRANCH, OCTO4_OID));
- cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD));
+ cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&our_head, repo, &our_oid));
cl_git_pass(git_reference_lookup(&octo1_ref, repo, GIT_REFS_HEADS_DIR OCTO1_BRANCH));
@@ -730,10 +730,10 @@ void test_merge_workdir_setup__pull_one(void)
git_oid octo1_1_oid;
git_annotated_commit *our_head, *their_heads[1];
- cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD));
+ cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&our_head, repo, &our_oid));
- cl_git_pass(git_oid_fromstr(&octo1_1_oid, OCTO1_OID));
+ cl_git_pass(git_oid_fromstr(&octo1_1_oid, OCTO1_OID, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_from_fetchhead(&their_heads[0], repo, GIT_REFS_HEADS_DIR OCTO1_BRANCH, "http://remote.url/repo.git", &octo1_1_oid));
cl_git_pass(git_merge__setup(repo, our_head, (const git_annotated_commit **)their_heads, 1));
@@ -755,13 +755,13 @@ void test_merge_workdir_setup__pull_two(void)
git_oid octo2_oid;
git_annotated_commit *our_head, *their_heads[2];
- cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD));
+ cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&our_head, repo, &our_oid));
- cl_git_pass(git_oid_fromstr(&octo1_oid, OCTO1_OID));
+ cl_git_pass(git_oid_fromstr(&octo1_oid, OCTO1_OID, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_from_fetchhead(&their_heads[0], repo, GIT_REFS_HEADS_DIR OCTO1_BRANCH, "http://remote.url/repo.git", &octo1_oid));
- cl_git_pass(git_oid_fromstr(&octo2_oid, OCTO2_OID));
+ cl_git_pass(git_oid_fromstr(&octo2_oid, OCTO2_OID, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_from_fetchhead(&their_heads[1], repo, GIT_REFS_HEADS_DIR OCTO2_BRANCH, "http://remote.url/repo.git", &octo2_oid));
cl_git_pass(git_merge__setup(repo, our_head, (const git_annotated_commit **)their_heads, 2));
@@ -785,16 +785,16 @@ void test_merge_workdir_setup__pull_three(void)
git_oid octo3_oid;
git_annotated_commit *our_head, *their_heads[3];
- cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD));
+ cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&our_head, repo, &our_oid));
- cl_git_pass(git_oid_fromstr(&octo1_oid, OCTO1_OID));
+ cl_git_pass(git_oid_fromstr(&octo1_oid, OCTO1_OID, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_from_fetchhead(&their_heads[0], repo, GIT_REFS_HEADS_DIR OCTO1_BRANCH, "http://remote.url/repo.git", &octo1_oid));
- cl_git_pass(git_oid_fromstr(&octo2_oid, OCTO2_OID));
+ cl_git_pass(git_oid_fromstr(&octo2_oid, OCTO2_OID, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_from_fetchhead(&their_heads[1], repo, GIT_REFS_HEADS_DIR OCTO2_BRANCH, "http://remote.url/repo.git", &octo2_oid));
- cl_git_pass(git_oid_fromstr(&octo3_oid, OCTO3_OID));
+ cl_git_pass(git_oid_fromstr(&octo3_oid, OCTO3_OID, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_from_fetchhead(&their_heads[2], repo, GIT_REFS_HEADS_DIR OCTO3_BRANCH, "http://remote.url/repo.git", &octo3_oid));
cl_git_pass(git_merge__setup(repo, our_head, (const git_annotated_commit **)their_heads, 3));
@@ -818,16 +818,16 @@ void test_merge_workdir_setup__three_remotes(void)
git_oid octo3_oid;
git_annotated_commit *our_head, *their_heads[3];
- cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD));
+ cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&our_head, repo, &our_oid));
- cl_git_pass(git_oid_fromstr(&octo1_oid, OCTO1_OID));
+ cl_git_pass(git_oid_fromstr(&octo1_oid, OCTO1_OID, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_from_fetchhead(&their_heads[0], repo, GIT_REFS_HEADS_DIR OCTO1_BRANCH, "http://remote.first/repo.git", &octo1_oid));
- cl_git_pass(git_oid_fromstr(&octo2_oid, OCTO2_OID));
+ cl_git_pass(git_oid_fromstr(&octo2_oid, OCTO2_OID, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_from_fetchhead(&their_heads[1], repo, GIT_REFS_HEADS_DIR OCTO2_BRANCH, "http://remote.second/repo.git", &octo2_oid));
- cl_git_pass(git_oid_fromstr(&octo3_oid, OCTO3_OID));
+ cl_git_pass(git_oid_fromstr(&octo3_oid, OCTO3_OID, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_from_fetchhead(&their_heads[2], repo, GIT_REFS_HEADS_DIR OCTO3_BRANCH, "http://remote.third/repo.git", &octo3_oid));
cl_git_pass(git_merge__setup(repo, our_head, (const git_annotated_commit **)their_heads, 3));
@@ -852,19 +852,19 @@ void test_merge_workdir_setup__two_remotes(void)
git_oid octo4_oid;
git_annotated_commit *our_head, *their_heads[4];
- cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD));
+ cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&our_head, repo, &our_oid));
- cl_git_pass(git_oid_fromstr(&octo1_oid, OCTO1_OID));
+ cl_git_pass(git_oid_fromstr(&octo1_oid, OCTO1_OID, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_from_fetchhead(&their_heads[0], repo, GIT_REFS_HEADS_DIR OCTO1_BRANCH, "http://remote.first/repo.git", &octo1_oid));
- cl_git_pass(git_oid_fromstr(&octo2_oid, OCTO2_OID));
+ cl_git_pass(git_oid_fromstr(&octo2_oid, OCTO2_OID, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_from_fetchhead(&their_heads[1], repo, GIT_REFS_HEADS_DIR OCTO2_BRANCH, "http://remote.second/repo.git", &octo2_oid));
- cl_git_pass(git_oid_fromstr(&octo3_oid, OCTO3_OID));
+ cl_git_pass(git_oid_fromstr(&octo3_oid, OCTO3_OID, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_from_fetchhead(&their_heads[2], repo, GIT_REFS_HEADS_DIR OCTO3_BRANCH, "http://remote.first/repo.git", &octo3_oid));
- cl_git_pass(git_oid_fromstr(&octo4_oid, OCTO4_OID));
+ cl_git_pass(git_oid_fromstr(&octo4_oid, OCTO4_OID, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_from_fetchhead(&their_heads[3], repo, GIT_REFS_HEADS_DIR OCTO4_BRANCH, "http://remote.second/repo.git", &octo4_oid));
cl_git_pass(git_merge__setup(repo, our_head, (const git_annotated_commit **)their_heads, 4));
@@ -888,7 +888,7 @@ void test_merge_workdir_setup__id_from_head(void)
git_reference *ref;
git_annotated_commit *heads[3];
- cl_git_pass(git_oid_fromstr(&expected_id, OCTO1_OID));
+ cl_git_pass(git_oid_fromstr(&expected_id, OCTO1_OID, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_from_fetchhead(&heads[0], repo, GIT_REFS_HEADS_DIR OCTO1_BRANCH, "http://remote.url/repo.git", &expected_id));
id = git_annotated_commit_id(heads[0]);
cl_assert_equal_i(1, git_oid_equal(id, &expected_id));
@@ -920,7 +920,7 @@ static int annotated_commit_foreach_cb(const git_oid *oid, void *payload)
git_oid expected_oid;
struct annotated_commit_cb_data *cb_data = payload;
- git_oid_fromstr(&expected_oid, cb_data->oid_str[cb_data->i]);
+ git_oid_fromstr(&expected_oid, cb_data->oid_str[cb_data->i], GIT_OID_SHA1);
cl_assert(git_oid_cmp(&expected_oid, oid) == 0);
cb_data->i++;
return 0;
@@ -998,7 +998,7 @@ void test_merge_workdir_setup__retained_after_success(void)
git_reference *octo1_ref;
git_annotated_commit *our_head, *their_heads[1];
- cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD));
+ cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&our_head, repo, &our_oid));
cl_git_pass(git_reference_lookup(&octo1_ref, repo, GIT_REFS_HEADS_DIR OCTO1_BRANCH));
@@ -1025,7 +1025,7 @@ void test_merge_workdir_setup__removed_after_failure(void)
git_reference *octo1_ref;
git_annotated_commit *our_head, *their_heads[1];
- cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD));
+ cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&our_head, repo, &our_oid));
cl_git_pass(git_reference_lookup(&octo1_ref, repo, GIT_REFS_HEADS_DIR OCTO1_BRANCH));
@@ -1052,7 +1052,7 @@ void test_merge_workdir_setup__unlocked_after_success(void)
git_reference *octo1_ref;
git_annotated_commit *our_head, *their_heads[1];
- cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD));
+ cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&our_head, repo, &our_oid));
cl_git_pass(git_reference_lookup(&octo1_ref, repo, GIT_REFS_HEADS_DIR OCTO1_BRANCH));
@@ -1075,7 +1075,7 @@ void test_merge_workdir_setup__unlocked_after_conflict(void)
git_reference *octo1_ref;
git_annotated_commit *our_head, *their_heads[1];
- cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD));
+ cl_git_pass(git_oid_fromstr(&our_oid, ORIG_HEAD, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&our_head, repo, &our_oid));
cl_git_pass(git_reference_lookup(&octo1_ref, repo, GIT_REFS_HEADS_DIR OCTO1_BRANCH));
diff --git a/tests/libgit2/merge/workdir/simple.c b/tests/libgit2/merge/workdir/simple.c
index b9d3fc2..5cbc5c6 100644
--- a/tests/libgit2/merge/workdir/simple.c
+++ b/tests/libgit2/merge/workdir/simple.c
@@ -99,7 +99,7 @@ static void merge_simple_branch(int merge_file_favor, int addl_checkout_strategy
git_merge_options merge_opts = GIT_MERGE_OPTIONS_INIT;
git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT;
- cl_git_pass(git_oid_fromstr(&their_oids[0], THEIRS_SIMPLE_OID));
+ cl_git_pass(git_oid_fromstr(&their_oids[0], THEIRS_SIMPLE_OID, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&their_heads[0], repo, &their_oids[0]));
merge_opts.file_favor = merge_file_favor;
@@ -180,14 +180,14 @@ void test_merge_workdir_simple__index_reload(void)
cl_git_pass(git_index_read(repo_index, 0));
entry.mode = GIT_FILEMODE_BLOB;
- cl_git_pass(git_oid_fromstr(&entry.id, "11deab00b2d3a6f5a3073988ac050c2d7b6655e2"));
+ cl_git_pass(git_oid_fromstr(&entry.id, "11deab00b2d3a6f5a3073988ac050c2d7b6655e2", GIT_OID_SHA1));
entry.path = "automergeable.txt";
cl_git_pass(git_index_add(repo_index, &entry));
cl_git_pass(git_index_add_bypath(tmp_index, "automergeable.txt"));
cl_git_pass(git_index_write(tmp_index));
- cl_git_pass(git_oid_fromstr(&their_oid, THEIRS_SIMPLE_OID));
+ cl_git_pass(git_oid_fromstr(&their_oid, THEIRS_SIMPLE_OID, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&their_heads[0], repo, &their_oid));
cl_git_pass(git_merge(repo, (const git_annotated_commit **)their_heads, 1, NULL, NULL));
@@ -669,7 +669,7 @@ void test_merge_workdir_simple__directory_file(void)
cl_git_pass(git_commit_lookup(&head_commit, repo, &head_commit_id));
cl_git_pass(git_reset(repo, (git_object *)head_commit, GIT_RESET_HARD, NULL));
- cl_git_pass(git_oid_fromstr(&their_oids[0], THEIRS_DIRECTORY_FILE));
+ cl_git_pass(git_oid_fromstr(&their_oids[0], THEIRS_DIRECTORY_FILE, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&their_heads[0], repo, &their_oids[0]));
merge_opts.file_favor = 0;
@@ -700,7 +700,7 @@ void test_merge_workdir_simple__unrelated(void)
{ 0100644, "c8f06f2e3bb2964174677e91f0abead0e43c9e5d", 0, "unchanged.txt" },
};
- cl_git_pass(git_oid_fromstr(&their_oids[0], THEIRS_UNRELATED_PARENT));
+ cl_git_pass(git_oid_fromstr(&their_oids[0], THEIRS_UNRELATED_PARENT, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&their_heads[0], repo, &their_oids[0]));
merge_opts.file_favor = 0;
@@ -731,7 +731,7 @@ void test_merge_workdir_simple__unrelated_with_conflicts(void)
{ 0100644, "c8f06f2e3bb2964174677e91f0abead0e43c9e5d", 0, "unchanged.txt" },
};
- cl_git_pass(git_oid_fromstr(&their_oids[0], THEIRS_UNRELATED_OID));
+ cl_git_pass(git_oid_fromstr(&their_oids[0], THEIRS_UNRELATED_OID, GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&their_heads[0], repo, &their_oids[0]));
merge_opts.file_favor = 0;
@@ -755,8 +755,8 @@ void test_merge_workdir_simple__binary(void)
{ 0100644, "836b8b82b26cab22eaaed8820877c76d6c8bca19", 3, "binary" },
};
- cl_git_pass(git_oid_fromstr(&our_oid, "cc338e4710c9b257106b8d16d82f86458d5beaf1"));
- cl_git_pass(git_oid_fromstr(&their_oid, "ad01aebfdf2ac13145efafe3f9fcf798882f1730"));
+ cl_git_pass(git_oid_fromstr(&our_oid, "cc338e4710c9b257106b8d16d82f86458d5beaf1", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&their_oid, "ad01aebfdf2ac13145efafe3f9fcf798882f1730", GIT_OID_SHA1));
cl_git_pass(git_commit_lookup(&our_commit, repo, &our_oid));
cl_git_pass(git_reset(repo, (git_object *)our_commit, GIT_RESET_HARD, NULL));
@@ -770,7 +770,7 @@ void test_merge_workdir_simple__binary(void)
cl_git_pass(git_index_add_bypath(repo_index, "binary"));
cl_assert((binary_entry = git_index_get_bypath(repo_index, "binary", 0)) != NULL);
- cl_git_pass(git_oid_fromstr(&our_file_oid, "23ed141a6ae1e798b2f721afedbe947c119111ba"));
+ cl_git_pass(git_oid_fromstr(&our_file_oid, "23ed141a6ae1e798b2f721afedbe947c119111ba", GIT_OID_SHA1));
cl_assert(git_oid_cmp(&binary_entry->id, &our_file_oid) == 0);
git_annotated_commit_free(their_head);
diff --git a/tests/libgit2/merge/workdir/trivial.c b/tests/libgit2/merge/workdir/trivial.c
index fe83748..b13aacd 100644
--- a/tests/libgit2/merge/workdir/trivial.c
+++ b/tests/libgit2/merge/workdir/trivial.c
@@ -222,7 +222,7 @@ void test_merge_workdir_trivial__13(void)
cl_git_pass(merge_trivial("trivial-13", "trivial-13-branch"));
cl_assert(entry = git_index_get_bypath(repo_index, "modified-in-13.txt", 0));
- cl_git_pass(git_oid_fromstr(&expected_oid, "1cff9ec6a47a537380dedfdd17c9e76d74259a2b"));
+ cl_git_pass(git_oid_fromstr(&expected_oid, "1cff9ec6a47a537380dedfdd17c9e76d74259a2b", GIT_OID_SHA1));
cl_assert(git_oid_cmp(&entry->id, &expected_oid) == 0);
cl_assert(git_index_reuc_entrycount(repo_index) == 0);
@@ -238,7 +238,7 @@ void test_merge_workdir_trivial__14(void)
cl_git_pass(merge_trivial("trivial-14", "trivial-14-branch"));
cl_assert(entry = git_index_get_bypath(repo_index, "modified-in-14-branch.txt", 0));
- cl_git_pass(git_oid_fromstr(&expected_oid, "26153a3ff3649b6c2bb652d3f06878c6e0a172f9"));
+ cl_git_pass(git_oid_fromstr(&expected_oid, "26153a3ff3649b6c2bb652d3f06878c6e0a172f9", GIT_OID_SHA1));
cl_assert(git_oid_cmp(&entry->id, &expected_oid) == 0);
cl_assert(git_index_reuc_entrycount(repo_index) == 0);
diff --git a/tests/libgit2/network/remote/push.c b/tests/libgit2/network/remote/push.c
index 3905deb..16588a2 100644
--- a/tests/libgit2/network/remote/push.c
+++ b/tests/libgit2/network/remote/push.c
@@ -1,5 +1,6 @@
#include "clar_libgit2.h"
#include "git2/sys/commit.h"
+#include "oid.h"
static git_remote *_remote;
static git_repository *_repo, *_dummy;
@@ -57,7 +58,7 @@ void test_network_remote_push__delete_notification(void)
expected.src_refname = "";
expected.dst_refname = "refs/heads/master";
- memset(&expected.dst, 0, sizeof(git_oid));
+ git_oid_clear(&expected.dst, GIT_OID_SHA1);
git_oid_cpy(&expected.src, git_reference_target(ref));
opts.callbacks.push_negotiation = negotiation_cb;
@@ -102,7 +103,7 @@ void test_network_remote_push__create_notification(void)
expected.src_refname = "refs/heads/empty-tree";
expected.dst_refname = "refs/heads/empty-tree";
git_oid_cpy(&expected.dst, git_reference_target(ref));
- memset(&expected.src, 0, sizeof(git_oid));
+ git_oid_clear(&expected.src, GIT_OID_SHA1);
opts.callbacks.push_negotiation = negotiation_cb;
opts.callbacks.payload = &expected;
diff --git a/tests/libgit2/network/remote/rename.c b/tests/libgit2/network/remote/rename.c
index d4446b8..61bfc8c 100644
--- a/tests/libgit2/network/remote/rename.c
+++ b/tests/libgit2/network/remote/rename.c
@@ -170,7 +170,7 @@ void test_network_remote_rename__overwrite_ref_in_target(void)
git_branch_iterator *iter;
git_strarray problems = {0};
- cl_git_pass(git_oid_fromstr(&id, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750"));
+ cl_git_pass(git_oid_fromstr(&id, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", GIT_OID_SHA1));
cl_git_pass(git_reference_create(&ref, _repo, "refs/remotes/renamed/master", &id, 1, NULL));
git_reference_free(ref);
diff --git a/tests/libgit2/notes/notes.c b/tests/libgit2/notes/notes.c
index a36cddb..5fe9a77 100644
--- a/tests/libgit2/notes/notes.c
+++ b/tests/libgit2/notes/notes.c
@@ -33,7 +33,7 @@ static void create_note(git_oid *note_oid, const char *canonical_namespace, cons
{
git_oid oid;
- cl_git_pass(git_oid_fromstr(&oid, target_sha));
+ cl_git_pass(git_oid_fromstr(&oid, target_sha, GIT_OID_SHA1));
cl_git_pass(git_note_create(note_oid, _repo, canonical_namespace, _sig, _sig, &oid, message, 0));
}
@@ -60,10 +60,10 @@ static int note_list_cb(
cl_assert(*count < EXPECTATIONS_COUNT);
- cl_git_pass(git_oid_fromstr(&expected_note_oid, list_expectations[*count].note_sha));
+ cl_git_pass(git_oid_fromstr(&expected_note_oid, list_expectations[*count].note_sha, GIT_OID_SHA1));
cl_assert_equal_oid(&expected_note_oid, blob_id);
- cl_git_pass(git_oid_fromstr(&expected_target_oid, list_expectations[*count].annotated_object_sha));
+ cl_git_pass(git_oid_fromstr(&expected_target_oid, list_expectations[*count].annotated_object_sha, GIT_OID_SHA1));
cl_assert_equal_oid(&expected_target_oid, annotated_obj_id);
(*count)++;
@@ -85,12 +85,12 @@ static int note_list_create_cb(
size_t i;
for (i = 0; notes[i].note_oid != NULL; i++) {
- cl_git_pass(git_oid_fromstr(&expected_note_oid, notes[i].note_oid));
+ cl_git_pass(git_oid_fromstr(&expected_note_oid, notes[i].note_oid, GIT_OID_SHA1));
if (git_oid_cmp(&expected_note_oid, blob_oid) != 0)
continue;
- cl_git_pass(git_oid_fromstr(&expected_target_oid, notes[i].object_oid));
+ cl_git_pass(git_oid_fromstr(&expected_target_oid, notes[i].object_oid, GIT_OID_SHA1));
if (git_oid_cmp(&expected_target_oid, annotated_obj_id) != 0)
continue;
@@ -140,7 +140,7 @@ void test_notes_notes__can_create_a_note_from_commit(void)
{ NULL, NULL, 0 }
};
- cl_git_pass(git_oid_fromstr(&oid, can_create_a_note_from_commit[0].object_oid));
+ cl_git_pass(git_oid_fromstr(&oid, can_create_a_note_from_commit[0].object_oid, GIT_OID_SHA1));
cl_git_pass(git_note_commit_create(¬es_commit_out, NULL, _repo, NULL, _sig, _sig, &oid, "I decorate 4a20\n", 1));
@@ -169,11 +169,11 @@ void test_notes_notes__can_create_a_note_from_commit_given_an_existing_commit(vo
{ NULL, NULL, 0 }
};
- cl_git_pass(git_oid_fromstr(&oid, "4a202b346bb0fb0db7eff3cffeb3c70babbd2045"));
+ cl_git_pass(git_oid_fromstr(&oid, "4a202b346bb0fb0db7eff3cffeb3c70babbd2045", GIT_OID_SHA1));
cl_git_pass(git_note_commit_create(¬es_commit_out, NULL, _repo, NULL, _sig, _sig, &oid, "I decorate 4a20\n", 0));
- cl_git_pass(git_oid_fromstr(&oid, "9fd738e8f7967c078dceed8190330fc8648ee56a"));
+ cl_git_pass(git_oid_fromstr(&oid, "9fd738e8f7967c078dceed8190330fc8648ee56a", GIT_OID_SHA1));
git_commit_lookup(&existing_notes_commit, _repo, ¬es_commit_out);
@@ -274,7 +274,7 @@ void test_notes_notes__inserting_a_note_without_passing_a_namespace_uses_the_def
git_note *note, *default_namespace_note;
git_buf default_ref = GIT_BUF_INIT;
- cl_git_pass(git_oid_fromstr(&target_oid, "08b041783f40edfe12bb406c9c9a8a040177c125"));
+ cl_git_pass(git_oid_fromstr(&target_oid, "08b041783f40edfe12bb406c9c9a8a040177c125", GIT_OID_SHA1));
cl_git_pass(git_note_default_ref(&default_ref, _repo));
create_note(¬e_oid, NULL, "08b041783f40edfe12bb406c9c9a8a040177c125", "hello world\n");
@@ -295,7 +295,7 @@ void test_notes_notes__can_insert_a_note_with_a_custom_namespace(void)
git_oid note_oid, target_oid;
git_note *note;
- cl_git_pass(git_oid_fromstr(&target_oid, "08b041783f40edfe12bb406c9c9a8a040177c125"));
+ cl_git_pass(git_oid_fromstr(&target_oid, "08b041783f40edfe12bb406c9c9a8a040177c125", GIT_OID_SHA1));
create_note(¬e_oid, "refs/notes/some/namespace", "08b041783f40edfe12bb406c9c9a8a040177c125", "hello world on a custom namespace\n");
@@ -315,7 +315,7 @@ void test_notes_notes__creating_a_note_on_a_target_which_already_has_one_returns
int error;
git_oid note_oid, target_oid;
- cl_git_pass(git_oid_fromstr(&target_oid, "08b041783f40edfe12bb406c9c9a8a040177c125"));
+ cl_git_pass(git_oid_fromstr(&target_oid, "08b041783f40edfe12bb406c9c9a8a040177c125", GIT_OID_SHA1));
create_note(¬e_oid, NULL, "08b041783f40edfe12bb406c9c9a8a040177c125", "hello world\n");
error = git_note_create(¬e_oid, _repo, NULL, _sig, _sig, &target_oid, "hello world\n", 0);
@@ -334,7 +334,7 @@ void test_notes_notes__creating_a_note_on_a_target_can_overwrite_existing_note(v
git_oid note_oid, target_oid;
git_note *note, *namespace_note;
- cl_git_pass(git_oid_fromstr(&target_oid, "08b041783f40edfe12bb406c9c9a8a040177c125"));
+ cl_git_pass(git_oid_fromstr(&target_oid, "08b041783f40edfe12bb406c9c9a8a040177c125", GIT_OID_SHA1));
create_note(¬e_oid, NULL, "08b041783f40edfe12bb406c9c9a8a040177c125", "hello old world\n");
cl_git_pass(git_note_create(¬e_oid, _repo, NULL, _sig, _sig, &target_oid, "hello new world\n", 1));
@@ -381,7 +381,7 @@ void test_notes_notes__can_read_a_note(void)
create_note(¬e_oid, "refs/notes/i-can-see-dead-notes", "4a202b346bb0fb0db7eff3cffeb3c70babbd2045", "I decorate 4a20\n");
- cl_git_pass(git_oid_fromstr(&target_oid, "4a202b346bb0fb0db7eff3cffeb3c70babbd2045"));
+ cl_git_pass(git_oid_fromstr(&target_oid, "4a202b346bb0fb0db7eff3cffeb3c70babbd2045", GIT_OID_SHA1));
cl_git_pass(git_note_read(¬e, _repo, "refs/notes/i-can-see-dead-notes", &target_oid));
@@ -397,7 +397,7 @@ void test_notes_notes__can_read_a_note_from_a_commit(void)
git_commit *notes_commit;
git_note *note;
- cl_git_pass(git_oid_fromstr(&oid, "4a202b346bb0fb0db7eff3cffeb3c70babbd2045"));
+ cl_git_pass(git_oid_fromstr(&oid, "4a202b346bb0fb0db7eff3cffeb3c70babbd2045", GIT_OID_SHA1));
cl_git_pass(git_note_commit_create(¬es_commit_oid, NULL, _repo, NULL, _sig, _sig, &oid, "I decorate 4a20\n", 1));
cl_git_pass(git_commit_lookup(¬es_commit, _repo, ¬es_commit_oid));
cl_assert(notes_commit);
@@ -416,7 +416,7 @@ void test_notes_notes__attempt_to_read_a_note_from_a_commit_with_no_note_fails(v
git_commit *notes_commit;
git_note *note;
- cl_git_pass(git_oid_fromstr(&oid, "4a202b346bb0fb0db7eff3cffeb3c70babbd2045"));
+ cl_git_pass(git_oid_fromstr(&oid, "4a202b346bb0fb0db7eff3cffeb3c70babbd2045", GIT_OID_SHA1));
cl_git_pass(git_note_commit_create(¬es_commit_oid, NULL, _repo, NULL, _sig, _sig, &oid, "I decorate 4a20\n", 1));
@@ -450,7 +450,7 @@ void test_notes_notes__can_insert_a_note_in_an_existing_fanout(void)
git_oid note_oid, target_oid;
git_note *_note;
- cl_git_pass(git_oid_fromstr(&target_oid, "08b041783f40edfe12bb406c9c9a8a040177c125"));
+ cl_git_pass(git_oid_fromstr(&target_oid, "08b041783f40edfe12bb406c9c9a8a040177c125", GIT_OID_SHA1));
for (i = 0; i < MESSAGES_COUNT; i++) {
cl_git_pass(git_note_create(¬e_oid, _repo, "refs/notes/fanout", _sig, _sig, &target_oid, messages[i], 0));
@@ -470,10 +470,10 @@ void test_notes_notes__can_read_a_note_in_an_existing_fanout(void)
git_oid note_oid, target_oid;
git_note *note;
- cl_git_pass(git_oid_fromstr(&target_oid, "8496071c1b46c854b31185ea97743be6a8774479"));
+ cl_git_pass(git_oid_fromstr(&target_oid, "8496071c1b46c854b31185ea97743be6a8774479", GIT_OID_SHA1));
cl_git_pass(git_note_read(¬e, _repo, "refs/notes/fanout", &target_oid));
- cl_git_pass(git_oid_fromstr(¬e_oid, "08b041783f40edfe12bb406c9c9a8a040177c125"));
+ cl_git_pass(git_oid_fromstr(¬e_oid, "08b041783f40edfe12bb406c9c9a8a040177c125", GIT_OID_SHA1));
cl_assert_equal_oid(git_note_id(note), ¬e_oid);
git_note_free(note);
@@ -487,7 +487,7 @@ void test_notes_notes__can_remove_a_note(void)
create_note(¬e_oid, "refs/notes/i-can-see-dead-notes", "4a202b346bb0fb0db7eff3cffeb3c70babbd2045", "I decorate 4a20\n");
- cl_git_pass(git_oid_fromstr(&target_oid, "4a202b346bb0fb0db7eff3cffeb3c70babbd2045"));
+ cl_git_pass(git_oid_fromstr(&target_oid, "4a202b346bb0fb0db7eff3cffeb3c70babbd2045", GIT_OID_SHA1));
cl_git_pass(git_note_remove(_repo, "refs/notes/i-can-see-dead-notes", _sig, _sig, &target_oid));
cl_git_fail(git_note_read(¬e, _repo, "refs/notes/i-can-see-dead-notes", &target_oid));
@@ -501,7 +501,7 @@ void test_notes_notes__can_remove_a_note_from_commit(void)
git_commit *existing_notes_commit;
git_reference *ref;
- cl_git_pass(git_oid_fromstr(&oid, "4a202b346bb0fb0db7eff3cffeb3c70babbd2045"));
+ cl_git_pass(git_oid_fromstr(&oid, "4a202b346bb0fb0db7eff3cffeb3c70babbd2045", GIT_OID_SHA1));
cl_git_pass(git_note_commit_create(¬es_commit_oid, NULL, _repo, NULL, _sig, _sig, &oid, "I decorate 4a20\n", 0));
@@ -528,7 +528,7 @@ void test_notes_notes__can_remove_a_note_in_an_existing_fanout(void)
git_oid target_oid;
git_note *note;
- cl_git_pass(git_oid_fromstr(&target_oid, "8496071c1b46c854b31185ea97743be6a8774479"));
+ cl_git_pass(git_oid_fromstr(&target_oid, "8496071c1b46c854b31185ea97743be6a8774479", GIT_OID_SHA1));
cl_git_pass(git_note_remove(_repo, "refs/notes/fanout", _sig, _sig, &target_oid));
cl_git_fail(git_note_read(¬e, _repo, "refs/notes/fanout", &target_oid));
@@ -539,7 +539,7 @@ void test_notes_notes__removing_a_note_which_doesnt_exists_returns_ENOTFOUND(voi
int error;
git_oid target_oid;
- cl_git_pass(git_oid_fromstr(&target_oid, "8496071c1b46c854b31185ea97743be6a8774479"));
+ cl_git_pass(git_oid_fromstr(&target_oid, "8496071c1b46c854b31185ea97743be6a8774479", GIT_OID_SHA1));
cl_git_pass(git_note_remove(_repo, "refs/notes/fanout", _sig, _sig, &target_oid));
error = git_note_remove(_repo, "refs/notes/fanout", _sig, _sig, &target_oid);
@@ -628,8 +628,8 @@ void test_notes_notes__iterate_from_commit(void)
};
int i, err;
- cl_git_pass(git_oid_fromstr(&(oids[0]), "a65fedf39aefe402d3bb6e24df4d4f5fe4547750"));
- cl_git_pass(git_oid_fromstr(&(oids[1]), "c47800c7266a2be04c571c04d5a6614691ea99bd"));
+ cl_git_pass(git_oid_fromstr(&(oids[0]), "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&(oids[1]), "c47800c7266a2be04c571c04d5a6614691ea99bd", GIT_OID_SHA1));
cl_git_pass(git_note_commit_create(¬es_commit_oids[0], NULL, _repo, NULL, _sig, _sig, &(oids[0]), note_message[0], 0));
diff --git a/tests/libgit2/notes/notesref.c b/tests/libgit2/notes/notesref.c
index 6ba324c..a3de734 100644
--- a/tests/libgit2/notes/notesref.c
+++ b/tests/libgit2/notes/notesref.c
@@ -36,7 +36,7 @@ void test_notes_notesref__config_corenotesref(void)
git_buf default_ref = GIT_BUF_INIT;
cl_git_pass(git_signature_now(&_sig, "alice", "alice@example.com"));
- cl_git_pass(git_oid_fromstr(&oid, "8496071c1b46c854b31185ea97743be6a8774479"));
+ cl_git_pass(git_oid_fromstr(&oid, "8496071c1b46c854b31185ea97743be6a8774479", GIT_OID_SHA1));
cl_git_pass(git_repository_config(&_cfg, _repo));
diff --git a/tests/libgit2/object/blob/fromstream.c b/tests/libgit2/object/blob/fromstream.c
index 60ff399..529e748 100644
--- a/tests/libgit2/object/blob/fromstream.c
+++ b/tests/libgit2/object/blob/fromstream.c
@@ -23,7 +23,7 @@ void test_object_blob_fromstream__multiple_write(void)
git_writestream *stream;
int i, howmany = 6;
- cl_git_pass(git_oid_fromstr(&expected_id, "321cbdf08803c744082332332838df6bd160f8f9"));
+ cl_git_pass(git_oid_fromstr(&expected_id, "321cbdf08803c744082332332838df6bd160f8f9", GIT_OID_SHA1));
cl_git_fail_with(GIT_ENOTFOUND,
git_object_lookup(&blob, repo, &expected_id, GIT_OBJECT_ANY));
@@ -64,7 +64,7 @@ static void assert_named_chunked_blob(const char *expected_sha, const char *fake
git_writestream *stream;
int i, howmany = 6;
- cl_git_pass(git_oid_fromstr(&expected_id, expected_sha));
+ cl_git_pass(git_oid_fromstr(&expected_id, expected_sha, GIT_OID_SHA1));
cl_git_pass(git_blob_create_from_stream(&stream, repo, fake_name));
diff --git a/tests/libgit2/object/cache.c b/tests/libgit2/object/cache.c
index 08bf036..6ca351b 100644
--- a/tests/libgit2/object/cache.c
+++ b/tests/libgit2/object/cache.c
@@ -91,7 +91,7 @@ void test_object_cache__cache_counts(void)
for (i = 0; g_data[i].sha != NULL; ++i) {
int count = (int)git_cache_size(&g_repo->objects);
- cl_git_pass(git_oid_fromstr(&oid, g_data[i].sha));
+ cl_git_pass(git_oid_fromstr(&oid, g_data[i].sha, GIT_OID_SHA1));
/* alternate between loading raw and parsed objects */
if ((i & 1) == 0) {
@@ -118,7 +118,7 @@ void test_object_cache__cache_counts(void)
for (i = 0; g_data[i].sha != NULL; ++i) {
int count = (int)git_cache_size(&g_repo->objects);
- cl_git_pass(git_oid_fromstr(&oid, g_data[i].sha));
+ cl_git_pass(git_oid_fromstr(&oid, g_data[i].sha, GIT_OID_SHA1));
cl_git_pass(git_object_lookup(&obj, g_repo, &oid, GIT_OBJECT_ANY));
cl_assert(g_data[i].type == git_object_type(obj));
git_object_free(obj);
@@ -136,14 +136,14 @@ static void *cache_parsed(void *arg)
git_object *obj;
for (i = ((int *)arg)[1]; g_data[i].sha != NULL; i += 2) {
- cl_git_pass(git_oid_fromstr(&oid, g_data[i].sha));
+ cl_git_pass(git_oid_fromstr(&oid, g_data[i].sha, GIT_OID_SHA1));
cl_git_pass(git_object_lookup(&obj, g_repo, &oid, GIT_OBJECT_ANY));
cl_assert(g_data[i].type == git_object_type(obj));
git_object_free(obj);
}
for (i = 0; i < ((int *)arg)[1]; i += 2) {
- cl_git_pass(git_oid_fromstr(&oid, g_data[i].sha));
+ cl_git_pass(git_oid_fromstr(&oid, g_data[i].sha, GIT_OID_SHA1));
cl_git_pass(git_object_lookup(&obj, g_repo, &oid, GIT_OBJECT_ANY));
cl_assert(g_data[i].type == git_object_type(obj));
git_object_free(obj);
@@ -162,14 +162,14 @@ static void *cache_raw(void *arg)
cl_git_pass(git_repository_odb(&odb, g_repo));
for (i = ((int *)arg)[1]; g_data[i].sha != NULL; i += 2) {
- cl_git_pass(git_oid_fromstr(&oid, g_data[i].sha));
+ cl_git_pass(git_oid_fromstr(&oid, g_data[i].sha, GIT_OID_SHA1));
cl_git_pass(git_odb_read(&odb_obj, odb, &oid));
cl_assert(g_data[i].type == git_odb_object_type(odb_obj));
git_odb_object_free(odb_obj);
}
for (i = 0; i < ((int *)arg)[1]; i += 2) {
- cl_git_pass(git_oid_fromstr(&oid, g_data[i].sha));
+ cl_git_pass(git_oid_fromstr(&oid, g_data[i].sha, GIT_OID_SHA1));
cl_git_pass(git_odb_read(&odb_obj, odb, &oid));
cl_assert(g_data[i].type == git_odb_object_type(odb_obj));
git_odb_object_free(odb_obj);
@@ -234,7 +234,7 @@ static void *cache_quick(void *arg)
git_oid oid;
git_object *obj;
- cl_git_pass(git_oid_fromstr(&oid, g_data[4].sha));
+ cl_git_pass(git_oid_fromstr(&oid, g_data[4].sha, GIT_OID_SHA1));
cl_git_pass(git_object_lookup(&obj, g_repo, &oid, GIT_OBJECT_ANY));
cl_assert(g_data[4].type == git_object_type(obj));
git_object_free(obj);
diff --git a/tests/libgit2/object/commit/commitstagedfile.c b/tests/libgit2/object/commit/commitstagedfile.c
index 7322a4e..b8fbc4f 100644
--- a/tests/libgit2/object/commit/commitstagedfile.c
+++ b/tests/libgit2/object/commit/commitstagedfile.c
@@ -64,9 +64,9 @@ void test_object_commit_commitstagedfile__generate_predictable_object_ids(void)
* 100644 blob 9daeafb9864cf43055ae93beb0afd6c7d144bfa4 test.txt
*/
- cl_git_pass(git_oid_fromstr(&expected_commit_oid, "1fe3126578fc4eca68c193e4a3a0a14a0704624d"));
- cl_git_pass(git_oid_fromstr(&expected_tree_oid, "2b297e643c551e76cfa1f93810c50811382f9117"));
- cl_git_pass(git_oid_fromstr(&expected_blob_oid, "9daeafb9864cf43055ae93beb0afd6c7d144bfa4"));
+ cl_git_pass(git_oid_fromstr(&expected_commit_oid, "1fe3126578fc4eca68c193e4a3a0a14a0704624d", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&expected_tree_oid, "2b297e643c551e76cfa1f93810c50811382f9117", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&expected_blob_oid, "9daeafb9864cf43055ae93beb0afd6c7d144bfa4", GIT_OID_SHA1));
/*
* Add a new file to the index
diff --git a/tests/libgit2/object/commit/parse.c b/tests/libgit2/object/commit/parse.c
index 4ff1ad6..ad22baf 100644
--- a/tests/libgit2/object/commit/parse.c
+++ b/tests/libgit2/object/commit/parse.c
@@ -51,7 +51,7 @@ static void assert_commit_parses(const char *data, size_t datalen,
if (expected_treeid) {
git_oid tree_oid;
- cl_git_pass(git_oid_fromstr(&tree_oid, expected_treeid));
+ cl_git_pass(git_oid_fromstr(&tree_oid, expected_treeid, GIT_OID_SHA1));
cl_assert_equal_oid(&tree_oid, &commit->tree_id);
}
diff --git a/tests/libgit2/object/lookup.c b/tests/libgit2/object/lookup.c
index a7b1cee..d2b5547 100644
--- a/tests/libgit2/object/lookup.c
+++ b/tests/libgit2/object/lookup.c
@@ -20,7 +20,7 @@ void test_object_lookup__lookup_wrong_type_returns_enotfound(void)
git_oid oid;
git_object *object;
- cl_git_pass(git_oid_fromstr(&oid, commit));
+ cl_git_pass(git_oid_fromstr(&oid, commit, GIT_OID_SHA1));
cl_assert_equal_i(
GIT_ENOTFOUND, git_object_lookup(&object, g_repo, &oid, GIT_OBJECT_TAG));
}
@@ -31,7 +31,7 @@ void test_object_lookup__lookup_nonexisting_returns_enotfound(void)
git_oid oid;
git_object *object;
- cl_git_pass(git_oid_fromstr(&oid, unknown));
+ cl_git_pass(git_oid_fromstr(&oid, unknown, GIT_OID_SHA1));
cl_assert_equal_i(
GIT_ENOTFOUND, git_object_lookup(&object, g_repo, &oid, GIT_OBJECT_ANY));
}
@@ -42,7 +42,7 @@ void test_object_lookup__lookup_wrong_type_by_abbreviated_id_returns_enotfound(v
git_oid oid;
git_object *object;
- cl_git_pass(git_oid_fromstrn(&oid, commit, strlen(commit)));
+ cl_git_pass(git_oid_fromstrn(&oid, commit, strlen(commit), GIT_OID_SHA1));
cl_assert_equal_i(
GIT_ENOTFOUND, git_object_lookup_prefix(&object, g_repo, &oid, strlen(commit), GIT_OBJECT_TAG));
}
@@ -53,7 +53,7 @@ void test_object_lookup__lookup_wrong_type_eventually_returns_enotfound(void)
git_oid oid;
git_object *object;
- cl_git_pass(git_oid_fromstr(&oid, commit));
+ cl_git_pass(git_oid_fromstr(&oid, commit, GIT_OID_SHA1));
cl_git_pass(git_object_lookup(&object, g_repo, &oid, GIT_OBJECT_COMMIT));
git_object_free(object);
@@ -71,7 +71,7 @@ void test_object_lookup__lookup_corrupt_object_returns_error(void)
git_object *object;
size_t i;
- cl_git_pass(git_oid_fromstr(&oid, commit));
+ cl_git_pass(git_oid_fromstr(&oid, commit, GIT_OID_SHA1));
cl_git_pass(git_str_joinpath(&path, git_repository_path(g_repo), file));
cl_git_pass(git_futils_readbuffer(&contents, path.ptr));
@@ -101,7 +101,7 @@ void test_object_lookup__lookup_object_with_wrong_hash_returns_error(void)
git_object *object;
git_oid oid;
- cl_git_pass(git_oid_fromstr(&oid, commit));
+ cl_git_pass(git_oid_fromstr(&oid, commit, GIT_OID_SHA1));
/* Copy object to another location with wrong hash */
cl_git_pass(git_str_joinpath(&oldpath, git_repository_path(g_repo), oldloose));
diff --git a/tests/libgit2/object/peel.c b/tests/libgit2/object/peel.c
index 8be6e42..932fd1f 100644
--- a/tests/libgit2/object/peel.c
+++ b/tests/libgit2/object/peel.c
@@ -23,12 +23,12 @@ static void assert_peel(
git_object *obj;
git_object *peeled;
- cl_git_pass(git_oid_fromstr(&oid, sha));
+ cl_git_pass(git_oid_fromstr(&oid, sha, GIT_OID_SHA1));
cl_git_pass(git_object_lookup(&obj, g_repo, &oid, GIT_OBJECT_ANY));
cl_git_pass(git_object_peel(&peeled, obj, requested_type));
- cl_git_pass(git_oid_fromstr(&expected_oid, expected_sha));
+ cl_git_pass(git_oid_fromstr(&expected_oid, expected_sha, GIT_OID_SHA1));
cl_assert_equal_oid(&expected_oid, git_object_id(peeled));
cl_assert_equal_i(expected_type, git_object_type(peeled));
@@ -43,7 +43,7 @@ static void assert_peel_error(int error, const char *sha, git_object_t requested
git_object *obj;
git_object *peeled;
- cl_git_pass(git_oid_fromstr(&oid, sha));
+ cl_git_pass(git_oid_fromstr(&oid, sha, GIT_OID_SHA1));
cl_git_pass(git_object_lookup(&obj, g_repo, &oid, GIT_OBJECT_ANY));
cl_assert_equal_i(error, git_object_peel(&peeled, obj, requested_type));
diff --git a/tests/libgit2/object/raw/chars.c b/tests/libgit2/object/raw/chars.c
index cde0bdb..dbc760d 100644
--- a/tests/libgit2/object/raw/chars.c
+++ b/tests/libgit2/object/raw/chars.c
@@ -19,10 +19,10 @@ void test_object_raw_chars__find_invalid_chars_in_oid(void)
in[38] = (char)i;
if (git__fromhex(i) >= 0) {
exp[19] = (unsigned char)(git__fromhex(i) << 4);
- cl_git_pass(git_oid_fromstr(&out, in));
- cl_assert(memcmp(out.id, exp, sizeof(out.id)) == 0);
+ cl_git_pass(git_oid_fromstr(&out, in, GIT_OID_SHA1));
+ cl_assert(memcmp(out.id, exp, GIT_OID_SHA1_SIZE) == 0);
} else {
- cl_git_fail(git_oid_fromstr(&out, in));
+ cl_git_fail(git_oid_fromstr(&out, in, GIT_OID_SHA1));
}
}
}
@@ -36,6 +36,6 @@ void test_object_raw_chars__build_valid_oid_from_raw_bytes(void)
0xb7, 0x75, 0x21, 0x3c, 0x23,
0xa8, 0xbd, 0x74, 0xf5, 0xe0,
};
- git_oid_fromraw(&out, exp);
- cl_git_pass(memcmp(out.id, exp, sizeof(out.id)));
+ git_oid_fromraw(&out, exp, GIT_OID_SHA1);
+ cl_git_pass(memcmp(out.id, exp, GIT_OID_SHA1_SIZE));
}
diff --git a/tests/libgit2/object/raw/compare.c b/tests/libgit2/object/raw/compare.c
index 9369bc2..7205a53 100644
--- a/tests/libgit2/object/raw/compare.c
+++ b/tests/libgit2/object/raw/compare.c
@@ -13,9 +13,9 @@ void test_object_raw_compare__succeed_on_copy_oid(void)
0xa8, 0xbd, 0x74, 0xf5, 0xe0,
};
memset(&b, 0, sizeof(b));
- git_oid_fromraw(&a, exp);
+ git_oid_fromraw(&a, exp, GIT_OID_SHA1);
git_oid_cpy(&b, &a);
- cl_git_pass(memcmp(a.id, exp, sizeof(a.id)));
+ cl_git_pass(memcmp(a.id, exp, GIT_OID_SHA1_SIZE));
}
void test_object_raw_compare__succeed_on_oid_comparison_lesser(void)
@@ -33,8 +33,8 @@ void test_object_raw_compare__succeed_on_oid_comparison_lesser(void)
0xb7, 0x75, 0x21, 0x3c, 0x23,
0xa8, 0xbd, 0x74, 0xf5, 0xf0,
};
- git_oid_fromraw(&a, a_in);
- git_oid_fromraw(&b, b_in);
+ git_oid_fromraw(&a, a_in, GIT_OID_SHA1);
+ git_oid_fromraw(&b, b_in, GIT_OID_SHA1);
cl_assert(git_oid_cmp(&a, &b) < 0);
}
@@ -47,8 +47,8 @@ void test_object_raw_compare__succeed_on_oid_comparison_equal(void)
0xb7, 0x75, 0x21, 0x3c, 0x23,
0xa8, 0xbd, 0x74, 0xf5, 0xe0,
};
- git_oid_fromraw(&a, a_in);
- git_oid_fromraw(&b, a_in);
+ git_oid_fromraw(&a, a_in, GIT_OID_SHA1);
+ git_oid_fromraw(&b, a_in, GIT_OID_SHA1);
cl_assert(git_oid_cmp(&a, &b) == 0);
}
@@ -67,8 +67,8 @@ void test_object_raw_compare__succeed_on_oid_comparison_greater(void)
0xb7, 0x75, 0x21, 0x3c, 0x23,
0xa8, 0xbd, 0x74, 0xf5, 0xd0,
};
- git_oid_fromraw(&a, a_in);
- git_oid_fromraw(&b, b_in);
+ git_oid_fromraw(&a, a_in, GIT_OID_SHA1);
+ git_oid_fromraw(&b, b_in, GIT_OID_SHA1);
cl_assert(git_oid_cmp(&a, &b) > 0);
}
@@ -78,7 +78,7 @@ void test_object_raw_compare__compare_fmt_oids(void)
git_oid in;
char out[GIT_OID_SHA1_HEXSIZE + 1];
- cl_git_pass(git_oid_fromstr(&in, exp));
+ cl_git_pass(git_oid_fromstr(&in, exp, GIT_OID_SHA1));
/* Format doesn't touch the last byte */
out[GIT_OID_SHA1_HEXSIZE] = 'Z';
@@ -96,7 +96,7 @@ void test_object_raw_compare__compare_static_oids(void)
git_oid in;
char *out;
- cl_git_pass(git_oid_fromstr(&in, exp));
+ cl_git_pass(git_oid_fromstr(&in, exp, GIT_OID_SHA1));
out = git_oid_tostr_s(&in);
cl_assert(out);
@@ -110,7 +110,7 @@ void test_object_raw_compare__compare_pathfmt_oids(void)
git_oid in;
char out[GIT_OID_SHA1_HEXSIZE + 2];
- cl_git_pass(git_oid_fromstr(&in, exp1));
+ cl_git_pass(git_oid_fromstr(&in, exp1, GIT_OID_SHA1));
/* Format doesn't touch the last byte */
out[GIT_OID_SHA1_HEXSIZE + 1] = 'Z';
diff --git a/tests/libgit2/object/raw/convert.c b/tests/libgit2/object/raw/convert.c
index ebf2bb8..fbb33f3 100644
--- a/tests/libgit2/object/raw/convert.c
+++ b/tests/libgit2/object/raw/convert.c
@@ -11,7 +11,7 @@ void test_object_raw_convert__succeed_on_oid_to_string_conversion(void)
char *str;
int i;
- cl_git_pass(git_oid_fromstr(&in, exp));
+ cl_git_pass(git_oid_fromstr(&in, exp, GIT_OID_SHA1));
/* NULL buffer pointer, returns static empty string */
str = git_oid_tostr(NULL, sizeof(out), &in);
@@ -55,7 +55,7 @@ void test_object_raw_convert__succeed_on_oid_to_string_conversion_big(void)
char big[GIT_OID_SHA1_HEXSIZE + 1 + 3]; /* note + 4 => big buffer */
char *str;
- cl_git_pass(git_oid_fromstr(&in, exp));
+ cl_git_pass(git_oid_fromstr(&in, exp, GIT_OID_SHA1));
/* place some tail material */
big[GIT_OID_SHA1_HEXSIZE+0] = 'W'; /* should be '\0' afterwards */
@@ -88,7 +88,7 @@ void test_object_raw_convert__convert_oid_partially(void)
git_oid in;
char big[GIT_OID_SHA1_HEXSIZE + 1 + 3]; /* note + 4 => big buffer */
- cl_git_pass(git_oid_fromstr(&in, exp));
+ cl_git_pass(git_oid_fromstr(&in, exp, GIT_OID_SHA1));
git_oid_nfmt(big, sizeof(big), &in);
cl_assert_equal_s(exp, big);
diff --git a/tests/libgit2/object/raw/fromstr.c b/tests/libgit2/object/raw/fromstr.c
index 8c11c10..a5d7369 100644
--- a/tests/libgit2/object/raw/fromstr.c
+++ b/tests/libgit2/object/raw/fromstr.c
@@ -6,9 +6,9 @@
void test_object_raw_fromstr__fail_on_invalid_oid_string(void)
{
git_oid out;
- cl_git_fail(git_oid_fromstr(&out, ""));
- cl_git_fail(git_oid_fromstr(&out, "moo"));
- cl_git_fail(git_oid_fromstr(&out, "16a67770b7d8d72317c4b775213c23a8bd74f5ez"));
+ cl_git_fail(git_oid_fromstr(&out, "", GIT_OID_SHA1));
+ cl_git_fail(git_oid_fromstr(&out, "moo", GIT_OID_SHA1));
+ cl_git_fail(git_oid_fromstr(&out, "16a67770b7d8d72317c4b775213c23a8bd74f5ez", GIT_OID_SHA1));
}
void test_object_raw_fromstr__succeed_on_valid_oid_string(void)
@@ -21,10 +21,9 @@ void test_object_raw_fromstr__succeed_on_valid_oid_string(void)
0xa8, 0xbd, 0x74, 0xf5, 0xe0,
};
- cl_git_pass(git_oid_fromstr(&out, "16a67770b7d8d72317c4b775213c23a8bd74f5e0"));
- cl_git_pass(memcmp(out.id, exp, sizeof(out.id)));
-
- cl_git_pass(git_oid_fromstr(&out, "16A67770B7D8D72317C4b775213C23A8BD74F5E0"));
- cl_git_pass(memcmp(out.id, exp, sizeof(out.id)));
+ cl_git_pass(git_oid_fromstr(&out, "16a67770b7d8d72317c4b775213c23a8bd74f5e0", GIT_OID_SHA1));
+ cl_git_pass(memcmp(out.id, exp, GIT_OID_SHA1_SIZE));
+ cl_git_pass(git_oid_fromstr(&out, "16A67770B7D8D72317C4b775213C23A8BD74F5E0", GIT_OID_SHA1));
+ cl_git_pass(memcmp(out.id, exp, GIT_OID_SHA1_SIZE));
}
diff --git a/tests/libgit2/object/raw/hash.c b/tests/libgit2/object/raw/hash.c
index 8f22fe0..28bfb1d 100644
--- a/tests/libgit2/object/raw/hash.c
+++ b/tests/libgit2/object/raw/hash.c
@@ -32,16 +32,16 @@ void test_object_raw_hash__hash_by_blocks(void)
/* should already be init'd */
cl_git_pass(git_hash_update(&ctx, hello_text, strlen(hello_text)));
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_git_pass(git_oid_fromraw(&id2, hash, GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&id1, hello_id, GIT_OID_SHA1));
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(hash, &ctx));
- cl_git_pass(git_oid_fromraw(&id2, hash));
- cl_git_pass(git_oid_fromstr(&id1, bye_id));
+ cl_git_pass(git_oid_fromraw(&id2, hash, GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&id1, bye_id, GIT_OID_SHA1));
cl_assert(git_oid_cmp(&id1, &id2) == 0);
git_hash_ctx_cleanup(&ctx);
@@ -52,9 +52,9 @@ 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));
+ cl_git_pass(git_oid_fromstr(&id1, hello_id, GIT_OID_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_git_pass(git_oid_fromraw(&id2, hash, GIT_OID_SHA1));
cl_assert(git_oid_cmp(&id1, &id2) == 0);
}
@@ -62,15 +62,17 @@ void test_object_raw_hash__hash_vector(void)
{
git_oid id1, id2;
git_str_vec vec[2];
+ unsigned char hash[GIT_HASH_SHA1_SIZE];
- cl_git_pass(git_oid_fromstr(&id1, hello_id));
+ cl_git_pass(git_oid_fromstr(&id1, hello_id, GIT_OID_SHA1));
vec[0].data = hello_text;
vec[0].len = 4;
vec[1].data = hello_text+4;
vec[1].len = strlen(hello_text)-4;
- git_hash_vec(id2.id, vec, 2, GIT_HASH_ALGORITHM_SHA1);
+ git_hash_vec(hash, vec, 2, GIT_HASH_ALGORITHM_SHA1);
+ git_oid_fromraw(&id2, hash, GIT_OID_SHA1);
cl_assert(git_oid_cmp(&id1, &id2) == 0);
}
@@ -79,7 +81,7 @@ void test_object_raw_hash__hash_junk_data(void)
{
git_oid id, id_zero;
- cl_git_pass(git_oid_fromstr(&id_zero, zero_id));
+ cl_git_pass(git_oid_fromstr(&id_zero, zero_id, GIT_OID_SHA1));
/* invalid types: */
junk_obj.data = some_data;
@@ -114,7 +116,7 @@ void test_object_raw_hash__hash_commit_object(void)
{
git_oid id1, id2;
- cl_git_pass(git_oid_fromstr(&id1, commit_id));
+ cl_git_pass(git_oid_fromstr(&id1, commit_id, GIT_OID_SHA1));
hash_object_pass(&id2, &commit_obj);
cl_assert(git_oid_cmp(&id1, &id2) == 0);
}
@@ -123,7 +125,7 @@ void test_object_raw_hash__hash_tree_object(void)
{
git_oid id1, id2;
- cl_git_pass(git_oid_fromstr(&id1, tree_id));
+ cl_git_pass(git_oid_fromstr(&id1, tree_id, GIT_OID_SHA1));
hash_object_pass(&id2, &tree_obj);
cl_assert(git_oid_cmp(&id1, &id2) == 0);
}
@@ -132,7 +134,7 @@ void test_object_raw_hash__hash_tag_object(void)
{
git_oid id1, id2;
- cl_git_pass(git_oid_fromstr(&id1, tag_id));
+ cl_git_pass(git_oid_fromstr(&id1, tag_id, GIT_OID_SHA1));
hash_object_pass(&id2, &tag_obj);
cl_assert(git_oid_cmp(&id1, &id2) == 0);
}
@@ -141,7 +143,7 @@ void test_object_raw_hash__hash_zero_length_object(void)
{
git_oid id1, id2;
- cl_git_pass(git_oid_fromstr(&id1, zero_id));
+ cl_git_pass(git_oid_fromstr(&id1, zero_id, GIT_OID_SHA1));
hash_object_pass(&id2, &zero_obj);
cl_assert(git_oid_cmp(&id1, &id2) == 0);
}
@@ -150,7 +152,7 @@ void test_object_raw_hash__hash_one_byte_object(void)
{
git_oid id1, id2;
- cl_git_pass(git_oid_fromstr(&id1, one_id));
+ cl_git_pass(git_oid_fromstr(&id1, one_id, GIT_OID_SHA1));
hash_object_pass(&id2, &one_obj);
cl_assert(git_oid_cmp(&id1, &id2) == 0);
}
@@ -159,7 +161,7 @@ void test_object_raw_hash__hash_two_byte_object(void)
{
git_oid id1, id2;
- cl_git_pass(git_oid_fromstr(&id1, two_id));
+ cl_git_pass(git_oid_fromstr(&id1, two_id, GIT_OID_SHA1));
hash_object_pass(&id2, &two_obj);
cl_assert(git_oid_cmp(&id1, &id2) == 0);
}
@@ -168,7 +170,7 @@ void test_object_raw_hash__hash_multi_byte_object(void)
{
git_oid id1, id2;
- cl_git_pass(git_oid_fromstr(&id1, some_id));
+ cl_git_pass(git_oid_fromstr(&id1, some_id, GIT_OID_SHA1));
hash_object_pass(&id2, &some_obj);
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 1025268..88766f3 100644
--- a/tests/libgit2/object/raw/short.c
+++ b/tests/libgit2/object/raw/short.c
@@ -36,7 +36,7 @@ static int insert_sequential_oids(
p_snprintf(numbuf, sizeof(numbuf), "%u", (unsigned int)i);
git_hash_buf(hashbuf, numbuf, strlen(numbuf), GIT_HASH_ALGORITHM_SHA1);
- git_oid_fromraw(&oid, hashbuf);
+ git_oid_fromraw(&oid, hashbuf, GIT_OID_SHA1);
oids[i] = git__malloc(GIT_OID_SHA1_HEXSIZE + 1);
cl_assert(oids[i]);
diff --git a/tests/libgit2/object/raw/write.c b/tests/libgit2/object/raw/write.c
index 40e05f3..4da2264 100644
--- a/tests/libgit2/object/raw/write.c
+++ b/tests/libgit2/object/raw/write.c
@@ -67,7 +67,7 @@ void test_body(object_data *d, git_rawobj *o)
make_odb_dir();
cl_git_pass(git_odb_open(&db, odb_dir));
- cl_git_pass(git_oid_fromstr(&id1, d->id));
+ cl_git_pass(git_oid_fromstr(&id1, d->id, GIT_OID_SHA1));
streaming_write(&id2, db, o);
cl_assert(git_oid_cmp(&id1, &id2) == 0);
diff --git a/tests/libgit2/object/shortid.c b/tests/libgit2/object/shortid.c
index 9b673ef..7be99bf 100644
--- a/tests/libgit2/object/shortid.c
+++ b/tests/libgit2/object/shortid.c
@@ -19,28 +19,28 @@ void test_object_shortid__select(void)
git_object *obj;
git_buf shorty = {0};
- git_oid_fromstr(&full, "ce013625030ba8dba906f756967f9e9ca394464a");
+ git_oid_fromstr(&full, "ce013625030ba8dba906f756967f9e9ca394464a", GIT_OID_SHA1);
cl_git_pass(git_object_lookup(&obj, _repo, &full, GIT_OBJECT_ANY));
cl_git_pass(git_object_short_id(&shorty, obj));
cl_assert_equal_i(7, shorty.size);
cl_assert_equal_s("ce01362", shorty.ptr);
git_object_free(obj);
- git_oid_fromstr(&full, "038d718da6a1ebbc6a7780a96ed75a70cc2ad6e2");
+ git_oid_fromstr(&full, "038d718da6a1ebbc6a7780a96ed75a70cc2ad6e2", GIT_OID_SHA1);
cl_git_pass(git_object_lookup(&obj, _repo, &full, GIT_OBJECT_ANY));
cl_git_pass(git_object_short_id(&shorty, obj));
cl_assert_equal_i(7, shorty.size);
cl_assert_equal_s("038d718", shorty.ptr);
git_object_free(obj);
- git_oid_fromstr(&full, "dea509d097ce692e167dfc6a48a7a280cc5e877e");
+ git_oid_fromstr(&full, "dea509d097ce692e167dfc6a48a7a280cc5e877e", GIT_OID_SHA1);
cl_git_pass(git_object_lookup(&obj, _repo, &full, GIT_OBJECT_ANY));
cl_git_pass(git_object_short_id(&shorty, obj));
cl_assert_equal_i(9, shorty.size);
cl_assert_equal_s("dea509d09", shorty.ptr);
git_object_free(obj);
- git_oid_fromstr(&full, "dea509d0b3cb8ee0650f6ca210bc83f4678851ba");
+ git_oid_fromstr(&full, "dea509d0b3cb8ee0650f6ca210bc83f4678851ba", GIT_OID_SHA1);
cl_git_pass(git_object_lookup(&obj, _repo, &full, GIT_OBJECT_ANY));
cl_git_pass(git_object_short_id(&shorty, obj));
cl_assert_equal_i(9, shorty.size);
diff --git a/tests/libgit2/object/tag/parse.c b/tests/libgit2/object/tag/parse.c
index 2c0635a..ebf5729 100644
--- a/tests/libgit2/object/tag/parse.c
+++ b/tests/libgit2/object/tag/parse.c
@@ -19,7 +19,7 @@ static void assert_tag_parses(const char *data, size_t datalen,
if (expected_oid) {
git_oid oid;
- cl_git_pass(git_oid_fromstr(&oid, expected_oid));
+ cl_git_pass(git_oid_fromstr(&oid, expected_oid, GIT_OID_SHA1));
cl_assert_equal_oid(&oid, &tag->target);
}
diff --git a/tests/libgit2/object/tag/peel.c b/tests/libgit2/object/tag/peel.c
index 7456a8e..14119af 100644
--- a/tests/libgit2/object/tag/peel.c
+++ b/tests/libgit2/object/tag/peel.c
@@ -29,7 +29,7 @@ static void retrieve_tag_from_oid(git_tag **tag_out, git_repository *repo, const
{
git_oid oid;
- cl_git_pass(git_oid_fromstr(&oid, sha));
+ cl_git_pass(git_oid_fromstr(&oid, sha, GIT_OID_SHA1));
cl_git_pass(git_tag_lookup(tag_out, repo, &oid));
}
diff --git a/tests/libgit2/object/tag/read.c b/tests/libgit2/object/tag/read.c
index 90ba580..07e763c 100644
--- a/tests/libgit2/object/tag/read.c
+++ b/tests/libgit2/object/tag/read.c
@@ -32,9 +32,9 @@ void test_object_tag_read__parse(void)
git_commit *commit;
git_oid id1, id2, id_commit;
- git_oid_fromstr(&id1, tag1_id);
- git_oid_fromstr(&id2, tag2_id);
- git_oid_fromstr(&id_commit, tagged_commit);
+ git_oid_fromstr(&id1, tag1_id, GIT_OID_SHA1);
+ git_oid_fromstr(&id2, tag2_id, GIT_OID_SHA1);
+ git_oid_fromstr(&id_commit, tagged_commit, GIT_OID_SHA1);
cl_git_pass(git_tag_lookup(&tag1, g_repo, &id1));
@@ -67,8 +67,8 @@ void test_object_tag_read__parse_without_tagger(void)
/* TODO: This is a little messy */
cl_git_pass(git_repository_open(&bad_tag_repo, cl_fixture("bad_tag.git")));
- git_oid_fromstr(&id, bad_tag_id);
- git_oid_fromstr(&id_commit, badly_tagged_commit);
+ git_oid_fromstr(&id, bad_tag_id, GIT_OID_SHA1);
+ git_oid_fromstr(&id_commit, badly_tagged_commit, GIT_OID_SHA1);
cl_git_pass(git_tag_lookup(&bad_tag, bad_tag_repo, &id));
cl_assert(bad_tag != NULL);
@@ -99,8 +99,8 @@ void test_object_tag_read__parse_without_message(void)
/* TODO: This is a little messy */
cl_git_pass(git_repository_open(&short_tag_repo, cl_fixture("short_tag.git")));
- git_oid_fromstr(&id, short_tag_id);
- git_oid_fromstr(&id_commit, short_tagged_commit);
+ git_oid_fromstr(&id, short_tag_id, GIT_OID_SHA1);
+ git_oid_fromstr(&id_commit, short_tagged_commit, GIT_OID_SHA1);
cl_git_pass(git_tag_lookup(&short_tag, short_tag_repo, &id));
cl_assert(short_tag != NULL);
@@ -127,7 +127,7 @@ void test_object_tag_read__without_tagger_nor_message(void)
cl_git_pass(git_repository_open(&repo, cl_fixture("testrepo.git")));
- cl_git_pass(git_oid_fromstr(&id, taggerless));
+ cl_git_pass(git_oid_fromstr(&id, taggerless, GIT_OID_SHA1));
cl_git_pass(git_tag_lookup(&tag, repo, &id));
diff --git a/tests/libgit2/object/tag/write.c b/tests/libgit2/object/tag/write.c
index 3c1a989..8f763f2 100644
--- a/tests/libgit2/object/tag/write.c
+++ b/tests/libgit2/object/tag/write.c
@@ -30,7 +30,7 @@ void test_object_tag_write__basic(void)
git_reference *ref_tag;
git_object *target;
- git_oid_fromstr(&target_id, tagged_commit);
+ git_oid_fromstr(&target_id, tagged_commit, GIT_OID_SHA1);
cl_git_pass(git_object_lookup(&target, g_repo, &target_id, GIT_OBJECT_COMMIT));
/* create signature */
@@ -72,7 +72,7 @@ void test_object_tag_write__overwrite(void)
git_signature *tagger;
git_object *target;
- git_oid_fromstr(&target_id, tagged_commit);
+ git_oid_fromstr(&target_id, tagged_commit, GIT_OID_SHA1);
cl_git_pass(git_object_lookup(&target, g_repo, &target_id, GIT_OBJECT_COMMIT));
/* create signature */
@@ -99,7 +99,7 @@ void test_object_tag_write__replace(void)
git_reference *ref_tag;
git_object *target;
- git_oid_fromstr(&target_id, tagged_commit);
+ git_oid_fromstr(&target_id, tagged_commit, GIT_OID_SHA1);
cl_git_pass(git_object_lookup(&target, g_repo, &target_id, GIT_OBJECT_COMMIT));
cl_git_pass(git_reference_lookup(&ref_tag, g_repo, "refs/tags/e90810b"));
@@ -135,7 +135,7 @@ void test_object_tag_write__lightweight(void)
git_reference *ref_tag;
git_object *target;
- git_oid_fromstr(&target_id, tagged_commit);
+ git_oid_fromstr(&target_id, tagged_commit, GIT_OID_SHA1);
cl_git_pass(git_object_lookup(&target, g_repo, &target_id, GIT_OBJECT_COMMIT));
cl_git_pass(git_tag_create_lightweight(
@@ -163,7 +163,7 @@ void test_object_tag_write__lightweight_over_existing(void)
git_oid target_id, object_id, existing_object_id;
git_object *target;
- git_oid_fromstr(&target_id, tagged_commit);
+ git_oid_fromstr(&target_id, tagged_commit, GIT_OID_SHA1);
cl_git_pass(git_object_lookup(&target, g_repo, &target_id, GIT_OBJECT_COMMIT));
cl_assert_equal_i(GIT_EEXISTS, git_tag_create_lightweight(
@@ -173,7 +173,7 @@ void test_object_tag_write__lightweight_over_existing(void)
target,
0));
- git_oid_fromstr(&existing_object_id, tag2_id);
+ git_oid_fromstr(&existing_object_id, tag2_id, GIT_OID_SHA1);
cl_assert(git_oid_cmp(&object_id, &existing_object_id) == 0);
git_object_free(target);
@@ -197,7 +197,7 @@ void test_object_tag_write__creating_with_an_invalid_name_returns_EINVALIDSPEC(v
git_signature *tagger;
git_object *target;
- git_oid_fromstr(&target_id, tagged_commit);
+ git_oid_fromstr(&target_id, tagged_commit, GIT_OID_SHA1);
cl_git_pass(git_object_lookup(&target, g_repo, &target_id, GIT_OBJECT_COMMIT));
cl_git_pass(git_signature_new(&tagger, tagger_name, tagger_email, 123456789, 60));
@@ -229,7 +229,7 @@ static void create_annotation(git_oid *tag_id, const char *name)
cl_git_pass(git_signature_new(&tagger, tagger_name, tagger_email, 123456789, 60));
- git_oid_fromstr(&target_id, tagged_commit);
+ git_oid_fromstr(&target_id, tagged_commit, GIT_OID_SHA1);
cl_git_pass(git_object_lookup(&target, g_repo, &target_id, GIT_OBJECT_COMMIT));
cl_git_pass(git_tag_annotation_create(tag_id, g_repo, name, target, tagger, "boom!"));
diff --git a/tests/libgit2/object/tree/attributes.c b/tests/libgit2/object/tree/attributes.c
index 8654dfa..3599fed 100644
--- a/tests/libgit2/object/tree/attributes.c
+++ b/tests/libgit2/object/tree/attributes.c
@@ -21,7 +21,7 @@ void test_object_tree_attributes__ensure_correctness_of_attributes_on_insertion(
git_treebuilder *builder;
git_oid oid;
- cl_git_pass(git_oid_fromstr(&oid, blob_oid));
+ cl_git_pass(git_oid_fromstr(&oid, blob_oid, GIT_OID_SHA1));
cl_git_pass(git_treebuilder_new(&builder, repo, NULL));
@@ -39,7 +39,7 @@ void test_object_tree_attributes__group_writable_tree_entries_created_with_an_an
const git_tree_entry *entry;
- cl_git_pass(git_oid_fromstr(&tid, tree_oid));
+ cl_git_pass(git_oid_fromstr(&tid, tree_oid, GIT_OID_SHA1));
cl_git_pass(git_tree_lookup(&tree, repo, &tid));
entry = git_tree_entry_byname(tree, "old_mode.txt");
@@ -56,7 +56,7 @@ void test_object_tree_attributes__treebuilder_reject_invalid_filemode(void)
git_oid bid;
const git_tree_entry *entry;
- cl_git_pass(git_oid_fromstr(&bid, blob_oid));
+ cl_git_pass(git_oid_fromstr(&bid, blob_oid, GIT_OID_SHA1));
cl_git_pass(git_treebuilder_new(&builder, repo, NULL));
cl_git_fail(git_treebuilder_insert(
@@ -76,7 +76,7 @@ void test_object_tree_attributes__normalize_attributes_when_creating_a_tree_from
git_tree *tree;
const git_tree_entry *entry;
- cl_git_pass(git_oid_fromstr(&tid, tree_oid));
+ cl_git_pass(git_oid_fromstr(&tid, tree_oid, GIT_OID_SHA1));
cl_git_pass(git_tree_lookup(&tree, repo, &tid));
cl_git_pass(git_treebuilder_new(&builder, repo, tree));
@@ -107,7 +107,7 @@ void test_object_tree_attributes__normalize_600(void)
git_tree *tree;
const git_tree_entry *entry;
- git_oid_fromstr(&id, "0810fb7818088ff5ac41ee49199b51473b1bd6c7");
+ git_oid_fromstr(&id, "0810fb7818088ff5ac41ee49199b51473b1bd6c7", GIT_OID_SHA1);
cl_git_pass(git_tree_lookup(&tree, repo, &id));
entry = git_tree_entry_byname(tree, "ListaTeste.xml");
diff --git a/tests/libgit2/object/tree/duplicateentries.c b/tests/libgit2/object/tree/duplicateentries.c
index c11ae0d..f88e395 100644
--- a/tests/libgit2/object/tree/duplicateentries.c
+++ b/tests/libgit2/object/tree/duplicateentries.c
@@ -45,7 +45,7 @@ static void tree_checker(
cl_assert_equal_i(1, (int)git_tree_entrycount(tree));
entry = git_tree_entry_byindex(tree, 0);
- cl_git_pass(git_oid_fromstr(&oid, expected_sha));
+ cl_git_pass(git_oid_fromstr(&oid, expected_sha, GIT_OID_SHA1));
cl_assert_equal_i(0, git_oid_cmp(&oid, git_tree_entry_id(entry)));
cl_assert_equal_i(expected_filemode, git_tree_entry_filemode(entry));
@@ -71,14 +71,16 @@ static void two_blobs(git_treebuilder *bld)
const git_tree_entry *entry;
cl_git_pass(git_oid_fromstr(&oid,
- "a8233120f6ad708f843d861ce2b7228ec4e3dec6")); /* blob oid (README) */
+ "a8233120f6ad708f843d861ce2b7228ec4e3dec6",
+ GIT_OID_SHA1)); /* blob oid (README) */
cl_git_pass(git_treebuilder_insert(
&entry, bld, "duplicate", &oid,
GIT_FILEMODE_BLOB));
cl_git_pass(git_oid_fromstr(&oid,
- "a71586c1dfe8a71c6cbf6c129f404c5642ff31bd")); /* blob oid (new.txt) */
+ "a71586c1dfe8a71c6cbf6c129f404c5642ff31bd",
+ GIT_OID_SHA1)); /* blob oid (new.txt) */
cl_git_pass(git_treebuilder_insert(
&entry, bld, "duplicate", &oid,
@@ -91,14 +93,16 @@ static void one_blob_and_one_tree(git_treebuilder *bld)
const git_tree_entry *entry;
cl_git_pass(git_oid_fromstr(&oid,
- "a8233120f6ad708f843d861ce2b7228ec4e3dec6")); /* blob oid (README) */
+ "a8233120f6ad708f843d861ce2b7228ec4e3dec6",
+ GIT_OID_SHA1)); /* blob oid (README) */
cl_git_pass(git_treebuilder_insert(
&entry, bld, "duplicate", &oid,
GIT_FILEMODE_BLOB));
cl_git_pass(git_oid_fromstr(&oid,
- "4e0883eeeeebc1fb1735161cea82f7cb5fab7e63")); /* tree oid (a) */
+ "4e0883eeeeebc1fb1735161cea82f7cb5fab7e63",
+ GIT_OID_SHA1)); /* tree oid (a) */
cl_git_pass(git_treebuilder_insert(
&entry, bld, "duplicate", &oid,
@@ -127,17 +131,17 @@ static void add_fake_conflicts(git_index *index)
ancestor_entry.path = "duplicate";
ancestor_entry.mode = GIT_FILEMODE_BLOB;
GIT_INDEX_ENTRY_STAGE_SET(&ancestor_entry, 1);
- git_oid_fromstr(&ancestor_entry.id, "a8233120f6ad708f843d861ce2b7228ec4e3dec6");
+ git_oid_fromstr(&ancestor_entry.id, "a8233120f6ad708f843d861ce2b7228ec4e3dec6", GIT_OID_SHA1);
our_entry.path = "duplicate";
our_entry.mode = GIT_FILEMODE_BLOB;
GIT_INDEX_ENTRY_STAGE_SET(&our_entry, 2);
- git_oid_fromstr(&our_entry.id, "45b983be36b73c0788dc9cbcb76cbb80fc7bb057");
+ git_oid_fromstr(&our_entry.id, "45b983be36b73c0788dc9cbcb76cbb80fc7bb057", GIT_OID_SHA1);
their_entry.path = "duplicate";
their_entry.mode = GIT_FILEMODE_BLOB;
GIT_INDEX_ENTRY_STAGE_SET(&their_entry, 3);
- git_oid_fromstr(&their_entry.id, "a71586c1dfe8a71c6cbf6c129f404c5642ff31bd");
+ git_oid_fromstr(&their_entry.id, "a71586c1dfe8a71c6cbf6c129f404c5642ff31bd", GIT_OID_SHA1);
cl_git_pass(git_index_conflict_add(index, &ancestor_entry, &our_entry, &their_entry));
}
diff --git a/tests/libgit2/object/tree/frompath.c b/tests/libgit2/object/tree/frompath.c
index 86ca47e..96ee4ba 100644
--- a/tests/libgit2/object/tree/frompath.c
+++ b/tests/libgit2/object/tree/frompath.c
@@ -11,7 +11,7 @@ void test_object_tree_frompath__initialize(void)
cl_git_pass(git_repository_open(&repo, cl_fixture("testrepo.git")));
cl_assert(repo != NULL);
- cl_git_pass(git_oid_fromstr(&id, tree_with_subtrees_oid));
+ cl_git_pass(git_oid_fromstr(&id, tree_with_subtrees_oid, GIT_OID_SHA1));
cl_git_pass(git_tree_lookup(&tree, repo, &id));
cl_assert(tree != NULL);
}
diff --git a/tests/libgit2/object/tree/parse.c b/tests/libgit2/object/tree/parse.c
index 4e871dc..deb6831 100644
--- a/tests/libgit2/object/tree/parse.c
+++ b/tests/libgit2/object/tree/parse.c
@@ -35,7 +35,7 @@ static void assert_tree_parses(const char *data, size_t datalen,
const git_tree_entry *entry;
git_oid oid;
- cl_git_pass(git_oid_fromstr(&oid, expected->oid));
+ cl_git_pass(git_oid_fromstr(&oid, expected->oid, GIT_OID_SHA1));
cl_assert(entry = git_tree_entry_byname(tree, expected->filename));
cl_assert_equal_s(expected->filename, entry->filename);
diff --git a/tests/libgit2/object/tree/read.c b/tests/libgit2/object/tree/read.c
index 95a2e70..545bfca 100644
--- a/tests/libgit2/object/tree/read.c
+++ b/tests/libgit2/object/tree/read.c
@@ -25,7 +25,7 @@ void test_object_tree_read__loaded(void)
git_oid id;
git_tree *tree;
- git_oid_fromstr(&id, tree_oid);
+ git_oid_fromstr(&id, tree_oid, GIT_OID_SHA1);
cl_git_pass(git_tree_lookup(&tree, g_repo, &id));
@@ -48,7 +48,7 @@ void test_object_tree_read__two(void)
const git_tree_entry *entry;
git_object *obj;
- git_oid_fromstr(&id, tree_oid);
+ git_oid_fromstr(&id, tree_oid, GIT_OID_SHA1);
cl_git_pass(git_tree_lookup(&tree, g_repo, &id));
diff --git a/tests/libgit2/object/tree/update.c b/tests/libgit2/object/tree/update.c
index 4e1191d..81629b4 100644
--- a/tests/libgit2/object/tree/update.c
+++ b/tests/libgit2/object/tree/update.c
@@ -24,7 +24,7 @@ void test_object_tree_update__remove_blob(void)
{ GIT_TREE_UPDATE_REMOVE, GIT_OID_SHA1_ZERO, GIT_FILEMODE_BLOB /* ignored */, path},
};
- cl_git_pass(git_oid_fromstr(&base_id, "c4dc1555e4d4fa0e0c9c3fc46734c7c35b3ce90b"));
+ cl_git_pass(git_oid_fromstr(&base_id, "c4dc1555e4d4fa0e0c9c3fc46734c7c35b3ce90b", GIT_OID_SHA1));
cl_git_pass(git_tree_lookup(&base_tree, g_repo, &base_id));
/* Create it with an index */
@@ -53,7 +53,7 @@ void test_object_tree_update__remove_blob_deeper(void)
{ GIT_TREE_UPDATE_REMOVE, GIT_OID_SHA1_ZERO, GIT_FILEMODE_BLOB /* ignored */, path},
};
- cl_git_pass(git_oid_fromstr(&base_id, "c4dc1555e4d4fa0e0c9c3fc46734c7c35b3ce90b"));
+ cl_git_pass(git_oid_fromstr(&base_id, "c4dc1555e4d4fa0e0c9c3fc46734c7c35b3ce90b", GIT_OID_SHA1));
cl_git_pass(git_tree_lookup(&base_tree, g_repo, &base_id));
/* Create it with an index */
@@ -84,7 +84,7 @@ void test_object_tree_update__remove_all_entries(void)
{ GIT_TREE_UPDATE_REMOVE, GIT_OID_SHA1_ZERO, GIT_FILEMODE_BLOB /* ignored */, path2},
};
- cl_git_pass(git_oid_fromstr(&base_id, "c4dc1555e4d4fa0e0c9c3fc46734c7c35b3ce90b"));
+ cl_git_pass(git_oid_fromstr(&base_id, "c4dc1555e4d4fa0e0c9c3fc46734c7c35b3ce90b", GIT_OID_SHA1));
cl_git_pass(git_tree_lookup(&base_tree, g_repo, &base_id));
/* Create it with an index */
@@ -115,7 +115,7 @@ void test_object_tree_update__replace_blob(void)
{ GIT_TREE_UPDATE_UPSERT, GIT_OID_SHA1_ZERO, GIT_FILEMODE_BLOB, path},
};
- cl_git_pass(git_oid_fromstr(&base_id, "c4dc1555e4d4fa0e0c9c3fc46734c7c35b3ce90b"));
+ cl_git_pass(git_oid_fromstr(&base_id, "c4dc1555e4d4fa0e0c9c3fc46734c7c35b3ce90b", GIT_OID_SHA1));
cl_git_pass(git_tree_lookup(&base_tree, g_repo, &base_id));
/* Create it with an index */
@@ -123,7 +123,7 @@ void test_object_tree_update__replace_blob(void)
cl_git_pass(git_index_read_tree(idx, base_tree));
entry.path = path;
- cl_git_pass(git_oid_fromstr(&entry.id, "fa49b077972391ad58037050f2a75f74e3671e92"));
+ cl_git_pass(git_oid_fromstr(&entry.id, "fa49b077972391ad58037050f2a75f74e3671e92", GIT_OID_SHA1));
entry.mode = GIT_FILEMODE_BLOB;
cl_git_pass(git_index_add(idx, &entry));
@@ -131,7 +131,7 @@ void test_object_tree_update__replace_blob(void)
git_index_free(idx);
/* Perform the same operation via the tree updater */
- cl_git_pass(git_oid_fromstr(&updates[0].id, "fa49b077972391ad58037050f2a75f74e3671e92"));
+ cl_git_pass(git_oid_fromstr(&updates[0].id, "fa49b077972391ad58037050f2a75f74e3671e92", GIT_OID_SHA1));
cl_git_pass(git_tree_create_updated(&tree_updater_id, g_repo, base_tree, 1, updates));
cl_assert_equal_oid(&tree_index_id, &tree_updater_id);
@@ -158,13 +158,13 @@ void test_object_tree_update__add_blobs(void)
{ GIT_TREE_UPDATE_UPSERT, GIT_OID_SHA1_ZERO, GIT_FILEMODE_BLOB, paths[2]},
};
- cl_git_pass(git_oid_fromstr(&base_id, "c4dc1555e4d4fa0e0c9c3fc46734c7c35b3ce90b"));
+ cl_git_pass(git_oid_fromstr(&base_id, "c4dc1555e4d4fa0e0c9c3fc46734c7c35b3ce90b", GIT_OID_SHA1));
entry.mode = GIT_FILEMODE_BLOB;
- cl_git_pass(git_oid_fromstr(&entry.id, "fa49b077972391ad58037050f2a75f74e3671e92"));
+ cl_git_pass(git_oid_fromstr(&entry.id, "fa49b077972391ad58037050f2a75f74e3671e92", GIT_OID_SHA1));
for (i = 0; i < 3; i++) {
- cl_git_pass(git_oid_fromstr(&updates[i].id, "fa49b077972391ad58037050f2a75f74e3671e92"));
+ cl_git_pass(git_oid_fromstr(&updates[i].id, "fa49b077972391ad58037050f2a75f74e3671e92", GIT_OID_SHA1));
}
for (i = 0; i < 2; i++) {
@@ -215,13 +215,13 @@ void test_object_tree_update__add_blobs_unsorted(void)
{ GIT_TREE_UPDATE_UPSERT, GIT_OID_SHA1_ZERO, GIT_FILEMODE_BLOB, paths[2]},
};
- cl_git_pass(git_oid_fromstr(&base_id, "c4dc1555e4d4fa0e0c9c3fc46734c7c35b3ce90b"));
+ cl_git_pass(git_oid_fromstr(&base_id, "c4dc1555e4d4fa0e0c9c3fc46734c7c35b3ce90b", GIT_OID_SHA1));
entry.mode = GIT_FILEMODE_BLOB;
- cl_git_pass(git_oid_fromstr(&entry.id, "fa49b077972391ad58037050f2a75f74e3671e92"));
+ cl_git_pass(git_oid_fromstr(&entry.id, "fa49b077972391ad58037050f2a75f74e3671e92", GIT_OID_SHA1));
for (i = 0; i < 3; i++) {
- cl_git_pass(git_oid_fromstr(&updates[i].id, "fa49b077972391ad58037050f2a75f74e3671e92"));
+ cl_git_pass(git_oid_fromstr(&updates[i].id, "fa49b077972391ad58037050f2a75f74e3671e92", GIT_OID_SHA1));
}
for (i = 0; i < 2; i++) {
@@ -263,7 +263,7 @@ void test_object_tree_update__add_conflict(void)
};
for (i = 0; i < 2; i++) {
- cl_git_pass(git_oid_fromstr(&updates[i].id, "a71586c1dfe8a71c6cbf6c129f404c5642ff31bd"));
+ cl_git_pass(git_oid_fromstr(&updates[i].id, "a71586c1dfe8a71c6cbf6c129f404c5642ff31bd", GIT_OID_SHA1));
}
cl_git_fail(git_tree_create_updated(&tree_updater_id, g_repo, NULL, 2, updates));
@@ -279,7 +279,7 @@ void test_object_tree_update__add_conflict2(void)
};
for (i = 0; i < 2; i++) {
- cl_git_pass(git_oid_fromstr(&updates[i].id, "a71586c1dfe8a71c6cbf6c129f404c5642ff31bd"));
+ cl_git_pass(git_oid_fromstr(&updates[i].id, "a71586c1dfe8a71c6cbf6c129f404c5642ff31bd", GIT_OID_SHA1));
}
cl_git_fail(git_tree_create_updated(&tree_updater_id, g_repo, NULL, 2, updates));
@@ -294,7 +294,7 @@ void test_object_tree_update__remove_invalid_submodule(void)
};
/* This tree contains a submodule with an all-zero commit for a submodule named 'submodule' */
- cl_git_pass(git_oid_fromstr(&baseline_id, "396c7f1adb7925f51ba13a75f48252f44c5a14a2"));
+ cl_git_pass(git_oid_fromstr(&baseline_id, "396c7f1adb7925f51ba13a75f48252f44c5a14a2", GIT_OID_SHA1));
cl_git_pass(git_tree_lookup(&baseline, g_repo, &baseline_id));
cl_git_pass(git_tree_create_updated(&updated_tree_id, g_repo, baseline, 1, updates));
diff --git a/tests/libgit2/object/tree/walk.c b/tests/libgit2/object/tree/walk.c
index d1fdaa3..ad2d5d3 100644
--- a/tests/libgit2/object/tree/walk.c
+++ b/tests/libgit2/object/tree/walk.c
@@ -33,7 +33,7 @@ void test_object_tree_walk__0(void)
git_tree *tree;
int ct;
- git_oid_fromstr(&id, tree_oid);
+ git_oid_fromstr(&id, tree_oid, GIT_OID_SHA1);
cl_git_pass(git_tree_lookup(&tree, g_repo, &id));
@@ -77,7 +77,7 @@ void test_object_tree_walk__1(void)
git_tree *tree;
int ct;
- git_oid_fromstr(&id, tree_oid);
+ git_oid_fromstr(&id, tree_oid, GIT_OID_SHA1);
cl_git_pass(git_tree_lookup(&tree, g_repo, &id));
@@ -138,7 +138,7 @@ void test_object_tree_walk__2(void)
struct treewalk_skip_data data;
/* look up a deep tree */
- git_oid_fromstr(&id, "ae90f12eea699729ed24555e40b9fd669da12a12");
+ git_oid_fromstr(&id, "ae90f12eea699729ed24555e40b9fd669da12a12", GIT_OID_SHA1);
cl_git_pass(git_tree_lookup(&tree, g_repo, &id));
memset(&data, 0, sizeof(data));
diff --git a/tests/libgit2/object/tree/write.c b/tests/libgit2/object/tree/write.c
index 5088a96..b3bcc0f 100644
--- a/tests/libgit2/object/tree/write.c
+++ b/tests/libgit2/object/tree/write.c
@@ -29,9 +29,9 @@ void test_object_tree_write__from_memory(void)
git_tree *tree;
git_oid id, bid, rid, id2;
- git_oid_fromstr(&id, first_tree);
- git_oid_fromstr(&id2, second_tree);
- git_oid_fromstr(&bid, blob_oid);
+ git_oid_fromstr(&id, first_tree, GIT_OID_SHA1);
+ git_oid_fromstr(&id2, second_tree, GIT_OID_SHA1);
+ git_oid_fromstr(&bid, blob_oid, GIT_OID_SHA1);
/* create a second tree from first tree using `git_treebuilder_insert`
* on REPOSITORY_FOLDER.
@@ -71,10 +71,10 @@ void test_object_tree_write__subtree(void)
git_oid id, bid, subtree_id, id2, id3;
git_oid id_hiearar;
- git_oid_fromstr(&id, first_tree);
- git_oid_fromstr(&id2, second_tree);
- git_oid_fromstr(&id3, third_tree);
- git_oid_fromstr(&bid, blob_oid);
+ git_oid_fromstr(&id, first_tree, GIT_OID_SHA1);
+ git_oid_fromstr(&id2, second_tree, GIT_OID_SHA1);
+ git_oid_fromstr(&id3, third_tree, GIT_OID_SHA1);
+ git_oid_fromstr(&bid, blob_oid, GIT_OID_SHA1);
/* create subtree */
cl_git_pass(git_treebuilder_new(&builder, g_repo, NULL));
@@ -135,8 +135,8 @@ void test_object_tree_write__sorted_subtrees(void)
git_oid bid, tid, tree_oid;
- cl_git_pass(git_oid_fromstr(&bid, blob_oid));
- cl_git_pass(git_oid_fromstr(&tid, first_tree));
+ cl_git_pass(git_oid_fromstr(&bid, blob_oid, GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&tid, first_tree, GIT_OID_SHA1));
cl_git_pass(git_treebuilder_new(&builder, g_repo, NULL));
@@ -195,7 +195,7 @@ void test_object_tree_write__removing_and_re_adding_in_treebuilder(void)
git_oid entry_oid, tree_oid;
git_tree *tree;
- cl_git_pass(git_oid_fromstr(&entry_oid, blob_oid));
+ cl_git_pass(git_oid_fromstr(&entry_oid, blob_oid, GIT_OID_SHA1));
cl_git_pass(git_treebuilder_new(&builder, g_repo, NULL));
@@ -286,7 +286,7 @@ void test_object_tree_write__filtering(void)
git_oid entry_oid, tree_oid;
git_tree *tree;
- git_oid_fromstr(&entry_oid, blob_oid);
+ git_oid_fromstr(&entry_oid, blob_oid, GIT_OID_SHA1);
cl_git_pass(git_treebuilder_new(&builder, g_repo, NULL));
@@ -348,7 +348,7 @@ void test_object_tree_write__cruel_paths(void)
int count = 0, i, j;
git_tree_entry *te;
- git_oid_fromstr(&bid, blob_oid);
+ git_oid_fromstr(&bid, blob_oid, GIT_OID_SHA1);
/* create tree */
cl_git_pass(git_treebuilder_new(&builder, g_repo, NULL));
@@ -411,7 +411,7 @@ void test_object_tree_write__protect_filesystems(void)
git_treebuilder *builder;
git_oid bid;
- cl_git_pass(git_oid_fromstr(&bid, "fa49b077972391ad58037050f2a75f74e3671e92"));
+ cl_git_pass(git_oid_fromstr(&bid, "fa49b077972391ad58037050f2a75f74e3671e92", GIT_OID_SHA1));
/* Ensure that (by default) we can write objects with funny names on
* platforms that are not affected.
@@ -460,12 +460,14 @@ static void test_invalid_objects(bool should_allow_invalid)
"Expected function call to fail: " #expr), \
NULL, 1)
- cl_git_pass(git_oid_fromstr(&valid_blob_id, blob_oid));
+ cl_git_pass(git_oid_fromstr(&valid_blob_id, blob_oid, GIT_OID_SHA1));
cl_git_pass(git_oid_fromstr(&invalid_blob_id,
- "1234567890123456789012345678901234567890"));
- cl_git_pass(git_oid_fromstr(&valid_tree_id, first_tree));
+ "1234567890123456789012345678901234567890",
+ GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&valid_tree_id, first_tree, GIT_OID_SHA1));
cl_git_pass(git_oid_fromstr(&invalid_tree_id,
- "0000000000111111111122222222223333333333"));
+ "0000000000111111111122222222223333333333",
+ GIT_OID_SHA1));
cl_git_pass(git_treebuilder_new(&builder, g_repo, NULL));
@@ -495,7 +497,7 @@ static void test_inserting_submodule(void)
git_treebuilder *bld;
git_oid sm_id;
- cl_git_pass(git_oid_fromstr(&sm_id, "da39a3ee5e6b4b0d3255bfef95601890afd80709"));
+ cl_git_pass(git_oid_fromstr(&sm_id, "da39a3ee5e6b4b0d3255bfef95601890afd80709", GIT_OID_SHA1));
cl_git_pass(git_treebuilder_new(&bld, g_repo, NULL));
cl_git_pass(git_treebuilder_insert(NULL, bld, "sm", &sm_id, GIT_FILEMODE_COMMIT));
git_treebuilder_free(bld);
diff --git a/tests/libgit2/odb/alternates.c b/tests/libgit2/odb/alternates.c
index 6c00fda..0e14e1d 100644
--- a/tests/libgit2/odb/alternates.c
+++ b/tests/libgit2/odb/alternates.c
@@ -52,7 +52,7 @@ void test_odb_alternates__chained(void)
/* Now load B and see if we can find an object from testrepo.git */
cl_git_pass(git_repository_open(&repo, paths[1]));
- git_oid_fromstr(&oid, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750");
+ git_oid_fromstr(&oid, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &oid));
git_commit_free(commit);
git_repository_free(repo);
@@ -74,7 +74,7 @@ void test_odb_alternates__long_chain(void)
/* Now load the last one and see if we can find an object from testrepo.git */
cl_git_pass(git_repository_open(&repo, paths[ARRAY_SIZE(paths)-1]));
- git_oid_fromstr(&oid, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750");
+ git_oid_fromstr(&oid, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", GIT_OID_SHA1);
cl_git_fail(git_commit_lookup(&commit, repo, &oid));
git_repository_free(repo);
}
diff --git a/tests/libgit2/odb/backend/backend_helpers.c b/tests/libgit2/odb/backend/backend_helpers.c
index c595e47..337c11c 100644
--- a/tests/libgit2/odb/backend/backend_helpers.c
+++ b/tests/libgit2/odb/backend/backend_helpers.c
@@ -9,7 +9,7 @@ static int search_object(const fake_object **out, fake_backend *fake, const git_
while (obj && obj->oid) {
git_oid current_oid;
- git_oid_fromstr(¤t_oid, obj->oid);
+ git_oid_fromstr(¤t_oid, obj->oid, GIT_OID_SHA1);
if (git_oid_ncmp(¤t_oid, oid, len) == 0) {
if (found)
@@ -52,7 +52,7 @@ static int fake_backend__exists_prefix(
return error;
if (out)
- git_oid_fromstr(out, obj->oid);
+ git_oid_fromstr(out, obj->oid, GIT_OID_SHA1);
return 0;
}
@@ -115,7 +115,7 @@ static int fake_backend__read_prefix(
if ((error = search_object(&obj, fake, short_oid, len)) < 0)
return error;
- git_oid_fromstr(out_oid, obj->oid);
+ git_oid_fromstr(out_oid, obj->oid, GIT_OID_SHA1);
*len_p = strlen(obj->content);
*buffer_p = git__strdup(obj->content);
*type_p = GIT_OBJECT_BLOB;
diff --git a/tests/libgit2/odb/backend/mempack.c b/tests/libgit2/odb/backend/mempack.c
index 2eeed51..7e0da3f 100644
--- a/tests/libgit2/odb/backend/mempack.c
+++ b/tests/libgit2/odb/backend/mempack.c
@@ -34,13 +34,13 @@ void test_odb_backend_mempack__write_succeeds(void)
void test_odb_backend_mempack__read_of_missing_object_fails(void)
{
- cl_git_pass(git_oid_fromstr(&_oid, "f6ea0495187600e7b2288c8ac19c5886383a4633"));
+ cl_git_pass(git_oid_fromstr(&_oid, "f6ea0495187600e7b2288c8ac19c5886383a4633", GIT_OID_SHA1));
cl_git_fail_with(GIT_ENOTFOUND, git_odb_read(&_obj, _odb, &_oid));
}
void test_odb_backend_mempack__exists_of_missing_object_fails(void)
{
- cl_git_pass(git_oid_fromstr(&_oid, "f6ea0495187600e7b2288c8ac19c5886383a4633"));
+ cl_git_pass(git_oid_fromstr(&_oid, "f6ea0495187600e7b2288c8ac19c5886383a4633", GIT_OID_SHA1));
cl_assert(git_odb_exists(_odb, &_oid) == 0);
}
diff --git a/tests/libgit2/odb/backend/multiple.c b/tests/libgit2/odb/backend/multiple.c
index 5f1eacd..ee751ae 100644
--- a/tests/libgit2/odb/backend/multiple.c
+++ b/tests/libgit2/odb/backend/multiple.c
@@ -24,7 +24,7 @@ void test_odb_backend_multiple__initialize(void)
{
git_odb_backend *backend;
- git_oid_fromstr(&_existing_oid, EXISTING_HASH);
+ git_oid_fromstr(&_existing_oid, EXISTING_HASH, GIT_OID_SHA1);
_obj = NULL;
_repo = cl_git_sandbox_init("testrepo.git");
diff --git a/tests/libgit2/odb/backend/nonrefreshing.c b/tests/libgit2/odb/backend/nonrefreshing.c
index 2db10ef..5fb7a4d 100644
--- a/tests/libgit2/odb/backend/nonrefreshing.c
+++ b/tests/libgit2/odb/backend/nonrefreshing.c
@@ -33,8 +33,8 @@ static void setup_repository_and_backend(void)
void test_odb_backend_nonrefreshing__initialize(void)
{
- git_oid_fromstr(&_nonexisting_oid, NONEXISTING_HASH);
- git_oid_fromstr(&_existing_oid, EXISTING_HASH);
+ git_oid_fromstr(&_nonexisting_oid, NONEXISTING_HASH, GIT_OID_SHA1);
+ git_oid_fromstr(&_existing_oid, EXISTING_HASH, GIT_OID_SHA1);
setup_repository_and_backend();
}
diff --git a/tests/libgit2/odb/backend/refreshing.c b/tests/libgit2/odb/backend/refreshing.c
index 9e49298..39c55c2 100644
--- a/tests/libgit2/odb/backend/refreshing.c
+++ b/tests/libgit2/odb/backend/refreshing.c
@@ -33,8 +33,8 @@ static void setup_repository_and_backend(void)
void test_odb_backend_refreshing__initialize(void)
{
- git_oid_fromstr(&_nonexisting_oid, NONEXISTING_HASH);
- git_oid_fromstr(&_existing_oid, EXISTING_HASH);
+ git_oid_fromstr(&_nonexisting_oid, NONEXISTING_HASH, GIT_OID_SHA1);
+ git_oid_fromstr(&_existing_oid, EXISTING_HASH, GIT_OID_SHA1);
setup_repository_and_backend();
}
diff --git a/tests/libgit2/odb/backend/simple.c b/tests/libgit2/odb/backend/simple.c
index d2051f8..c6545f3 100644
--- a/tests/libgit2/odb/backend/simple.c
+++ b/tests/libgit2/odb/backend/simple.c
@@ -49,7 +49,7 @@ void test_odb_backend_simple__read_of_object_succeeds(void)
setup_backend(objs);
- cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid));
+ cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid, GIT_OID_SHA1));
cl_git_pass(git_odb_read(&_obj, _odb, &_oid));
assert_object_contains(_obj, objs[0].content);
@@ -64,7 +64,7 @@ void test_odb_backend_simple__read_of_nonexisting_object_fails(void)
setup_backend(objs);
- cl_git_pass(git_oid_fromstr(&_oid, "f6ea0495187600e7b2288c8ac19c5886383a4633"));
+ cl_git_pass(git_oid_fromstr(&_oid, "f6ea0495187600e7b2288c8ac19c5886383a4633", GIT_OID_SHA1));
cl_git_fail_with(GIT_ENOTFOUND, git_odb_read(&_obj, _odb, &_oid));
}
@@ -77,7 +77,7 @@ void test_odb_backend_simple__read_with_hash_mismatch_fails(void)
setup_backend(objs);
- cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid));
+ cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid, GIT_OID_SHA1));
cl_git_fail_with(GIT_EMISMATCH, git_odb_read(&_obj, _odb, &_oid));
}
@@ -89,7 +89,7 @@ void test_odb_backend_simple__read_with_hash_mismatch_succeeds_without_verificat
};
setup_backend(objs);
- cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid));
+ cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid, GIT_OID_SHA1));
cl_git_pass(git_libgit2_opts(GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION, 0));
cl_git_pass(git_odb_read(&_obj, _odb, &_oid));
@@ -106,7 +106,7 @@ void test_odb_backend_simple__read_prefix_succeeds(void)
setup_backend(objs);
- cl_git_pass(git_oid_fromstr(&_oid, "f6ea0495187600e7b2288c8ac19c5886383a4632"));
+ cl_git_pass(git_oid_fromstr(&_oid, "f6ea0495187600e7b2288c8ac19c5886383a4632", GIT_OID_SHA1));
cl_git_pass(git_odb_read(&_obj, _odb, &_oid));
assert_object_contains(_obj, objs[0].content);
@@ -122,7 +122,7 @@ void test_odb_backend_simple__read_prefix_of_nonexisting_object_fails(void)
setup_backend(objs);
- cl_git_pass(git_oid_fromstrn(&_oid, hash, strlen(hash)));
+ cl_git_pass(git_oid_fromstrn(&_oid, hash, strlen(hash), GIT_OID_SHA1));
cl_git_fail_with(GIT_ENOTFOUND, git_odb_read(&_obj, _odb, &_oid));
}
@@ -136,7 +136,7 @@ void test_odb_backend_simple__read_with_ambiguous_prefix_fails(void)
setup_backend(objs);
- cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid));
+ cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid, GIT_OID_SHA1));
cl_git_fail_with(GIT_EAMBIGUOUS, git_odb_read_prefix(&_obj, _odb, &_oid, 7));
}
@@ -150,7 +150,7 @@ void test_odb_backend_simple__read_with_highly_ambiguous_prefix(void)
setup_backend(objs);
- cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid));
+ cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid, GIT_OID_SHA1));
cl_git_pass(git_libgit2_opts(GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION, 0));
cl_git_fail_with(GIT_EAMBIGUOUS, git_odb_read_prefix(&_obj, _odb, &_oid, 39));
cl_git_pass(git_odb_read_prefix(&_obj, _odb, &_oid, 40));
@@ -166,7 +166,7 @@ void test_odb_backend_simple__exists_succeeds(void)
setup_backend(objs);
- cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid));
+ cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid, GIT_OID_SHA1));
cl_assert(git_odb_exists(_odb, &_oid));
}
@@ -179,7 +179,7 @@ void test_odb_backend_simple__exists_fails_for_nonexisting_object(void)
setup_backend(objs);
- cl_git_pass(git_oid_fromstr(&_oid, "f6ea0495187600e7b2288c8ac19c5886383a4633"));
+ cl_git_pass(git_oid_fromstr(&_oid, "f6ea0495187600e7b2288c8ac19c5886383a4633", GIT_OID_SHA1));
cl_assert(git_odb_exists(_odb, &_oid) == 0);
}
@@ -194,7 +194,7 @@ void test_odb_backend_simple__exists_prefix_succeeds(void)
setup_backend(objs);
- cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid));
+ cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid, GIT_OID_SHA1));
cl_git_pass(git_odb_exists_prefix(&found, _odb, &_oid, 12));
cl_assert(git_oid_equal(&found, &_oid));
}
@@ -209,7 +209,7 @@ void test_odb_backend_simple__exists_with_ambiguous_prefix_fails(void)
setup_backend(objs);
- cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid));
+ cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid, GIT_OID_SHA1));
cl_git_fail_with(GIT_EAMBIGUOUS, git_odb_exists_prefix(NULL, _odb, &_oid, 7));
}
@@ -224,7 +224,7 @@ void test_odb_backend_simple__exists_with_highly_ambiguous_prefix(void)
setup_backend(objs);
- cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid));
+ cl_git_pass(git_oid_fromstr(&_oid, objs[0].oid, GIT_OID_SHA1));
cl_git_pass(git_libgit2_opts(GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION, 0));
cl_git_fail_with(GIT_EAMBIGUOUS, git_odb_exists_prefix(&found, _odb, &_oid, 39));
cl_git_pass(git_odb_exists_prefix(&found, _odb, &_oid, 40));
diff --git a/tests/libgit2/odb/emptyobjects.c b/tests/libgit2/odb/emptyobjects.c
index e3ec62d..cc28793 100644
--- a/tests/libgit2/odb/emptyobjects.c
+++ b/tests/libgit2/odb/emptyobjects.c
@@ -24,7 +24,7 @@ void test_odb_emptyobjects__blob_notfound(void)
git_oid id, written_id;
git_blob *blob;
- cl_git_pass(git_oid_fromstr(&id, "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"));
+ cl_git_pass(git_oid_fromstr(&id, "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", GIT_OID_SHA1));
cl_git_fail_with(GIT_ENOTFOUND, git_blob_lookup(&blob, g_repo, &id));
cl_git_pass(git_odb_write(&written_id, g_odb, "", 0, GIT_OBJECT_BLOB));
@@ -36,7 +36,7 @@ void test_odb_emptyobjects__read_tree(void)
git_oid id;
git_tree *tree;
- cl_git_pass(git_oid_fromstr(&id, "4b825dc642cb6eb9a060e54bf8d69288fbee4904"));
+ cl_git_pass(git_oid_fromstr(&id, "4b825dc642cb6eb9a060e54bf8d69288fbee4904", GIT_OID_SHA1));
cl_git_pass(git_tree_lookup(&tree, g_repo, &id));
cl_assert_equal_i(GIT_OBJECT_TREE, git_object_type((git_object *) tree));
cl_assert_equal_i(0, git_tree_entrycount(tree));
@@ -49,7 +49,7 @@ void test_odb_emptyobjects__read_tree_odb(void)
git_oid id;
git_odb_object *tree_odb;
- cl_git_pass(git_oid_fromstr(&id, "4b825dc642cb6eb9a060e54bf8d69288fbee4904"));
+ cl_git_pass(git_oid_fromstr(&id, "4b825dc642cb6eb9a060e54bf8d69288fbee4904", GIT_OID_SHA1));
cl_git_pass(git_odb_read(&tree_odb, g_odb, &id));
cl_assert(git_odb_object_data(tree_odb));
cl_assert_equal_s("", git_odb_object_data(tree_odb));
diff --git a/tests/libgit2/odb/freshen.c b/tests/libgit2/odb/freshen.c
index 2396e37..ceacede 100644
--- a/tests/libgit2/odb/freshen.c
+++ b/tests/libgit2/odb/freshen.c
@@ -43,7 +43,7 @@ void test_odb_freshen__loose_blob(void)
git_oid expected_id, id;
struct stat before, after;
- cl_git_pass(git_oid_fromstr(&expected_id, LOOSE_BLOB_ID));
+ cl_git_pass(git_oid_fromstr(&expected_id, LOOSE_BLOB_ID, GIT_OID_SHA1));
set_time_wayback(&before, LOOSE_BLOB_FN);
/* make sure we freshen a blob */
@@ -64,7 +64,7 @@ void test_odb_freshen__readonly_object(void)
git_oid expected_id, id;
struct stat before, after;
- cl_git_pass(git_oid_fromstr(&expected_id, UNIQUE_BLOB_ID));
+ cl_git_pass(git_oid_fromstr(&expected_id, UNIQUE_BLOB_ID, GIT_OID_SHA1));
cl_git_pass(git_blob_create_from_buffer(&id, repo, UNIQUE_STR, CONST_STRLEN(UNIQUE_STR)));
cl_assert_equal_oid(&expected_id, &id);
@@ -89,7 +89,7 @@ void test_odb_freshen__loose_tree(void)
git_tree *tree;
struct stat before, after;
- cl_git_pass(git_oid_fromstr(&expected_id, LOOSE_TREE_ID));
+ cl_git_pass(git_oid_fromstr(&expected_id, LOOSE_TREE_ID, GIT_OID_SHA1));
set_time_wayback(&before, LOOSE_TREE_FN);
cl_git_pass(git_tree_lookup(&tree, repo, &expected_id));
@@ -113,11 +113,11 @@ void test_odb_freshen__tree_during_commit(void)
git_signature *signature;
struct stat before, after;
- cl_git_pass(git_oid_fromstr(&tree_id, LOOSE_TREE_ID));
+ cl_git_pass(git_oid_fromstr(&tree_id, LOOSE_TREE_ID, GIT_OID_SHA1));
cl_git_pass(git_tree_lookup(&tree, repo, &tree_id));
set_time_wayback(&before, LOOSE_TREE_FN);
- cl_git_pass(git_oid_fromstr(&parent_id, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750"));
+ cl_git_pass(git_oid_fromstr(&parent_id, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", GIT_OID_SHA1));
cl_git_pass(git_commit_lookup(&parent, repo, &parent_id));
cl_git_pass(git_signature_new(&signature,
@@ -147,7 +147,7 @@ void test_odb_freshen__packed_object(void)
struct stat before, after;
struct p_timeval old_times[2];
- cl_git_pass(git_oid_fromstr(&expected_id, PACKED_ID));
+ cl_git_pass(git_oid_fromstr(&expected_id, PACKED_ID, GIT_OID_SHA1));
old_times[0].tv_sec = 1234567890;
old_times[0].tv_usec = 0;
diff --git a/tests/libgit2/odb/largefiles.c b/tests/libgit2/odb/largefiles.c
index acc786e..0ecbd6f 100644
--- a/tests/libgit2/odb/largefiles.c
+++ b/tests/libgit2/odb/largefiles.c
@@ -57,7 +57,7 @@ void test_odb_largefiles__write_from_memory(void)
for (i = 0; i < (3041*126103); i++)
cl_git_pass(git_str_puts(&buf, "Hello, world.\n"));
- git_oid_fromstr(&expected, "3fb56989cca483b21ba7cb0a6edb229d10e1c26c");
+ git_oid_fromstr(&expected, "3fb56989cca483b21ba7cb0a6edb229d10e1c26c", GIT_OID_SHA1);
cl_git_pass(git_odb_write(&oid, odb, buf.ptr, buf.size, GIT_OBJECT_BLOB));
cl_assert_equal_oid(&expected, &oid);
@@ -75,7 +75,7 @@ void test_odb_largefiles__streamwrite(void)
!cl_is_env_set("GITTEST_SLOW"))
cl_skip();
- git_oid_fromstr(&expected, "3fb56989cca483b21ba7cb0a6edb229d10e1c26c");
+ git_oid_fromstr(&expected, "3fb56989cca483b21ba7cb0a6edb229d10e1c26c", GIT_OID_SHA1);
writefile(&oid);
cl_assert_equal_oid(&expected, &oid);
diff --git a/tests/libgit2/odb/loose.c b/tests/libgit2/odb/loose.c
index fe013a7..7fea9a6 100644
--- a/tests/libgit2/odb/loose.c
+++ b/tests/libgit2/odb/loose.c
@@ -42,7 +42,7 @@ static void test_read_object(object_data *data)
write_object_files(data);
cl_git_pass(git_odb_open(&odb, "test-objects"));
- cl_git_pass(git_oid_fromstr(&id, data->id));
+ cl_git_pass(git_oid_fromstr(&id, data->id, GIT_OID_SHA1));
cl_git_pass(git_odb_read(&obj, odb, &id));
tmp.data = obj->buffer;
@@ -65,7 +65,7 @@ static void test_read_header(object_data *data)
write_object_files(data);
cl_git_pass(git_odb_open(&odb, "test-objects"));
- cl_git_pass(git_oid_fromstr(&id, data->id));
+ cl_git_pass(git_oid_fromstr(&id, data->id, GIT_OID_SHA1));
cl_git_pass(git_odb_read_header(&len, &type, odb, &id));
cl_assert_equal_sz(data->dlen, len);
@@ -87,7 +87,7 @@ static void test_readstream_object(object_data *data, size_t blocksize)
write_object_files(data);
cl_git_pass(git_odb_open(&odb, "test-objects"));
- cl_git_pass(git_oid_fromstr(&id, data->id));
+ cl_git_pass(git_oid_fromstr(&id, data->id, GIT_OID_SHA1));
cl_git_pass(git_odb_open_rstream(&stream, &tmp.len, &tmp.type, odb, &id));
remain = tmp.len;
@@ -132,18 +132,18 @@ void test_odb_loose__exists(void)
write_object_files(&one);
cl_git_pass(git_odb_open(&odb, "test-objects"));
- cl_git_pass(git_oid_fromstr(&id, one.id));
+ cl_git_pass(git_oid_fromstr(&id, one.id, GIT_OID_SHA1));
cl_assert(git_odb_exists(odb, &id));
- cl_git_pass(git_oid_fromstrp(&id, "8b137891"));
+ cl_git_pass(git_oid_fromstrp(&id, "8b137891", GIT_OID_SHA1));
cl_git_pass(git_odb_exists_prefix(&id2, odb, &id, 8));
cl_assert_equal_i(0, git_oid_streq(&id2, one.id));
/* Test for a missing object */
- cl_git_pass(git_oid_fromstr(&id, "8b137891791fe96927ad78e64b0aad7bded08baa"));
+ cl_git_pass(git_oid_fromstr(&id, "8b137891791fe96927ad78e64b0aad7bded08baa", GIT_OID_SHA1));
cl_assert(!git_odb_exists(odb, &id));
- cl_git_pass(git_oid_fromstrp(&id, "8b13789a"));
+ cl_git_pass(git_oid_fromstrp(&id, "8b13789a", GIT_OID_SHA1));
cl_assert_equal_i(GIT_ENOTFOUND, git_odb_exists_prefix(&id2, odb, &id, 8));
git_odb_free(odb);
diff --git a/tests/libgit2/odb/mixed.c b/tests/libgit2/odb/mixed.c
index 70eda82..e9869fe 100644
--- a/tests/libgit2/odb/mixed.c
+++ b/tests/libgit2/odb/mixed.c
@@ -20,13 +20,13 @@ void test_odb_mixed__dup_oid(void) {
git_oid oid;
git_odb_object *obj;
- cl_git_pass(git_oid_fromstr(&oid, hex));
+ cl_git_pass(git_oid_fromstr(&oid, hex, GIT_OID_SHA1));
cl_git_pass(git_odb_read_prefix(&obj, _odb, &oid, GIT_OID_SHA1_HEXSIZE));
git_odb_object_free(obj);
cl_git_pass(git_odb_exists_prefix(NULL, _odb, &oid, GIT_OID_SHA1_HEXSIZE));
- cl_git_pass(git_oid_fromstrn(&oid, short_hex, sizeof(short_hex) - 1));
+ cl_git_pass(git_oid_fromstrn(&oid, short_hex, sizeof(short_hex) - 1, GIT_OID_SHA1));
cl_git_pass(git_odb_read_prefix(&obj, _odb, &oid, sizeof(short_hex) - 1));
git_odb_object_free(obj);
@@ -48,63 +48,63 @@ void test_odb_mixed__dup_oid_prefix_0(void) {
/* ambiguous in the same pack file */
strncpy(hex, "dea509d0", sizeof(hex));
- cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex)));
+ cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex), GIT_OID_SHA1));
cl_assert_equal_i(
GIT_EAMBIGUOUS, git_odb_read_prefix(&obj, _odb, &oid, strlen(hex)));
cl_assert_equal_i(
GIT_EAMBIGUOUS, git_odb_exists_prefix(&found, _odb, &oid, strlen(hex)));
strncpy(hex, "dea509d09", sizeof(hex));
- cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex)));
+ cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex), GIT_OID_SHA1));
cl_git_pass(git_odb_read_prefix(&obj, _odb, &oid, strlen(hex)));
cl_git_pass(git_odb_exists_prefix(&found, _odb, &oid, strlen(hex)));
cl_assert_equal_oid(&found, git_odb_object_id(obj));
git_odb_object_free(obj);
strncpy(hex, "dea509d0b", sizeof(hex));
- cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex)));
+ cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex), GIT_OID_SHA1));
cl_git_pass(git_odb_read_prefix(&obj, _odb, &oid, strlen(hex)));
git_odb_object_free(obj);
/* ambiguous in different pack files */
strncpy(hex, "81b5bff5", sizeof(hex));
- cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex)));
+ cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex), GIT_OID_SHA1));
cl_assert_equal_i(
GIT_EAMBIGUOUS, git_odb_read_prefix(&obj, _odb, &oid, strlen(hex)));
cl_assert_equal_i(
GIT_EAMBIGUOUS, git_odb_exists_prefix(&found, _odb, &oid, strlen(hex)));
strncpy(hex, "81b5bff5b", sizeof(hex));
- cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex)));
+ cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex), GIT_OID_SHA1));
cl_git_pass(git_odb_read_prefix(&obj, _odb, &oid, strlen(hex)));
cl_git_pass(git_odb_exists_prefix(&found, _odb, &oid, strlen(hex)));
cl_assert_equal_oid(&found, git_odb_object_id(obj));
git_odb_object_free(obj);
strncpy(hex, "81b5bff5f", sizeof(hex));
- cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex)));
+ cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex), GIT_OID_SHA1));
cl_git_pass(git_odb_read_prefix(&obj, _odb, &oid, strlen(hex)));
git_odb_object_free(obj);
/* ambiguous in pack file and loose */
strncpy(hex, "0ddeaded", sizeof(hex));
- cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex)));
+ cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex), GIT_OID_SHA1));
cl_assert_equal_i(
GIT_EAMBIGUOUS, git_odb_read_prefix(&obj, _odb, &oid, strlen(hex)));
cl_assert_equal_i(
GIT_EAMBIGUOUS, git_odb_exists_prefix(&found, _odb, &oid, strlen(hex)));
strncpy(hex, "0ddeaded9", sizeof(hex));
- cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex)));
+ cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex), GIT_OID_SHA1));
cl_git_pass(git_odb_read_prefix(&obj, _odb, &oid, strlen(hex)));
cl_git_pass(git_odb_exists_prefix(&found, _odb, &oid, strlen(hex)));
cl_assert_equal_oid(&found, git_odb_object_id(obj));
git_odb_object_free(obj);
strncpy(hex, "0ddeadede", sizeof(hex));
- cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex)));
+ cl_git_pass(git_oid_fromstrn(&oid, hex, strlen(hex), GIT_OID_SHA1));
cl_git_pass(git_odb_read_prefix(&obj, _odb, &oid, strlen(hex)));
git_odb_object_free(obj);
}
@@ -170,7 +170,7 @@ static void setup_prefix_query(
size_t len = strlen(expand_id_test_data[i].lookup_id);
- git_oid_fromstrn(&id->id, expand_id_test_data[i].lookup_id, len);
+ git_oid_fromstrn(&id->id, expand_id_test_data[i].lookup_id, len, GIT_OID_SHA1);
id->length = (unsigned short)len;
id->type = expand_id_test_data[i].expected_type;
}
@@ -191,7 +191,7 @@ static void assert_found_objects(git_odb_expand_id *ids)
git_object_t expected_type = 0;
if (expand_id_test_data[i].expected_id) {
- git_oid_fromstr(&expected_id, expand_id_test_data[i].expected_id);
+ git_oid_fromstr(&expected_id, expand_id_test_data[i].expected_id, GIT_OID_SHA1);
expected_len = GIT_OID_SHA1_HEXSIZE;
expected_type = expand_id_test_data[i].expected_type;
}
diff --git a/tests/libgit2/odb/packed.c b/tests/libgit2/odb/packed.c
index 3d502ed..2f5a8a2 100644
--- a/tests/libgit2/odb/packed.c
+++ b/tests/libgit2/odb/packed.c
@@ -23,7 +23,7 @@ void test_odb_packed__mass_read(void)
git_oid id;
git_odb_object *obj;
- cl_git_pass(git_oid_fromstr(&id, packed_objects[i]));
+ cl_git_pass(git_oid_fromstr(&id, packed_objects[i], GIT_OID_SHA1));
cl_assert(git_odb_exists(_odb, &id) == 1);
cl_git_pass(git_odb_read(&obj, _odb, &id));
@@ -41,7 +41,7 @@ void test_odb_packed__read_header_0(void)
size_t len;
git_object_t type;
- cl_git_pass(git_oid_fromstr(&id, packed_objects[i]));
+ cl_git_pass(git_oid_fromstr(&id, packed_objects[i], GIT_OID_SHA1));
cl_git_pass(git_odb_read(&obj, _odb, &id));
cl_git_pass(git_odb_read_header(&len, &type, _odb, &id));
@@ -63,7 +63,7 @@ void test_odb_packed__read_header_1(void)
size_t len;
git_object_t type;
- cl_git_pass(git_oid_fromstr(&id, loose_objects[i]));
+ cl_git_pass(git_oid_fromstr(&id, loose_objects[i], GIT_OID_SHA1));
cl_assert(git_odb_exists(_odb, &id) == 1);
diff --git a/tests/libgit2/odb/packed_one.c b/tests/libgit2/odb/packed_one.c
index 17cd4f7..a708839 100644
--- a/tests/libgit2/odb/packed_one.c
+++ b/tests/libgit2/odb/packed_one.c
@@ -29,7 +29,7 @@ void test_odb_packed_one__mass_read(void)
git_oid id;
git_odb_object *obj;
- cl_git_pass(git_oid_fromstr(&id, packed_objects_one[i]));
+ cl_git_pass(git_oid_fromstr(&id, packed_objects_one[i], GIT_OID_SHA1));
cl_assert(git_odb_exists(_odb, &id) == 1);
cl_git_pass(git_odb_read(&obj, _odb, &id));
@@ -47,7 +47,7 @@ void test_odb_packed_one__read_header_0(void)
size_t len;
git_object_t type;
- cl_git_pass(git_oid_fromstr(&id, packed_objects_one[i]));
+ cl_git_pass(git_oid_fromstr(&id, packed_objects_one[i], GIT_OID_SHA1));
cl_git_pass(git_odb_read(&obj, _odb, &id));
cl_git_pass(git_odb_read_header(&len, &type, _odb, &id));
diff --git a/tests/libgit2/online/clone.c b/tests/libgit2/online/clone.c
index a9e98df..507bace 100644
--- a/tests/libgit2/online/clone.c
+++ b/tests/libgit2/online/clone.c
@@ -636,7 +636,7 @@ static int ssh_certificate_check(git_cert *cert, int valid, const char *host, vo
cl_assert(_remote_ssh_fingerprint);
- cl_git_pass(git_oid_fromstrp(&expected, _remote_ssh_fingerprint));
+ cl_git_pass(git_oid_fromstrp(&expected, _remote_ssh_fingerprint, GIT_OID_SHA1));
cl_assert_equal_i(GIT_CERT_HOSTKEY_LIBSSH2, cert->cert_type);
key = (git_cert_hostkey *) cert;
diff --git a/tests/libgit2/online/fetch.c b/tests/libgit2/online/fetch.c
index 5beb5b6..f2c1765 100644
--- a/tests/libgit2/online/fetch.c
+++ b/tests/libgit2/online/fetch.c
@@ -304,7 +304,7 @@ void test_online_fetch__reachable_commit(void)
refspecs.strings = &refspec;
refspecs.count = 1;
- git_oid_fromstr(&expected_id, "2c349335b7f797072cf729c4f3bb0914ecb6dec9");
+ git_oid_fromstr(&expected_id, "2c349335b7f797072cf729c4f3bb0914ecb6dec9", GIT_OID_SHA1);
cl_git_pass(git_remote_create(&remote, _repo, "test",
"https://github.com/libgit2/TestGitRepository"));
@@ -334,7 +334,7 @@ void test_online_fetch__reachable_commit_without_destination(void)
refspecs.strings = &refspec;
refspecs.count = 1;
- git_oid_fromstr(&expected_id, "2c349335b7f797072cf729c4f3bb0914ecb6dec9");
+ git_oid_fromstr(&expected_id, "2c349335b7f797072cf729c4f3bb0914ecb6dec9", GIT_OID_SHA1);
cl_git_pass(git_remote_create(&remote, _repo, "test",
"https://github.com/libgit2/TestGitRepository"));
diff --git a/tests/libgit2/online/push.c b/tests/libgit2/online/push.c
index 51adc39..d926a4a 100644
--- a/tests/libgit2/online/push.c
+++ b/tests/libgit2/online/push.c
@@ -344,18 +344,18 @@ void test_online_push__initialize(void)
* * a78705c3b2725f931d3ee05348d83cc26700f247 (b2, b1) added fold and fold/b.txt
* * 5c0bb3d1b9449d1cc69d7519fd05166f01840915 added a.txt
*/
- git_oid_fromstr(&_oid_b6, "951bbbb90e2259a4c8950db78946784fb53fcbce");
- git_oid_fromstr(&_oid_b5, "fa38b91f199934685819bea316186d8b008c52a2");
- git_oid_fromstr(&_oid_b4, "27b7ce66243eb1403862d05f958c002312df173d");
- git_oid_fromstr(&_oid_b3, "d9b63a88223d8367516f50bd131a5f7349b7f3e4");
- git_oid_fromstr(&_oid_b2, "a78705c3b2725f931d3ee05348d83cc26700f247");
- git_oid_fromstr(&_oid_b1, "a78705c3b2725f931d3ee05348d83cc26700f247");
-
- git_oid_fromstr(&_tag_commit, "805c54522e614f29f70d2413a0470247d8b424ac");
- git_oid_fromstr(&_tag_tree, "ff83aa4c5e5d28e3bcba2f5c6e2adc61286a4e5e");
- git_oid_fromstr(&_tag_blob, "b483ae7ba66decee9aee971f501221dea84b1498");
- git_oid_fromstr(&_tag_lightweight, "951bbbb90e2259a4c8950db78946784fb53fcbce");
- git_oid_fromstr(&_tag_tag, "eea4f2705eeec2db3813f2430829afce99cd00b5");
+ git_oid_fromstr(&_oid_b6, "951bbbb90e2259a4c8950db78946784fb53fcbce", GIT_OID_SHA1);
+ git_oid_fromstr(&_oid_b5, "fa38b91f199934685819bea316186d8b008c52a2", GIT_OID_SHA1);
+ git_oid_fromstr(&_oid_b4, "27b7ce66243eb1403862d05f958c002312df173d", GIT_OID_SHA1);
+ git_oid_fromstr(&_oid_b3, "d9b63a88223d8367516f50bd131a5f7349b7f3e4", GIT_OID_SHA1);
+ git_oid_fromstr(&_oid_b2, "a78705c3b2725f931d3ee05348d83cc26700f247", GIT_OID_SHA1);
+ git_oid_fromstr(&_oid_b1, "a78705c3b2725f931d3ee05348d83cc26700f247", GIT_OID_SHA1);
+
+ git_oid_fromstr(&_tag_commit, "805c54522e614f29f70d2413a0470247d8b424ac", GIT_OID_SHA1);
+ git_oid_fromstr(&_tag_tree, "ff83aa4c5e5d28e3bcba2f5c6e2adc61286a4e5e", GIT_OID_SHA1);
+ git_oid_fromstr(&_tag_blob, "b483ae7ba66decee9aee971f501221dea84b1498", GIT_OID_SHA1);
+ git_oid_fromstr(&_tag_lightweight, "951bbbb90e2259a4c8950db78946784fb53fcbce", GIT_OID_SHA1);
+ git_oid_fromstr(&_tag_tag, "eea4f2705eeec2db3813f2430829afce99cd00b5", GIT_OID_SHA1);
/* Remote URL environment variable must be set. User and password are optional. */
@@ -859,7 +859,7 @@ void test_online_push__notes(void)
expected_ref exp_refs[] = { { "refs/notes/commits", &expected_oid } };
const char *specs_del[] = { ":refs/notes/commits" };
- git_oid_fromstr(&expected_oid, "8461a99b27b7043e58ff6e1f5d2cf07d282534fb");
+ git_oid_fromstr(&expected_oid, "8461a99b27b7043e58ff6e1f5d2cf07d282534fb", GIT_OID_SHA1);
target_oid = &_oid_b6;
@@ -890,7 +890,7 @@ void test_online_push__configured(void)
expected_ref exp_refs[] = { { "refs/notes/commits", &expected_oid } };
const char *specs_del[] = { ":refs/notes/commits" };
- git_oid_fromstr(&expected_oid, "8461a99b27b7043e58ff6e1f5d2cf07d282534fb");
+ git_oid_fromstr(&expected_oid, "8461a99b27b7043e58ff6e1f5d2cf07d282534fb", GIT_OID_SHA1);
target_oid = &_oid_b6;
diff --git a/tests/libgit2/pack/indexer.c b/tests/libgit2/pack/indexer.c
index ec48ffd..b531b2b 100644
--- a/tests/libgit2/pack/indexer.c
+++ b/tests/libgit2/pack/indexer.c
@@ -157,7 +157,7 @@ void test_pack_indexer__fix_thin(void)
/* Store the missing base into your ODB so the indexer can fix the pack */
cl_git_pass(git_odb_write(&id, odb, base_obj, base_obj_len, GIT_OBJECT_BLOB));
- git_oid_fromstr(&should_id, "e68fe8129b546b101aee9510c5328e7f21ca1d18");
+ git_oid_fromstr(&should_id, "e68fe8129b546b101aee9510c5328e7f21ca1d18", GIT_OID_SHA1);
cl_assert_equal_oid(&should_id, &id);
cl_git_pass(git_indexer_new(&idx, ".", 0, odb, NULL));
@@ -222,7 +222,7 @@ void test_pack_indexer__corrupt_length(void)
/* Store the missing base into your ODB so the indexer can fix the pack */
cl_git_pass(git_odb_write(&id, odb, base_obj, base_obj_len, GIT_OBJECT_BLOB));
- git_oid_fromstr(&should_id, "e68fe8129b546b101aee9510c5328e7f21ca1d18");
+ git_oid_fromstr(&should_id, "e68fe8129b546b101aee9510c5328e7f21ca1d18", GIT_OID_SHA1);
cl_assert_equal_oid(&should_id, &id);
cl_git_pass(git_indexer_new(&idx, ".", 0, odb, NULL));
diff --git a/tests/libgit2/pack/midx.c b/tests/libgit2/pack/midx.c
index 2a5c5a3..4bee16e 100644
--- a/tests/libgit2/pack/midx.c
+++ b/tests/libgit2/pack/midx.c
@@ -19,7 +19,7 @@ void test_pack_midx__parse(void)
cl_git_pass(git_midx_open(&idx, git_str_cstr(&midx_path)));
cl_assert_equal_i(git_midx_needs_refresh(idx, git_str_cstr(&midx_path)), 0);
- cl_git_pass(git_oid_fromstr(&id, "5001298e0c09ad9c34e4249bc5801c75e9754fa5"));
+ cl_git_pass(git_oid_fromstr(&id, "5001298e0c09ad9c34e4249bc5801c75e9754fa5", GIT_OID_SHA1));
cl_git_pass(git_midx_entry_find(&e, idx, &id, GIT_OID_SHA1_HEXSIZE));
cl_assert_equal_oid(&e.sha1, &id);
cl_assert_equal_s(
@@ -39,7 +39,7 @@ void test_pack_midx__lookup(void)
cl_git_pass(git_repository_open(&repo, cl_fixture("testrepo.git")));
- cl_git_pass(git_oid_fromstr(&id, "5001298e0c09ad9c34e4249bc5801c75e9754fa5"));
+ cl_git_pass(git_oid_fromstr(&id, "5001298e0c09ad9c34e4249bc5801c75e9754fa5", GIT_OID_SHA1));
cl_git_pass(git_commit_lookup_prefix(&commit, repo, &id, GIT_OID_SHA1_HEXSIZE));
cl_assert_equal_s(git_commit_message(commit), "packed commit one\n");
diff --git a/tests/libgit2/pack/sharing.c b/tests/libgit2/pack/sharing.c
index eaf7686..2549506 100644
--- a/tests/libgit2/pack/sharing.c
+++ b/tests/libgit2/pack/sharing.c
@@ -18,7 +18,7 @@ void test_pack_sharing__open_two_repos(void)
cl_git_pass(git_repository_open(&repo1, cl_fixture("testrepo.git")));
cl_git_pass(git_repository_open(&repo2, cl_fixture("testrepo.git")));
- git_oid_fromstr(&id, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750");
+ git_oid_fromstr(&id, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", GIT_OID_SHA1);
cl_git_pass(git_object_lookup(&obj1, repo1, &id, GIT_OBJECT_ANY));
cl_git_pass(git_object_lookup(&obj2, repo2, &id, GIT_OBJECT_ANY));
diff --git a/tests/libgit2/perf/helper__perf__do_merge.c b/tests/libgit2/perf/helper__perf__do_merge.c
index c77b46a..bd34efc 100644
--- a/tests/libgit2/perf/helper__perf__do_merge.c
+++ b/tests/libgit2/perf/helper__perf__do_merge.c
@@ -33,7 +33,7 @@ void perf__do_merge(const char *fixture,
cl_git_pass(git_clone(&g_repo, fixture, test_name, &clone_opts));
perf__timer__stop(&t_clone);
- git_oid_fromstr(&oid_a, id_a);
+ git_oid_fromstr(&oid_a, id_a, GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit_a, g_repo, &oid_a));
cl_git_pass(git_branch_create(&ref_branch_a, g_repo,
"A", commit_a,
@@ -45,7 +45,7 @@ void perf__do_merge(const char *fixture,
cl_git_pass(git_repository_set_head(g_repo, git_reference_name(ref_branch_a)));
- git_oid_fromstr(&oid_b, id_b);
+ git_oid_fromstr(&oid_b, id_b, GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit_b, g_repo, &oid_b));
cl_git_pass(git_branch_create(&ref_branch_b, g_repo,
"B", commit_b,
diff --git a/tests/libgit2/rebase/abort.c b/tests/libgit2/rebase/abort.c
index a83c529..34dd419 100644
--- a/tests/libgit2/rebase/abort.c
+++ b/tests/libgit2/rebase/abort.c
@@ -128,8 +128,8 @@ void test_rebase_abort__merge_by_id(void)
git_oid branch_id, onto_id;
git_annotated_commit *branch_head, *onto_head;
- cl_git_pass(git_oid_fromstr(&branch_id, "b146bd7608eac53d9bf9e1a6963543588b555c64"));
- cl_git_pass(git_oid_fromstr(&onto_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00"));
+ cl_git_pass(git_oid_fromstr(&branch_id, "b146bd7608eac53d9bf9e1a6963543588b555c64", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&onto_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00", GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&branch_head, repo, &branch_id));
cl_git_pass(git_annotated_commit_lookup(&onto_head, repo, &onto_id));
@@ -170,8 +170,8 @@ void test_rebase_abort__merge_by_id_immediately_after_init(void)
git_oid branch_id, onto_id;
git_annotated_commit *branch_head, *onto_head;
- cl_git_pass(git_oid_fromstr(&branch_id, "b146bd7608eac53d9bf9e1a6963543588b555c64"));
- cl_git_pass(git_oid_fromstr(&onto_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00"));
+ cl_git_pass(git_oid_fromstr(&branch_id, "b146bd7608eac53d9bf9e1a6963543588b555c64", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&onto_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00", GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&branch_head, repo, &branch_id));
cl_git_pass(git_annotated_commit_lookup(&onto_head, repo, &onto_id));
@@ -195,8 +195,8 @@ void test_rebase_abort__detached_head(void)
git_signature *signature;
git_annotated_commit *branch_head, *onto_head;
- git_oid_fromstr(&branch_id, "b146bd7608eac53d9bf9e1a6963543588b555c64");
- git_oid_fromstr(&onto_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00");
+ git_oid_fromstr(&branch_id, "b146bd7608eac53d9bf9e1a6963543588b555c64", GIT_OID_SHA1);
+ git_oid_fromstr(&onto_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00", GIT_OID_SHA1);
cl_git_pass(git_annotated_commit_lookup(&branch_head, repo, &branch_id));
cl_git_pass(git_annotated_commit_lookup(&onto_head, repo, &onto_id));
diff --git a/tests/libgit2/rebase/inmemory.c b/tests/libgit2/rebase/inmemory.c
index 040a81b..89b81b6 100644
--- a/tests/libgit2/rebase/inmemory.c
+++ b/tests/libgit2/rebase/inmemory.c
@@ -74,7 +74,7 @@ void test_rebase_inmemory__can_resolve_conflicts(void)
cl_git_pass(git_rebase_next(&rebase_operation, rebase));
- git_oid_fromstr(&pick_id, "33f915f9e4dbd9f4b24430e48731a59b45b15500");
+ git_oid_fromstr(&pick_id, "33f915f9e4dbd9f4b24430e48731a59b45b15500", GIT_OID_SHA1);
cl_assert_equal_i(GIT_REBASE_OPERATION_PICK, rebase_operation->type);
cl_assert_equal_oid(&pick_id, &rebase_operation->id);
@@ -95,14 +95,14 @@ void test_rebase_inmemory__can_resolve_conflicts(void)
/* ensure that we can work with the in-memory index to resolve the conflict */
resolution.path = "asparagus.txt";
resolution.mode = GIT_FILEMODE_BLOB;
- git_oid_fromstr(&resolution.id, "414dfc71ead79c07acd4ea47fecf91f289afc4b9");
+ git_oid_fromstr(&resolution.id, "414dfc71ead79c07acd4ea47fecf91f289afc4b9", GIT_OID_SHA1);
cl_git_pass(git_index_conflict_remove(rebase_index, "asparagus.txt"));
cl_git_pass(git_index_add(rebase_index, &resolution));
/* and finally create a commit for the resolved rebase operation */
cl_git_pass(git_rebase_commit(&commit_id, rebase, NULL, signature, NULL, NULL));
- cl_git_pass(git_oid_fromstr(&expected_commit_id, "db7af47222181e548810da2ab5fec0e9357c5637"));
+ cl_git_pass(git_oid_fromstr(&expected_commit_id, "db7af47222181e548810da2ab5fec0e9357c5637", GIT_OID_SHA1));
cl_assert_equal_oid(&commit_id, &expected_commit_id);
git_status_list_free(status_list);
@@ -156,7 +156,7 @@ void test_rebase_inmemory__no_common_ancestor(void)
cl_git_pass(git_rebase_finish(rebase, signature));
- git_oid_fromstr(&expected_final_id, "71e7ee8d4fe7d8bf0d107355197e0a953dfdb7f3");
+ git_oid_fromstr(&expected_final_id, "71e7ee8d4fe7d8bf0d107355197e0a953dfdb7f3", GIT_OID_SHA1);
cl_assert_equal_oid(&expected_final_id, &commit_id);
git_annotated_commit_free(branch_head);
@@ -178,7 +178,7 @@ void test_rebase_inmemory__with_directories(void)
opts.inmemory = true;
- git_oid_fromstr(&tree_id, "a4d6d9c3d57308fd8e320cf2525bae8f1adafa57");
+ git_oid_fromstr(&tree_id, "a4d6d9c3d57308fd8e320cf2525bae8f1adafa57", GIT_OID_SHA1);
cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/deep_gravy"));
cl_git_pass(git_reference_lookup(&upstream_ref, repo, "refs/heads/veal"));
diff --git a/tests/libgit2/rebase/iterator.c b/tests/libgit2/rebase/iterator.c
index a120f28..ab5b067 100644
--- a/tests/libgit2/rebase/iterator.c
+++ b/tests/libgit2/rebase/iterator.c
@@ -30,11 +30,11 @@ static void test_operations(git_rebase *rebase, size_t expected_current)
git_oid expected_oid[5];
git_rebase_operation *operation;
- git_oid_fromstr(&expected_oid[0], "da9c51a23d02d931a486f45ad18cda05cf5d2b94");
- git_oid_fromstr(&expected_oid[1], "8d1f13f93c4995760ac07d129246ac1ff64c0be9");
- git_oid_fromstr(&expected_oid[2], "3069cc907e6294623e5917ef6de663928c1febfb");
- git_oid_fromstr(&expected_oid[3], "588e5d2f04d49707fe4aab865e1deacaf7ef6787");
- git_oid_fromstr(&expected_oid[4], "b146bd7608eac53d9bf9e1a6963543588b555c64");
+ git_oid_fromstr(&expected_oid[0], "da9c51a23d02d931a486f45ad18cda05cf5d2b94", GIT_OID_SHA1);
+ git_oid_fromstr(&expected_oid[1], "8d1f13f93c4995760ac07d129246ac1ff64c0be9", GIT_OID_SHA1);
+ git_oid_fromstr(&expected_oid[2], "3069cc907e6294623e5917ef6de663928c1febfb", GIT_OID_SHA1);
+ git_oid_fromstr(&expected_oid[3], "588e5d2f04d49707fe4aab865e1deacaf7ef6787", GIT_OID_SHA1);
+ git_oid_fromstr(&expected_oid[4], "b146bd7608eac53d9bf9e1a6963543588b555c64", GIT_OID_SHA1);
cl_assert_equal_i(expected_count, git_rebase_operation_entrycount(rebase));
cl_assert_equal_i(expected_current, git_rebase_operation_current(rebase));
@@ -78,7 +78,7 @@ static void test_iterator(bool inmemory)
NULL, NULL));
test_operations(rebase, 0);
- git_oid_fromstr(&expected_id, "776e4c48922799f903f03f5f6e51da8b01e4cce0");
+ git_oid_fromstr(&expected_id, "776e4c48922799f903f03f5f6e51da8b01e4cce0", GIT_OID_SHA1);
cl_assert_equal_oid(&expected_id, &commit_id);
cl_git_pass(git_rebase_next(&rebase_operation, rebase));
@@ -86,7 +86,7 @@ static void test_iterator(bool inmemory)
NULL, NULL));
test_operations(rebase, 1);
- git_oid_fromstr(&expected_id, "ba1f9b4fd5cf8151f7818be2111cc0869f1eb95a");
+ git_oid_fromstr(&expected_id, "ba1f9b4fd5cf8151f7818be2111cc0869f1eb95a", GIT_OID_SHA1);
cl_assert_equal_oid(&expected_id, &commit_id);
cl_git_pass(git_rebase_next(&rebase_operation, rebase));
@@ -94,7 +94,7 @@ static void test_iterator(bool inmemory)
NULL, NULL));
test_operations(rebase, 2);
- git_oid_fromstr(&expected_id, "948b12fe18b84f756223a61bece4c307787cd5d4");
+ git_oid_fromstr(&expected_id, "948b12fe18b84f756223a61bece4c307787cd5d4", GIT_OID_SHA1);
cl_assert_equal_oid(&expected_id, &commit_id);
if (!inmemory) {
@@ -107,7 +107,7 @@ static void test_iterator(bool inmemory)
NULL, NULL));
test_operations(rebase, 3);
- git_oid_fromstr(&expected_id, "d9d5d59d72c9968687f9462578d79878cd80e781");
+ git_oid_fromstr(&expected_id, "d9d5d59d72c9968687f9462578d79878cd80e781", GIT_OID_SHA1);
cl_assert_equal_oid(&expected_id, &commit_id);
cl_git_pass(git_rebase_next(&rebase_operation, rebase));
@@ -115,7 +115,7 @@ static void test_iterator(bool inmemory)
NULL, NULL));
test_operations(rebase, 4);
- git_oid_fromstr(&expected_id, "9cf383c0a125d89e742c5dec58ed277dd07588b3");
+ git_oid_fromstr(&expected_id, "9cf383c0a125d89e742c5dec58ed277dd07588b3", GIT_OID_SHA1);
cl_assert_equal_oid(&expected_id, &commit_id);
cl_git_fail(error = git_rebase_next(&rebase_operation, rebase));
diff --git a/tests/libgit2/rebase/merge.c b/tests/libgit2/rebase/merge.c
index 5f730f7..3717a6c 100644
--- a/tests/libgit2/rebase/merge.c
+++ b/tests/libgit2/rebase/merge.c
@@ -46,8 +46,8 @@ void test_rebase_merge__next(void)
git_oid pick_id, file1_id;
git_oid master_id, beef_id;
- git_oid_fromstr(&master_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00");
- git_oid_fromstr(&beef_id, "b146bd7608eac53d9bf9e1a6963543588b555c64");
+ git_oid_fromstr(&master_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00", GIT_OID_SHA1);
+ git_oid_fromstr(&beef_id, "b146bd7608eac53d9bf9e1a6963543588b555c64", GIT_OID_SHA1);
cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/beef"));
cl_git_pass(git_reference_lookup(&upstream_ref, repo, "refs/heads/master"));
@@ -65,7 +65,7 @@ void test_rebase_merge__next(void)
cl_git_pass(git_rebase_next(&rebase_operation, rebase));
- git_oid_fromstr(&pick_id, "da9c51a23d02d931a486f45ad18cda05cf5d2b94");
+ git_oid_fromstr(&pick_id, "da9c51a23d02d931a486f45ad18cda05cf5d2b94", GIT_OID_SHA1);
cl_assert_equal_i(GIT_REBASE_OPERATION_PICK, rebase_operation->type);
cl_assert_equal_oid(&pick_id, &rebase_operation->id);
@@ -78,7 +78,7 @@ void test_rebase_merge__next(void)
cl_assert_equal_s("beef.txt", status_entry->head_to_index->new_file.path);
- git_oid_fromstr(&file1_id, "8d95ea62e621f1d38d230d9e7d206e41096d76af");
+ git_oid_fromstr(&file1_id, "8d95ea62e621f1d38d230d9e7d206e41096d76af", GIT_OID_SHA1);
cl_assert_equal_oid(&file1_id, &status_entry->head_to_index->new_file.id);
git_status_list_free(status_list);
@@ -129,7 +129,7 @@ void test_rebase_merge__next_with_conflicts(void)
cl_git_pass(git_rebase_next(&rebase_operation, rebase));
- git_oid_fromstr(&pick_id, "33f915f9e4dbd9f4b24430e48731a59b45b15500");
+ git_oid_fromstr(&pick_id, "33f915f9e4dbd9f4b24430e48731a59b45b15500", GIT_OID_SHA1);
cl_assert_equal_i(GIT_REBASE_OPERATION_PICK, rebase_operation->type);
cl_assert_equal_oid(&pick_id, &rebase_operation->id);
@@ -230,11 +230,11 @@ void test_rebase_merge__commit(void)
cl_git_pass(git_commit_lookup(&commit, repo, &commit_id));
- git_oid_fromstr(&parent_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00");
+ git_oid_fromstr(&parent_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00", GIT_OID_SHA1);
cl_assert_equal_i(1, git_commit_parentcount(commit));
cl_assert_equal_oid(&parent_id, git_commit_parent_id(commit, 0));
- git_oid_fromstr(&tree_id, "4461379789c777d2a6c1f2ee0e9d6c86731b9992");
+ git_oid_fromstr(&tree_id, "4461379789c777d2a6c1f2ee0e9d6c86731b9992", GIT_OID_SHA1);
cl_assert_equal_oid(&tree_id, git_commit_tree_id(commit));
cl_assert_equal_s(NULL, git_commit_message_encoding(commit));
@@ -275,8 +275,8 @@ void test_rebase_merge__commit_with_id(void)
git_reflog *reflog;
const git_reflog_entry *reflog_entry;
- cl_git_pass(git_oid_fromstr(&branch_id, "b146bd7608eac53d9bf9e1a6963543588b555c64"));
- cl_git_pass(git_oid_fromstr(&upstream_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00"));
+ cl_git_pass(git_oid_fromstr(&branch_id, "b146bd7608eac53d9bf9e1a6963543588b555c64", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&upstream_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00", GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&branch_head, repo, &branch_id));
cl_git_pass(git_annotated_commit_lookup(&upstream_head, repo, &upstream_id));
@@ -289,11 +289,11 @@ void test_rebase_merge__commit_with_id(void)
cl_git_pass(git_commit_lookup(&commit, repo, &commit_id));
- git_oid_fromstr(&parent_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00");
+ git_oid_fromstr(&parent_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00", GIT_OID_SHA1);
cl_assert_equal_i(1, git_commit_parentcount(commit));
cl_assert_equal_oid(&parent_id, git_commit_parent_id(commit, 0));
- git_oid_fromstr(&tree_id, "4461379789c777d2a6c1f2ee0e9d6c86731b9992");
+ git_oid_fromstr(&tree_id, "4461379789c777d2a6c1f2ee0e9d6c86731b9992", GIT_OID_SHA1);
cl_assert_equal_oid(&tree_id, git_commit_tree_id(commit));
cl_assert_equal_s(NULL, git_commit_message_encoding(commit));
@@ -551,8 +551,8 @@ void test_rebase_merge__finish_with_ids(void)
const git_reflog_entry *reflog_entry;
int error;
- cl_git_pass(git_oid_fromstr(&branch_id, "d616d97082eb7bb2dc6f180a7cca940993b7a56f"));
- cl_git_pass(git_oid_fromstr(&upstream_id, "f87d14a4a236582a0278a916340a793714256864"));
+ cl_git_pass(git_oid_fromstr(&branch_id, "d616d97082eb7bb2dc6f180a7cca940993b7a56f", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&upstream_id, "f87d14a4a236582a0278a916340a793714256864", GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&branch_head, repo, &branch_id));
cl_git_pass(git_annotated_commit_lookup(&upstream_head, repo, &upstream_id));
@@ -627,7 +627,7 @@ void test_rebase_merge__no_common_ancestor(void)
cl_git_pass(git_rebase_finish(rebase, signature));
- git_oid_fromstr(&expected_final_id, "71e7ee8d4fe7d8bf0d107355197e0a953dfdb7f3");
+ git_oid_fromstr(&expected_final_id, "71e7ee8d4fe7d8bf0d107355197e0a953dfdb7f3", GIT_OID_SHA1);
cl_assert_equal_oid(&expected_final_id, &commit_id);
git_annotated_commit_free(branch_head);
@@ -823,7 +823,7 @@ void test_rebase_merge__with_directories(void)
git_oid commit_id, tree_id;
git_commit *commit;
- git_oid_fromstr(&tree_id, "a4d6d9c3d57308fd8e320cf2525bae8f1adafa57");
+ git_oid_fromstr(&tree_id, "a4d6d9c3d57308fd8e320cf2525bae8f1adafa57", GIT_OID_SHA1);
cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/deep_gravy"));
cl_git_pass(git_reference_lookup(&upstream_ref, repo, "refs/heads/veal"));
diff --git a/tests/libgit2/rebase/setup.c b/tests/libgit2/rebase/setup.c
index 34d5edb..856dc84 100644
--- a/tests/libgit2/rebase/setup.c
+++ b/tests/libgit2/rebase/setup.c
@@ -74,7 +74,7 @@ void test_rebase_setup__merge(void)
cl_assert_equal_i(GIT_REPOSITORY_STATE_REBASE_MERGE, git_repository_state(repo));
- git_oid_fromstr(&head_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00");
+ git_oid_fromstr(&head_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00", GIT_OID_SHA1);
cl_git_pass(git_repository_head(&head, repo));
cl_git_pass(git_reference_peel((git_object **)&head_commit, head, GIT_OBJECT_COMMIT));
cl_assert_equal_oid(&head_id, git_commit_id(head_commit));
@@ -120,7 +120,7 @@ void test_rebase_setup__merge_root(void)
cl_git_pass(git_rebase_init(&rebase, repo, branch_head, NULL, onto_head, NULL));
- git_oid_fromstr(&head_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00");
+ git_oid_fromstr(&head_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00", GIT_OID_SHA1);
cl_git_pass(git_repository_head(&head, repo));
cl_git_pass(git_reference_peel((git_object **)&head_commit, head, GIT_OBJECT_COMMIT));
cl_assert_equal_oid(&head_id, git_commit_id(head_commit));
@@ -170,7 +170,7 @@ void test_rebase_setup__merge_onto_and_upstream(void)
cl_git_pass(git_rebase_init(&rebase, repo, branch1_head, branch2_head, onto_head, NULL));
- git_oid_fromstr(&head_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00");
+ git_oid_fromstr(&head_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00", GIT_OID_SHA1);
cl_git_pass(git_repository_head(&head, repo));
cl_git_pass(git_reference_peel((git_object **)&head_commit, head, GIT_OBJECT_COMMIT));
cl_assert_equal_oid(&head_id, git_commit_id(head_commit));
@@ -224,7 +224,7 @@ void test_rebase_setup__merge_onto_upstream_and_branch(void)
cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, onto_head, NULL));
- git_oid_fromstr(&head_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00");
+ git_oid_fromstr(&head_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00", GIT_OID_SHA1);
cl_git_pass(git_repository_head(&head, repo));
cl_git_pass(git_reference_peel((git_object **)&head_commit, head, GIT_OBJECT_COMMIT));
cl_assert_equal_oid(&head_id, git_commit_id(head_commit));
@@ -272,9 +272,9 @@ void test_rebase_setup__merge_onto_upstream_and_branch_by_id(void)
cl_git_pass(git_repository_set_head(repo, "refs/heads/beef"));
cl_git_pass(git_checkout_head(repo, &checkout_opts));
- cl_git_pass(git_oid_fromstr(&upstream_id, "f87d14a4a236582a0278a916340a793714256864"));
- cl_git_pass(git_oid_fromstr(&branch_id, "d616d97082eb7bb2dc6f180a7cca940993b7a56f"));
- cl_git_pass(git_oid_fromstr(&onto_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00"));
+ cl_git_pass(git_oid_fromstr(&upstream_id, "f87d14a4a236582a0278a916340a793714256864", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&branch_id, "d616d97082eb7bb2dc6f180a7cca940993b7a56f", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&onto_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00", GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&upstream_head, repo, &upstream_id));
cl_git_pass(git_annotated_commit_lookup(&branch_head, repo, &branch_id));
@@ -282,7 +282,7 @@ void test_rebase_setup__merge_onto_upstream_and_branch_by_id(void)
cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, onto_head, NULL));
- git_oid_fromstr(&head_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00");
+ git_oid_fromstr(&head_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00", GIT_OID_SHA1);
cl_git_pass(git_repository_head(&head, repo));
cl_git_pass(git_reference_peel((git_object **)&head_commit, head, GIT_OBJECT_COMMIT));
cl_assert_equal_oid(&head_id, git_commit_id(head_commit));
@@ -328,7 +328,7 @@ void test_rebase_setup__branch_with_merges(void)
cl_assert_equal_i(GIT_REPOSITORY_STATE_REBASE_MERGE, git_repository_state(repo));
- git_oid_fromstr(&head_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00");
+ git_oid_fromstr(&head_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00", GIT_OID_SHA1);
cl_git_pass(git_repository_head(&head, repo));
cl_git_pass(git_reference_peel((git_object **)&head_commit, head, GIT_OBJECT_COMMIT));
cl_assert_equal_oid(&head_id, git_commit_id(head_commit));
@@ -376,7 +376,7 @@ void test_rebase_setup__orphan_branch(void)
cl_assert_equal_i(GIT_REPOSITORY_STATE_REBASE_MERGE, git_repository_state(repo));
- git_oid_fromstr(&head_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00");
+ git_oid_fromstr(&head_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00", GIT_OID_SHA1);
cl_git_pass(git_repository_head(&head, repo));
cl_git_pass(git_reference_peel((git_object **)&head_commit, head, GIT_OBJECT_COMMIT));
cl_assert_equal_oid(&head_id, git_commit_id(head_commit));
@@ -427,7 +427,7 @@ void test_rebase_setup__merge_null_branch_uses_HEAD(void)
cl_assert_equal_i(GIT_REPOSITORY_STATE_REBASE_MERGE, git_repository_state(repo));
- git_oid_fromstr(&head_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00");
+ git_oid_fromstr(&head_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00", GIT_OID_SHA1);
cl_git_pass(git_repository_head(&head, repo));
cl_git_pass(git_reference_peel((git_object **)&head_commit, head, GIT_OBJECT_COMMIT));
cl_assert_equal_oid(&head_id, git_commit_id(head_commit));
@@ -465,7 +465,7 @@ void test_rebase_setup__merge_from_detached(void)
cl_git_pass(git_reference_lookup(&upstream_ref, repo, "refs/heads/master"));
- cl_git_pass(git_oid_fromstr(&branch_id, "b146bd7608eac53d9bf9e1a6963543588b555c64"));
+ cl_git_pass(git_oid_fromstr(&branch_id, "b146bd7608eac53d9bf9e1a6963543588b555c64", GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_lookup(&branch_head, repo, &branch_id));
cl_git_pass(git_annotated_commit_from_ref(&upstream_head, repo, upstream_ref));
@@ -474,7 +474,7 @@ void test_rebase_setup__merge_from_detached(void)
cl_assert_equal_i(GIT_REPOSITORY_STATE_REBASE_MERGE, git_repository_state(repo));
- git_oid_fromstr(&head_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00");
+ git_oid_fromstr(&head_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00", GIT_OID_SHA1);
cl_git_pass(git_repository_head(&head, repo));
cl_git_pass(git_reference_peel((git_object **)&head_commit, head, GIT_OBJECT_COMMIT));
cl_assert_equal_oid(&head_id, git_commit_id(head_commit));
@@ -513,7 +513,7 @@ void test_rebase_setup__merge_branch_by_id(void)
cl_git_pass(git_reference_lookup(&branch_ref, repo, "refs/heads/beef"));
- cl_git_pass(git_oid_fromstr(&upstream_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00"));
+ cl_git_pass(git_oid_fromstr(&upstream_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00", GIT_OID_SHA1));
cl_git_pass(git_annotated_commit_from_ref(&branch_head, repo, branch_ref));
cl_git_pass(git_annotated_commit_lookup(&upstream_head, repo, &upstream_id));
@@ -522,7 +522,7 @@ void test_rebase_setup__merge_branch_by_id(void)
cl_assert_equal_i(GIT_REPOSITORY_STATE_REBASE_MERGE, git_repository_state(repo));
- git_oid_fromstr(&head_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00");
+ git_oid_fromstr(&head_id, "efad0b11c47cb2f0220cbd6f5b0f93bb99064b00", GIT_OID_SHA1);
cl_git_pass(git_repository_head(&head, repo));
cl_git_pass(git_reference_peel((git_object **)&head_commit, head, GIT_OBJECT_COMMIT));
cl_assert_equal_oid(&head_id, git_commit_id(head_commit));
diff --git a/tests/libgit2/rebase/sign.c b/tests/libgit2/rebase/sign.c
index 4064cf7..f678e7b 100644
--- a/tests/libgit2/rebase/sign.c
+++ b/tests/libgit2/rebase/sign.c
@@ -70,7 +70,7 @@ committer Rebaser <rebaser@rebaser.rb> 1405694510 +0000\n";
cl_git_pass(git_rebase_next(&rebase_operation, rebase));
cl_git_pass(git_rebase_commit(&commit_id, rebase, NULL, signature, NULL, NULL));
- git_oid_fromstr(&expected_id, "129183968a65abd6c52da35bff43325001bfc630");
+ git_oid_fromstr(&expected_id, "129183968a65abd6c52da35bff43325001bfc630", GIT_OID_SHA1);
cl_assert_equal_oid(&expected_id, &commit_id);
cl_git_pass(git_commit_lookup(&commit, repo, &commit_id));
@@ -178,7 +178,7 @@ gpgsig -----BEGIN PGP SIGNATURE-----\n\
cl_git_pass(git_rebase_next(&rebase_operation, rebase));
cl_git_pass(git_rebase_commit(&commit_id, rebase, NULL, signature, NULL, NULL));
- git_oid_fromstr(&expected_id, "bf78348e45c8286f52b760f1db15cb6da030f2ef");
+ git_oid_fromstr(&expected_id, "bf78348e45c8286f52b760f1db15cb6da030f2ef", GIT_OID_SHA1);
cl_assert_equal_oid(&expected_id, &commit_id);
cl_git_pass(git_commit_lookup(&commit, repo, &commit_id));
@@ -300,7 +300,7 @@ committer Rebaser <rebaser@rebaser.rb> 1405694510 +0000\n";
cl_git_pass(git_rebase_next(&rebase_operation, rebase));
cl_git_pass(git_rebase_commit(&commit_id, rebase, NULL, signature, NULL, NULL));
- git_oid_fromstr(&expected_id, "129183968a65abd6c52da35bff43325001bfc630");
+ git_oid_fromstr(&expected_id, "129183968a65abd6c52da35bff43325001bfc630", GIT_OID_SHA1);
cl_assert_equal_oid(&expected_id, &commit_id);
cl_git_pass(git_commit_lookup(&commit, repo, &commit_id));
@@ -398,7 +398,7 @@ gpgsig -----BEGIN PGP SIGNATURE-----\n\
cl_git_pass(git_rebase_next(&rebase_operation, rebase));
cl_git_pass(git_rebase_commit(&commit_id, rebase, NULL, signature, NULL, NULL));
- git_oid_fromstr(&expected_id, "bf78348e45c8286f52b760f1db15cb6da030f2ef");
+ git_oid_fromstr(&expected_id, "bf78348e45c8286f52b760f1db15cb6da030f2ef", GIT_OID_SHA1);
cl_assert_equal_oid(&expected_id, &commit_id);
cl_git_pass(git_commit_lookup(&commit, repo, &commit_id));
@@ -473,7 +473,7 @@ magicsig magic word: pretty please\n";
cl_git_pass(git_rebase_next(&rebase_operation, rebase));
cl_git_pass(git_rebase_commit(&commit_id, rebase, NULL, signature, NULL, NULL));
- git_oid_fromstr(&expected_id, "f46a4a8d26ae411b02aa61b7d69576627f4a1e1c");
+ git_oid_fromstr(&expected_id, "f46a4a8d26ae411b02aa61b7d69576627f4a1e1c", GIT_OID_SHA1);
cl_assert_equal_oid(&expected_id, &commit_id);
cl_git_pass(git_commit_lookup(&commit, repo, &commit_id));
diff --git a/tests/libgit2/refs/basic.c b/tests/libgit2/refs/basic.c
index 32742f9..18ba937 100644
--- a/tests/libgit2/refs/basic.c
+++ b/tests/libgit2/refs/basic.c
@@ -53,7 +53,7 @@ void test_refs_basic__longpaths(void)
git_reference *one = NULL, *two = NULL;
git_oid id;
- cl_git_pass(git_oid_fromstr(&id, "099fabac3a9ea935598528c27f866e34089c2eff"));
+ cl_git_pass(git_oid_fromstr(&id, "099fabac3a9ea935598528c27f866e34089c2eff", GIT_OID_SHA1));
base = git_repository_path(g_repo);
base_len = git_utf8_char_length(base, strlen(base));
diff --git a/tests/libgit2/refs/branches/delete.c b/tests/libgit2/refs/branches/delete.c
index 2c2eae2..6eb16a1 100644
--- a/tests/libgit2/refs/branches/delete.c
+++ b/tests/libgit2/refs/branches/delete.c
@@ -14,7 +14,7 @@ void test_refs_branches_delete__initialize(void)
repo = cl_git_sandbox_init("testrepo.git");
- cl_git_pass(git_oid_fromstr(&id, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644"));
+ cl_git_pass(git_oid_fromstr(&id, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644", GIT_OID_SHA1));
cl_git_pass(git_reference_create(&fake_remote, repo, "refs/remotes/nulltoken/master", &id, 0, NULL));
}
@@ -157,7 +157,7 @@ void test_refs_branches_delete__removes_empty_folders(void)
git_str reflog_folder = GIT_STR_INIT;
/* Create a new branch with a nested name */
- cl_git_pass(git_oid_fromstr(&commit_id, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750"));
+ cl_git_pass(git_oid_fromstr(&commit_id, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", GIT_OID_SHA1));
cl_git_pass(git_commit_lookup(&commit, repo, &commit_id));
cl_git_pass(git_branch_create(&branch, repo, "some/deep/ref", commit, 0));
git_commit_free(commit);
diff --git a/tests/libgit2/refs/branches/iterator.c b/tests/libgit2/refs/branches/iterator.c
index e086681..349a921 100644
--- a/tests/libgit2/refs/branches/iterator.c
+++ b/tests/libgit2/refs/branches/iterator.c
@@ -11,7 +11,7 @@ void test_refs_branches_iterator__initialize(void)
cl_fixture_sandbox("testrepo.git");
cl_git_pass(git_repository_open(&repo, "testrepo.git"));
- cl_git_pass(git_oid_fromstr(&id, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644"));
+ cl_git_pass(git_oid_fromstr(&id, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644", GIT_OID_SHA1));
cl_git_pass(git_reference_create(&fake_remote, repo, "refs/remotes/nulltoken/master", &id, 0, NULL));
}
diff --git a/tests/libgit2/refs/create.c b/tests/libgit2/refs/create.c
index 01eb62a..b13dd30 100644
--- a/tests/libgit2/refs/create.c
+++ b/tests/libgit2/refs/create.c
@@ -34,7 +34,7 @@ void test_refs_create__symbolic(void)
const char *new_head_tracker = "ANOTHER_HEAD_TRACKER";
- git_oid_fromstr(&id, current_master_tip);
+ git_oid_fromstr(&id, current_master_tip, GIT_OID_SHA1);
/* Create and write the new symbolic reference */
cl_git_pass(git_reference_symbolic_create(&new_reference, g_repo, new_head_tracker, current_head_target, 0, NULL));
@@ -77,7 +77,7 @@ void test_refs_create__symbolic_with_arbitrary_content(void)
const char *new_head_tracker = "ANOTHER_HEAD_TRACKER";
const char *arbitrary_target = "ARBITRARY DATA";
- git_oid_fromstr(&id, current_master_tip);
+ git_oid_fromstr(&id, current_master_tip, GIT_OID_SHA1);
/* Attempt to create symbolic ref with arbitrary data in target
* fails by default
@@ -124,7 +124,7 @@ void test_refs_create__deep_symbolic(void)
const char *new_head_tracker = "deep/rooted/tracker";
- git_oid_fromstr(&id, current_master_tip);
+ git_oid_fromstr(&id, current_master_tip, GIT_OID_SHA1);
cl_git_pass(git_reference_symbolic_create(&new_reference, g_repo, new_head_tracker, current_head_target, 0, NULL));
cl_git_pass(git_reference_lookup(&looked_up_ref, g_repo, new_head_tracker));
@@ -145,7 +145,7 @@ void test_refs_create__oid(void)
const char *new_head = "refs/heads/new-head";
- git_oid_fromstr(&id, current_master_tip);
+ git_oid_fromstr(&id, current_master_tip, GIT_OID_SHA1);
/* Create and write the new object id reference */
cl_git_pass(git_reference_create(&new_reference, g_repo, new_head, &id, 0, NULL));
@@ -180,7 +180,7 @@ void test_refs_create__oid_unknown_succeeds_without_strict(void)
const char *new_head = "refs/heads/new-head";
- git_oid_fromstr(&id, "deadbeef3f795b2b4353bcce3a527ad0a4f7f644");
+ git_oid_fromstr(&id, "deadbeef3f795b2b4353bcce3a527ad0a4f7f644", GIT_OID_SHA1);
cl_git_pass(git_libgit2_opts(GIT_OPT_ENABLE_STRICT_OBJECT_CREATION, 0));
@@ -201,7 +201,7 @@ void test_refs_create__oid_unknown_fails_by_default(void)
const char *new_head = "refs/heads/new-head";
- git_oid_fromstr(&id, "deadbeef3f795b2b4353bcce3a527ad0a4f7f644");
+ git_oid_fromstr(&id, "deadbeef3f795b2b4353bcce3a527ad0a4f7f644", GIT_OID_SHA1);
/* Create and write the new object id reference */
cl_git_fail(git_reference_create(&new_reference, g_repo, new_head, &id, 0, NULL));
@@ -215,7 +215,7 @@ void test_refs_create__propagate_eexists(void)
git_oid oid;
/* Make sure it works for oid and for symbolic both */
- cl_git_pass(git_oid_fromstr(&oid, current_master_tip));
+ cl_git_pass(git_oid_fromstr(&oid, current_master_tip, GIT_OID_SHA1));
cl_git_fail_with(GIT_EEXISTS, git_reference_create(NULL, g_repo, current_head_target, &oid, false, NULL));
cl_git_fail_with(GIT_EEXISTS, git_reference_symbolic_create(NULL, g_repo, "HEAD", current_head_target, false, NULL));
}
@@ -227,7 +227,7 @@ void test_refs_create__existing_dir_propagates_edirectory(void)
const char *dir_head = "refs/heads/new-dir/new-head",
*fail_head = "refs/heads/new-dir";
- git_oid_fromstr(&id, current_master_tip);
+ git_oid_fromstr(&id, current_master_tip, GIT_OID_SHA1);
/* Create and write the new object id reference */
cl_git_pass(git_reference_create(&new_reference, g_repo, dir_head, &id, 1, NULL));
@@ -242,7 +242,7 @@ static void test_invalid_name(const char *name)
git_reference *new_reference;
git_oid id;
- git_oid_fromstr(&id, current_master_tip);
+ git_oid_fromstr(&id, current_master_tip, GIT_OID_SHA1);
cl_assert_equal_i(GIT_EINVALIDSPEC, git_reference_create(
&new_reference, g_repo, name, &id, 0, NULL));
@@ -272,7 +272,7 @@ static void test_win32_name(const char *name)
git_oid id;
int ret;
- git_oid_fromstr(&id, current_master_tip);
+ git_oid_fromstr(&id, current_master_tip, GIT_OID_SHA1);
ret = git_reference_create(&new_reference, g_repo, name, &id, 0, NULL);
@@ -314,7 +314,7 @@ static void count_fsyncs(size_t *create_count, size_t *compress_count)
p_fsync__cnt = 0;
- git_oid_fromstr(&id, current_master_tip);
+ git_oid_fromstr(&id, current_master_tip, GIT_OID_SHA1);
cl_git_pass(git_reference_create(&ref, g_repo, "refs/heads/fsync_test", &id, 0, "log message"));
git_reference_free(ref);
diff --git a/tests/libgit2/refs/delete.c b/tests/libgit2/refs/delete.c
index 42cc534..643afc2 100644
--- a/tests/libgit2/refs/delete.c
+++ b/tests/libgit2/refs/delete.c
@@ -63,7 +63,7 @@ void test_refs_delete__packed_only(void)
git_oid id;
const char *new_ref = "refs/heads/new_ref";
- git_oid_fromstr(&id, current_master_tip);
+ git_oid_fromstr(&id, current_master_tip, GIT_OID_SHA1);
/* Create and write the new object id reference */
cl_git_pass(git_reference_create(&ref, g_repo, new_ref, &id, 0, NULL));
diff --git a/tests/libgit2/refs/foreachglob.c b/tests/libgit2/refs/foreachglob.c
index b208a95..743929c 100644
--- a/tests/libgit2/refs/foreachglob.c
+++ b/tests/libgit2/refs/foreachglob.c
@@ -11,7 +11,7 @@ void test_refs_foreachglob__initialize(void)
cl_fixture_sandbox("testrepo.git");
cl_git_pass(git_repository_open(&repo, "testrepo.git"));
- cl_git_pass(git_oid_fromstr(&id, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644"));
+ cl_git_pass(git_oid_fromstr(&id, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644", GIT_OID_SHA1));
cl_git_pass(git_reference_create(&fake_remote, repo, "refs/remotes/nulltoken/master", &id, 0, NULL));
}
diff --git a/tests/libgit2/refs/lookup.c b/tests/libgit2/refs/lookup.c
index 01e956d..38ea56d 100644
--- a/tests/libgit2/refs/lookup.c
+++ b/tests/libgit2/refs/lookup.c
@@ -43,7 +43,7 @@ void test_refs_lookup__oid(void)
git_oid tag, expected;
cl_git_pass(git_reference_name_to_id(&tag, g_repo, "refs/tags/point_to_blob"));
- cl_git_pass(git_oid_fromstr(&expected, "1385f264afb75a56a5bec74243be9b367ba4ca08"));
+ cl_git_pass(git_oid_fromstr(&expected, "1385f264afb75a56a5bec74243be9b367ba4ca08", GIT_OID_SHA1));
cl_assert_equal_oid(&expected, &tag);
}
diff --git a/tests/libgit2/refs/peel.c b/tests/libgit2/refs/peel.c
index 38f3465..95bc380 100644
--- a/tests/libgit2/refs/peel.c
+++ b/tests/libgit2/refs/peel.c
@@ -32,7 +32,7 @@ static void assert_peel_generic(
cl_git_pass(git_reference_peel(&peeled, ref, requested_type));
- cl_git_pass(git_oid_fromstr(&expected_oid, expected_sha));
+ cl_git_pass(git_oid_fromstr(&expected_oid, expected_sha, GIT_OID_SHA1));
cl_assert_equal_oid(&expected_oid, git_object_id(peeled));
cl_assert_equal_i(expected_type, git_object_type(peeled));
diff --git a/tests/libgit2/refs/races.c b/tests/libgit2/refs/races.c
index 4767893..833a678 100644
--- a/tests/libgit2/refs/races.c
+++ b/tests/libgit2/refs/races.c
@@ -27,8 +27,8 @@ void test_refs_races__create_matching_zero_old(void)
git_reference *ref;
git_oid id, zero_id;
- git_oid_fromstr(&id, commit_id);
- git_oid_fromstr(&zero_id, "0000000000000000000000000000000000000000");
+ git_oid_fromstr(&id, commit_id, GIT_OID_SHA1);
+ git_oid_fromstr(&zero_id, "0000000000000000000000000000000000000000", GIT_OID_SHA1);
cl_git_fail(git_reference_create_matching(&ref, g_repo, refname, &id, 1, &zero_id, NULL));
git_reference_free(ref);
@@ -45,8 +45,8 @@ void test_refs_races__create_matching(void)
git_reference *ref, *ref2, *ref3;
git_oid id, other_id;
- git_oid_fromstr(&id, commit_id);
- git_oid_fromstr(&other_id, other_commit_id);
+ git_oid_fromstr(&id, commit_id, GIT_OID_SHA1);
+ git_oid_fromstr(&other_id, other_commit_id, GIT_OID_SHA1);
cl_git_fail_with(GIT_EMODIFIED, git_reference_create_matching(&ref, g_repo, refname, &other_id, 1, &other_id, NULL));
@@ -64,8 +64,8 @@ void test_refs_races__symbolic_create_matching(void)
git_reference *ref, *ref2, *ref3;
git_oid id, other_id;
- git_oid_fromstr(&id, commit_id);
- git_oid_fromstr(&other_id, other_commit_id);
+ git_oid_fromstr(&id, commit_id, GIT_OID_SHA1);
+ git_oid_fromstr(&other_id, other_commit_id, GIT_OID_SHA1);
cl_git_fail_with(GIT_EMODIFIED, git_reference_symbolic_create_matching(&ref, g_repo, "HEAD", other_refname, 1, other_refname, NULL));
@@ -83,8 +83,8 @@ void test_refs_races__delete(void)
git_reference *ref, *ref2;
git_oid id, other_id;
- git_oid_fromstr(&id, commit_id);
- git_oid_fromstr(&other_id, other_commit_id);
+ git_oid_fromstr(&id, commit_id, GIT_OID_SHA1);
+ git_oid_fromstr(&other_id, other_commit_id, GIT_OID_SHA1);
/* We can delete a value that matches */
cl_git_pass(git_reference_lookup(&ref, g_repo, refname));
@@ -116,8 +116,8 @@ void test_refs_races__switch_oid_to_symbolic(void)
git_reference *ref, *ref2, *ref3;
git_oid id, other_id;
- git_oid_fromstr(&id, commit_id);
- git_oid_fromstr(&other_id, other_commit_id);
+ git_oid_fromstr(&id, commit_id, GIT_OID_SHA1);
+ git_oid_fromstr(&other_id, other_commit_id, GIT_OID_SHA1);
/* Removing a direct ref when it's currently symbolic should fail */
cl_git_pass(git_reference_lookup(&ref, g_repo, refname));
@@ -145,8 +145,8 @@ void test_refs_races__switch_symbolic_to_oid(void)
git_reference *ref, *ref2, *ref3;
git_oid id, other_id;
- git_oid_fromstr(&id, commit_id);
- git_oid_fromstr(&other_id, other_commit_id);
+ git_oid_fromstr(&id, commit_id, GIT_OID_SHA1);
+ git_oid_fromstr(&other_id, other_commit_id, GIT_OID_SHA1);
/* Removing a symbolic ref when it's currently direct should fail */
cl_git_pass(git_reference_lookup(&ref, g_repo, "refs/symref"));
diff --git a/tests/libgit2/refs/read.c b/tests/libgit2/refs/read.c
index a622c77..f0a96d2 100644
--- a/tests/libgit2/refs/read.c
+++ b/tests/libgit2/refs/read.c
@@ -82,7 +82,7 @@ void test_refs_read__symbolic(void)
cl_assert(object != NULL);
cl_assert(git_object_type(object) == GIT_OBJECT_COMMIT);
- git_oid_fromstr(&id, current_master_tip);
+ git_oid_fromstr(&id, current_master_tip, GIT_OID_SHA1);
cl_assert_equal_oid(&id, git_object_id(object));
git_object_free(object);
@@ -110,7 +110,7 @@ void test_refs_read__nested_symbolic(void)
cl_assert(object != NULL);
cl_assert(git_object_type(object) == GIT_OBJECT_COMMIT);
- git_oid_fromstr(&id, current_master_tip);
+ git_oid_fromstr(&id, current_master_tip, GIT_OID_SHA1);
cl_assert_equal_oid(&id, git_object_id(object));
git_object_free(object);
diff --git a/tests/libgit2/refs/reflog/messages.c b/tests/libgit2/refs/reflog/messages.c
index 9bff664..0f87671 100644
--- a/tests/libgit2/refs/reflog/messages.c
+++ b/tests/libgit2/refs/reflog/messages.c
@@ -87,7 +87,7 @@ void test_refs_reflog_messages__detaching_writes_reflog(void)
const char *msg;
msg = "checkout: moving from master to e90810b8df3e80c413d903f631643c716887138d";
- git_oid_fromstr(&id, "e90810b8df3e80c413d903f631643c716887138d");
+ git_oid_fromstr(&id, "e90810b8df3e80c413d903f631643c716887138d", GIT_OID_SHA1);
cl_git_pass(git_repository_set_head_detached(g_repo, &id));
cl_reflog_check_entry(g_repo, GIT_HEAD_FILE, 0,
"a65fedf39aefe402d3bb6e24df4d4f5fe4547750",
@@ -109,7 +109,7 @@ void test_refs_reflog_messages__orphan_branch_does_not_count(void)
/* Have something known */
msg = "checkout: moving from master to e90810b8df3e80c413d903f631643c716887138d";
- git_oid_fromstr(&id, "e90810b8df3e80c413d903f631643c716887138d");
+ git_oid_fromstr(&id, "e90810b8df3e80c413d903f631643c716887138d", GIT_OID_SHA1);
cl_git_pass(git_repository_set_head_detached(g_repo, &id));
cl_reflog_check_entry(g_repo, GIT_HEAD_FILE, 0,
"a65fedf39aefe402d3bb6e24df4d4f5fe4547750",
@@ -280,7 +280,7 @@ void test_refs_reflog_messages__newline_gets_replaced(void)
git_oid oid;
cl_git_pass(git_signature_now(&signature, "me", "foo@example.com"));
- cl_git_pass(git_oid_fromstr(&oid, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750"));
+ cl_git_pass(git_oid_fromstr(&oid, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", GIT_OID_SHA1));
cl_git_pass(git_reflog_read(&reflog, g_repo, "HEAD"));
cl_assert_equal_sz(7, git_reflog_entrycount(reflog));
diff --git a/tests/libgit2/refs/reflog/reflog.c b/tests/libgit2/refs/reflog/reflog.c
index 2674f03..76b31cf 100644
--- a/tests/libgit2/refs/reflog/reflog.c
+++ b/tests/libgit2/refs/reflog/reflog.c
@@ -80,7 +80,7 @@ void test_refs_reflog_reflog__append_then_read(void)
git_reflog *reflog;
/* Create a new branch pointing at the HEAD */
- git_oid_fromstr(&oid, current_master_tip);
+ git_oid_fromstr(&oid, current_master_tip, GIT_OID_SHA1);
cl_git_pass(git_reference_create(&ref, g_repo, new_ref, &oid, 0, NULL));
git_reference_free(ref);
@@ -147,7 +147,7 @@ void test_refs_reflog_reflog__removes_empty_reflog_dir(void)
git_oid id;
/* Create a new branch pointing at the HEAD */
- git_oid_fromstr(&id, current_master_tip);
+ git_oid_fromstr(&id, current_master_tip, GIT_OID_SHA1);
cl_git_pass(git_reference_create(&ref, g_repo, "refs/heads/new-dir/new-head", &id, 0, NULL));
git_str_joinpath(&log_path, git_repository_path(g_repo), GIT_REFLOG_DIR);
@@ -159,7 +159,7 @@ void test_refs_reflog_reflog__removes_empty_reflog_dir(void)
git_reference_free(ref);
/* new ref creation should succeed since new-dir is empty */
- git_oid_fromstr(&id, current_master_tip);
+ git_oid_fromstr(&id, current_master_tip, GIT_OID_SHA1);
cl_git_pass(git_reference_create(&ref, g_repo, "refs/heads/new-dir", &id, 0, NULL));
git_reference_free(ref);
@@ -173,7 +173,7 @@ void test_refs_reflog_reflog__fails_gracefully_on_nonempty_reflog_dir(void)
git_oid id;
/* Create a new branch pointing at the HEAD */
- git_oid_fromstr(&id, current_master_tip);
+ git_oid_fromstr(&id, current_master_tip, GIT_OID_SHA1);
cl_git_pass(git_reference_create(&ref, g_repo, "refs/heads/new-dir/new-head", &id, 0, NULL));
git_reference_free(ref);
@@ -186,7 +186,7 @@ void test_refs_reflog_reflog__fails_gracefully_on_nonempty_reflog_dir(void)
cl_must_pass(p_unlink("testrepo.git/refs/heads/new-dir/new-head"));
/* new ref creation should fail since new-dir contains reflogs still */
- git_oid_fromstr(&id, current_master_tip);
+ git_oid_fromstr(&id, current_master_tip, GIT_OID_SHA1);
cl_git_fail_with(GIT_EDIRECTORY, git_reference_create(&ref, g_repo, "refs/heads/new-dir", &id, 0, NULL));
git_reference_free(ref);
@@ -235,7 +235,7 @@ void test_refs_reflog_reflog__reading_a_reflog_with_invalid_format_succeeds(void
char *star;
/* Create a new branch. */
- cl_git_pass(git_oid_fromstr(&id, current_master_tip));
+ cl_git_pass(git_oid_fromstr(&id, current_master_tip, GIT_OID_SHA1));
cl_git_pass(git_reference_create(&ref, g_repo, refname, &id, 1, refmessage));
/*
@@ -298,7 +298,7 @@ void test_refs_reflog_reflog__write_only_std_locations(void)
git_reference *ref;
git_oid id;
- git_oid_fromstr(&id, current_master_tip);
+ git_oid_fromstr(&id, current_master_tip, GIT_OID_SHA1);
cl_git_pass(git_reference_create(&ref, g_repo, "refs/heads/foo", &id, 1, NULL));
git_reference_free(ref);
@@ -318,7 +318,7 @@ void test_refs_reflog_reflog__write_when_explicitly_active(void)
git_reference *ref;
git_oid id;
- git_oid_fromstr(&id, current_master_tip);
+ git_oid_fromstr(&id, current_master_tip, GIT_OID_SHA1);
git_reference_ensure_log(g_repo, "refs/tags/foo");
cl_git_pass(git_reference_create(&ref, g_repo, "refs/tags/foo", &id, 1, NULL));
@@ -338,7 +338,7 @@ void test_refs_reflog_reflog__append_to_HEAD_when_changing_current_branch(void)
git_reflog_free(log);
/* Move it back */
- git_oid_fromstr(&id, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644");
+ git_oid_fromstr(&id, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644", GIT_OID_SHA1);
cl_git_pass(git_reference_create(&ref, g_repo, "refs/heads/master", &id, 1, NULL));
git_reference_free(ref);
@@ -390,7 +390,7 @@ static void assert_no_reflog_update(void)
git_reflog_free(log);
/* Move it back */
- git_oid_fromstr(&id, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644");
+ git_oid_fromstr(&id, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644", GIT_OID_SHA1);
cl_git_pass(git_reference_create(&ref, g_repo, "refs/heads/master", &id, 1, NULL));
git_reference_free(ref);
@@ -431,7 +431,7 @@ void test_refs_reflog_reflog__logallrefupdates_bare_set_always(void)
cl_git_pass(git_config_set_string(config, "core.logallrefupdates", "always"));
git_config_free(config);
- git_oid_fromstr(&id, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644");
+ git_oid_fromstr(&id, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644", GIT_OID_SHA1);
cl_git_pass(git_reference_create(&ref, g_repo, "refs/bork", &id, 1, "message"));
cl_git_pass(git_reflog_read(&log, g_repo, "refs/bork"));
diff --git a/tests/libgit2/refs/reflog/reflog_helpers.c b/tests/libgit2/refs/reflog/reflog_helpers.c
index 9f59827..f6b5f21 100644
--- a/tests/libgit2/refs/reflog/reflog_helpers.c
+++ b/tests/libgit2/refs/reflog/reflog_helpers.c
@@ -53,7 +53,7 @@ void cl_reflog_check_entry_(git_repository *repo, const char *reflog, size_t idx
git_object_free(obj);
} else {
git_oid *oid = git__calloc(1, sizeof(*oid));
- git_oid_fromstr(oid, old_spec);
+ git_oid_fromstr(oid, old_spec, GIT_OID_SHA1);
if (git_oid_cmp(oid, git_reflog_entry_id_old(entry)) != 0) {
git_object__write_oid_header(&result, "\tOld OID: \"", oid);
git_object__write_oid_header(&result, "\" != \"", git_reflog_entry_id_old(entry));
@@ -73,7 +73,7 @@ void cl_reflog_check_entry_(git_repository *repo, const char *reflog, size_t idx
git_object_free(obj);
} else {
git_oid *oid = git__calloc(1, sizeof(*oid));
- git_oid_fromstr(oid, new_spec);
+ git_oid_fromstr(oid, new_spec, GIT_OID_SHA1);
if (git_oid_cmp(oid, git_reflog_entry_id_new(entry)) != 0) {
git_object__write_oid_header(&result, "\tNew OID: \"", oid);
git_object__write_oid_header(&result, "\" != \"", git_reflog_entry_id_new(entry));
diff --git a/tests/libgit2/refs/transactions.c b/tests/libgit2/refs/transactions.c
index 50c102a..9d88da0 100644
--- a/tests/libgit2/refs/transactions.c
+++ b/tests/libgit2/refs/transactions.c
@@ -21,7 +21,7 @@ void test_refs_transactions__single_ref_oid(void)
git_reference *ref;
git_oid id;
- git_oid_fromstr(&id, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750");
+ git_oid_fromstr(&id, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", GIT_OID_SHA1);
cl_git_pass(git_transaction_lock_ref(g_tx, "refs/heads/master"));
cl_git_pass(git_transaction_set_target(g_tx, "refs/heads/master", &id, NULL, NULL));
@@ -52,7 +52,7 @@ void test_refs_transactions__single_ref_mix_types(void)
git_reference *ref;
git_oid id;
- git_oid_fromstr(&id, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750");
+ git_oid_fromstr(&id, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", GIT_OID_SHA1);
cl_git_pass(git_transaction_lock_ref(g_tx, "refs/heads/master"));
cl_git_pass(git_transaction_lock_ref(g_tx, "HEAD"));
@@ -90,7 +90,7 @@ void test_refs_transactions__single_create(void)
cl_git_pass(git_transaction_lock_ref(g_tx, name));
- git_oid_fromstr(&id, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750");
+ git_oid_fromstr(&id, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", GIT_OID_SHA1);
cl_git_pass(git_transaction_set_target(g_tx, name, &id, NULL, NULL));
cl_git_pass(git_transaction_commit(g_tx));
@@ -104,7 +104,7 @@ void test_refs_transactions__unlocked_set(void)
git_oid id;
cl_git_pass(git_transaction_lock_ref(g_tx, "refs/heads/master"));
- git_oid_fromstr(&id, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750");
+ git_oid_fromstr(&id, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", GIT_OID_SHA1);
cl_git_fail_with(GIT_ENOTFOUND, git_transaction_set_target(g_tx, "refs/heads/foo", &id, NULL, NULL));
cl_git_pass(git_transaction_commit(g_tx));
}
@@ -122,7 +122,7 @@ void test_refs_transactions__error_on_locking_locked_ref(void)
cl_git_pass(git_transaction_lock_ref(g_tx_with_lock, "refs/heads/master"));
/* lock reference for set_target */
- cl_git_pass(git_oid_fromstr(&id, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750"));
+ cl_git_pass(git_oid_fromstr(&id, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", GIT_OID_SHA1));
cl_git_fail_with(GIT_ELOCKED, git_transaction_lock_ref(g_tx, "refs/heads/master"));
cl_git_fail_with(GIT_ENOTFOUND, git_transaction_set_target(g_tx, "refs/heads/master", &id, NULL, NULL));
diff --git a/tests/libgit2/repo/env.c b/tests/libgit2/repo/env.c
index e3e5224..3338b1c 100644
--- a/tests/libgit2/repo/env.c
+++ b/tests/libgit2/repo/env.c
@@ -95,9 +95,9 @@ static void env_check_objects_(bool a, bool t, bool p, const char *file, const c
git_repository *repo;
git_oid oid_a, oid_t, oid_p;
git_object *object;
- cl_git_pass(git_oid_fromstr(&oid_a, "45141a79a77842c59a63229403220a4e4be74e3d"));
- cl_git_pass(git_oid_fromstr(&oid_t, "1385f264afb75a56a5bec74243be9b367ba4ca08"));
- cl_git_pass(git_oid_fromstr(&oid_p, "0df1a5865c8abfc09f1f2182e6a31be550e99f07"));
+ cl_git_pass(git_oid_fromstr(&oid_a, "45141a79a77842c59a63229403220a4e4be74e3d", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&oid_t, "1385f264afb75a56a5bec74243be9b367ba4ca08", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&oid_p, "0df1a5865c8abfc09f1f2182e6a31be550e99f07", GIT_OID_SHA1));
cl_git_expect(git_repository_open_ext(&repo, "attr", GIT_REPOSITORY_OPEN_FROM_ENV, NULL), 0, file, func, line);
if (a) {
diff --git a/tests/libgit2/repo/head.c b/tests/libgit2/repo/head.c
index 8229905..f00751a 100644
--- a/tests/libgit2/repo/head.c
+++ b/tests/libgit2/repo/head.c
@@ -99,7 +99,7 @@ void test_repo_head__set_head_detached_Return_ENOTFOUND_when_the_object_doesnt_e
{
git_oid oid;
- cl_git_pass(git_oid_fromstr(&oid, "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef"));
+ cl_git_pass(git_oid_fromstr(&oid, "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef", GIT_OID_SHA1));
cl_assert_equal_i(GIT_ENOTFOUND, git_repository_set_head_detached(repo, &oid));
}
diff --git a/tests/libgit2/reset/hard.c b/tests/libgit2/reset/hard.c
index 9d177c0..fd7ada5 100644
--- a/tests/libgit2/reset/hard.c
+++ b/tests/libgit2/reset/hard.c
@@ -122,9 +122,9 @@ static void unmerged_index_init(git_index *index, int entries)
int write_theirs = 4;
git_oid ancestor, ours, theirs;
- git_oid_fromstr(&ancestor, "452e4244b5d083ddf0460acf1ecc74db9dcfa11a");
- git_oid_fromstr(&ours, "32504b727382542f9f089e24fddac5e78533e96c");
- git_oid_fromstr(&theirs, "061d42a44cacde5726057b67558821d95db96f19");
+ git_oid_fromstr(&ancestor, "452e4244b5d083ddf0460acf1ecc74db9dcfa11a", GIT_OID_SHA1);
+ git_oid_fromstr(&ours, "32504b727382542f9f089e24fddac5e78533e96c", GIT_OID_SHA1);
+ git_oid_fromstr(&theirs, "061d42a44cacde5726057b67558821d95db96f19", GIT_OID_SHA1);
cl_git_rewritefile("status/conflicting_file", "conflicting file\n");
diff --git a/tests/libgit2/revert/bare.c b/tests/libgit2/revert/bare.c
index 9261cfe..094e13b 100644
--- a/tests/libgit2/revert/bare.c
+++ b/tests/libgit2/revert/bare.c
@@ -34,10 +34,10 @@ void test_revert_bare__automerge(void)
{ 0100644, "0f5bfcf58c558d865da6be0281d7795993646cee", 0, "file6.txt" },
};
- git_oid_fromstr(&head_oid, "72333f47d4e83616630ff3b0ffe4c0faebcc3c45");
+ git_oid_fromstr(&head_oid, "72333f47d4e83616630ff3b0ffe4c0faebcc3c45", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&head_commit, repo, &head_oid));
- git_oid_fromstr(&revert_oid, "d1d403d22cbe24592d725f442835cf46fe60c8ac");
+ git_oid_fromstr(&revert_oid, "d1d403d22cbe24592d725f442835cf46fe60c8ac", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&revert_commit, repo, &revert_oid));
cl_git_pass(git_revert_commit(&index, repo, revert_commit, head_commit, 0, NULL));
@@ -64,7 +64,7 @@ void test_revert_bare__conflicts(void)
{ 0100644, "0f5bfcf58c558d865da6be0281d7795993646cee", 0, "file6.txt" },
};
- git_oid_fromstr(&revert_oid, "72333f47d4e83616630ff3b0ffe4c0faebcc3c45");
+ git_oid_fromstr(&revert_oid, "72333f47d4e83616630ff3b0ffe4c0faebcc3c45", GIT_OID_SHA1);
cl_git_pass(git_repository_head(&head_ref, repo));
cl_git_pass(git_reference_peel((git_object **)&head_commit, head_ref, GIT_OBJECT_COMMIT));
@@ -91,10 +91,10 @@ void test_revert_bare__orphan(void)
{ 0100644, "296a6d3be1dff05c5d1f631d2459389fa7b619eb", 0, "file-mainline.txt" },
};
- git_oid_fromstr(&head_oid, "39467716290f6df775a91cdb9a4eb39295018145");
+ git_oid_fromstr(&head_oid, "39467716290f6df775a91cdb9a4eb39295018145", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&head_commit, repo, &head_oid));
- git_oid_fromstr(&revert_oid, "ebb03002cee5d66c7732dd06241119fe72ab96a5");
+ git_oid_fromstr(&revert_oid, "ebb03002cee5d66c7732dd06241119fe72ab96a5", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&revert_commit, repo, &revert_oid));
cl_git_pass(git_revert_commit(&index, repo, revert_commit, head_commit, 0, NULL));
diff --git a/tests/libgit2/revert/rename.c b/tests/libgit2/revert/rename.c
index 0d713c6..f2ab55d 100644
--- a/tests/libgit2/revert/rename.c
+++ b/tests/libgit2/revert/rename.c
@@ -36,7 +36,7 @@ void test_revert_rename__automerge(void)
cl_git_pass(git_repository_head(&head_ref, repo));
cl_git_pass(git_reference_peel((git_object **)&head_commit, head_ref, GIT_OBJECT_COMMIT));
- cl_git_pass(git_oid_fromstr(&revert_oid, "7b4d7c3789b3581973c04087cb774c3c3576de2f"));
+ cl_git_pass(git_oid_fromstr(&revert_oid, "7b4d7c3789b3581973c04087cb774c3c3576de2f", GIT_OID_SHA1));
cl_git_pass(git_commit_lookup(&revert_commit, repo, &revert_oid));
cl_git_pass(git_revert_commit(&index, repo, revert_commit, head_commit, 0, NULL));
diff --git a/tests/libgit2/revert/workdir.c b/tests/libgit2/revert/workdir.c
index 3f54280..420d8b0 100644
--- a/tests/libgit2/revert/workdir.c
+++ b/tests/libgit2/revert/workdir.c
@@ -45,11 +45,11 @@ void test_revert_workdir__automerge(void)
{ 0100644, "0f5bfcf58c558d865da6be0281d7795993646cee", 0, "file6.txt" },
};
- git_oid_fromstr(&head_oid, "72333f47d4e83616630ff3b0ffe4c0faebcc3c45");
+ git_oid_fromstr(&head_oid, "72333f47d4e83616630ff3b0ffe4c0faebcc3c45", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL));
- git_oid_fromstr(&revert_oid, "d1d403d22cbe24592d725f442835cf46fe60c8ac");
+ git_oid_fromstr(&revert_oid, "d1d403d22cbe24592d725f442835cf46fe60c8ac", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &revert_oid));
cl_git_pass(git_revert(repo, commit, NULL));
@@ -76,7 +76,7 @@ void test_revert_workdir__conflicts(void)
{ 0100644, "0f5bfcf58c558d865da6be0281d7795993646cee", 0, "file6.txt" },
};
- git_oid_fromstr(&revert_oid, "72333f47d4e83616630ff3b0ffe4c0faebcc3c45");
+ git_oid_fromstr(&revert_oid, "72333f47d4e83616630ff3b0ffe4c0faebcc3c45", GIT_OID_SHA1);
cl_git_pass(git_repository_head(&head_ref, repo));
cl_git_pass(git_reference_peel((git_object **)&head, head_ref, GIT_OBJECT_COMMIT));
@@ -141,11 +141,11 @@ void test_revert_workdir__orphan(void)
{ 0100644, "296a6d3be1dff05c5d1f631d2459389fa7b619eb", 0, "file-mainline.txt" },
};
- git_oid_fromstr(&head_oid, "39467716290f6df775a91cdb9a4eb39295018145");
+ git_oid_fromstr(&head_oid, "39467716290f6df775a91cdb9a4eb39295018145", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL));
- git_oid_fromstr(&revert_oid, "ebb03002cee5d66c7732dd06241119fe72ab96a5");
+ git_oid_fromstr(&revert_oid, "ebb03002cee5d66c7732dd06241119fe72ab96a5", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &revert_oid));
cl_git_pass(git_revert(repo, commit, NULL));
@@ -224,11 +224,11 @@ void test_revert_workdir__again_after_automerge(void)
{ 0100644, "0f5bfcf58c558d865da6be0281d7795993646cee", 0, "file6.txt" },
};
- git_oid_fromstr(&head_oid, "72333f47d4e83616630ff3b0ffe4c0faebcc3c45");
+ git_oid_fromstr(&head_oid, "72333f47d4e83616630ff3b0ffe4c0faebcc3c45", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL));
- git_oid_fromstr(&revert_oid, "d1d403d22cbe24592d725f442835cf46fe60c8ac");
+ git_oid_fromstr(&revert_oid, "d1d403d22cbe24592d725f442835cf46fe60c8ac", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &revert_oid));
cl_git_pass(git_revert(repo, commit, NULL));
@@ -272,11 +272,11 @@ void test_revert_workdir__again_after_edit(void)
cl_git_pass(git_repository_head(&head_ref, repo));
- cl_git_pass(git_oid_fromstr(&orig_head_oid, "399fb3aba3d9d13f7d40a9254ce4402067ef3149"));
+ cl_git_pass(git_oid_fromstr(&orig_head_oid, "399fb3aba3d9d13f7d40a9254ce4402067ef3149", GIT_OID_SHA1));
cl_git_pass(git_commit_lookup(&orig_head, repo, &orig_head_oid));
cl_git_pass(git_reset(repo, (git_object *)orig_head, GIT_RESET_HARD, NULL));
- cl_git_pass(git_oid_fromstr(&revert_oid, "2d440f2b3147d3dc7ad1085813478d6d869d5a4d"));
+ cl_git_pass(git_oid_fromstr(&revert_oid, "2d440f2b3147d3dc7ad1085813478d6d869d5a4d", GIT_OID_SHA1));
cl_git_pass(git_commit_lookup(&commit, repo, &revert_oid));
cl_git_pass(git_revert(repo, commit, NULL));
@@ -321,11 +321,11 @@ void test_revert_workdir__again_after_edit_two(void)
cl_git_pass(git_repository_config(&config, repo));
cl_git_pass(git_config_set_bool(config, "core.autocrlf", 0));
- cl_git_pass(git_oid_fromstr(&head_commit_oid, "75ec9929465623f17ff3ad68c0438ea56faba815"));
+ cl_git_pass(git_oid_fromstr(&head_commit_oid, "75ec9929465623f17ff3ad68c0438ea56faba815", GIT_OID_SHA1));
cl_git_pass(git_commit_lookup(&head_commit, repo, &head_commit_oid));
cl_git_pass(git_reset(repo, (git_object *)head_commit, GIT_RESET_HARD, NULL));
- cl_git_pass(git_oid_fromstr(&revert_commit_oid, "97e52d5e81f541080cd6b92829fb85bc4d81d90b"));
+ cl_git_pass(git_oid_fromstr(&revert_commit_oid, "97e52d5e81f541080cd6b92829fb85bc4d81d90b", GIT_OID_SHA1));
cl_git_pass(git_commit_lookup(&revert_commit, repo, &revert_commit_oid));
cl_git_pass(git_revert(repo, revert_commit, NULL));
@@ -376,11 +376,11 @@ void test_revert_workdir__conflict_use_ours(void)
opts.checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_USE_OURS;
- git_oid_fromstr(&head_oid, "72333f47d4e83616630ff3b0ffe4c0faebcc3c45");
+ git_oid_fromstr(&head_oid, "72333f47d4e83616630ff3b0ffe4c0faebcc3c45", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL));
- git_oid_fromstr(&revert_oid, "d1d403d22cbe24592d725f442835cf46fe60c8ac");
+ git_oid_fromstr(&revert_oid, "d1d403d22cbe24592d725f442835cf46fe60c8ac", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &revert_oid));
cl_git_pass(git_revert(repo, commit, &opts));
@@ -412,11 +412,11 @@ void test_revert_workdir__rename_1_of_2(void)
opts.merge_opts.flags |= GIT_MERGE_FIND_RENAMES;
opts.merge_opts.rename_threshold = 50;
- git_oid_fromstr(&head_oid, "cef56612d71a6af8d8015691e4865f7fece905b5");
+ git_oid_fromstr(&head_oid, "cef56612d71a6af8d8015691e4865f7fece905b5", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL));
- git_oid_fromstr(&revert_oid, "55568c8de5322ff9a95d72747a239cdb64a19965");
+ git_oid_fromstr(&revert_oid, "55568c8de5322ff9a95d72747a239cdb64a19965", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &revert_oid));
cl_git_pass(git_revert(repo, commit, &opts));
@@ -446,11 +446,11 @@ void test_revert_workdir__rename(void)
opts.merge_opts.flags |= GIT_MERGE_FIND_RENAMES;
opts.merge_opts.rename_threshold = 50;
- git_oid_fromstr(&head_oid, "55568c8de5322ff9a95d72747a239cdb64a19965");
+ git_oid_fromstr(&head_oid, "55568c8de5322ff9a95d72747a239cdb64a19965", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL));
- git_oid_fromstr(&revert_oid, "0aa8c7e40d342fff78d60b29a4ba8e993ed79c51");
+ git_oid_fromstr(&revert_oid, "0aa8c7e40d342fff78d60b29a4ba8e993ed79c51", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &revert_oid));
cl_git_pass(git_revert(repo, commit, &opts));
@@ -512,7 +512,7 @@ void test_revert_workdir__merge_fails_without_mainline_specified(void)
git_commit *head;
git_oid head_oid;
- git_oid_fromstr(&head_oid, "5acdc74af27172ec491d213ee36cea7eb9ef2579");
+ git_oid_fromstr(&head_oid, "5acdc74af27172ec491d213ee36cea7eb9ef2579", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL));
@@ -539,7 +539,7 @@ void test_revert_workdir__merge_first_parent(void)
opts.mainline = 1;
- git_oid_fromstr(&head_oid, "5acdc74af27172ec491d213ee36cea7eb9ef2579");
+ git_oid_fromstr(&head_oid, "5acdc74af27172ec491d213ee36cea7eb9ef2579", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL));
@@ -564,7 +564,7 @@ void test_revert_workdir__merge_second_parent(void)
opts.mainline = 2;
- git_oid_fromstr(&head_oid, "5acdc74af27172ec491d213ee36cea7eb9ef2579");
+ git_oid_fromstr(&head_oid, "5acdc74af27172ec491d213ee36cea7eb9ef2579", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL));
diff --git a/tests/libgit2/revwalk/basic.c b/tests/libgit2/revwalk/basic.c
index 358f577..88447a9 100644
--- a/tests/libgit2/revwalk/basic.c
+++ b/tests/libgit2/revwalk/basic.c
@@ -139,7 +139,7 @@ void test_revwalk_basic__sorting_modes(void)
revwalk_basic_setup_walk(NULL);
- git_oid_fromstr(&id, commit_head);
+ git_oid_fromstr(&id, commit_head, GIT_OID_SHA1);
cl_git_pass(test_walk(_walk, &id, GIT_SORT_TIME, commit_sorting_time, 1));
cl_git_pass(test_walk(_walk, &id, GIT_SORT_TOPOLOGICAL, commit_sorting_topo, 2));
@@ -204,7 +204,7 @@ void test_revwalk_basic__sorted_after_reset(void)
revwalk_basic_setup_walk(NULL);
- git_oid_fromstr(&oid, commit_head);
+ git_oid_fromstr(&oid, commit_head, GIT_OID_SHA1);
/* push, sort, and test the walk */
cl_git_pass(git_revwalk_push(_walk, &oid));
@@ -282,7 +282,7 @@ void test_revwalk_basic__multiple_push_1(void)
cl_git_pass(git_revwalk_hide_ref(_walk, "refs/heads/packed-test"));
- cl_git_pass(git_oid_fromstr(&oid, "5b5b025afb0b4c913b4c338a42934a3863bf3644"));
+ cl_git_pass(git_oid_fromstr(&oid, "5b5b025afb0b4c913b4c338a42934a3863bf3644", GIT_OID_SHA1));
cl_git_pass(git_revwalk_push(_walk, &oid));
while (git_revwalk_next(&oid, _walk) == 0)
@@ -316,7 +316,7 @@ void test_revwalk_basic__multiple_push_2(void)
revwalk_basic_setup_walk(NULL);
- cl_git_pass(git_oid_fromstr(&oid, "5b5b025afb0b4c913b4c338a42934a3863bf3644"));
+ cl_git_pass(git_oid_fromstr(&oid, "5b5b025afb0b4c913b4c338a42934a3863bf3644", GIT_OID_SHA1));
cl_git_pass(git_revwalk_push(_walk, &oid));
cl_git_pass(git_revwalk_hide_ref(_walk, "refs/heads/packed-test"));
@@ -335,7 +335,7 @@ void test_revwalk_basic__disallow_non_commit(void)
revwalk_basic_setup_walk(NULL);
- cl_git_pass(git_oid_fromstr(&oid, "521d87c1ec3aef9824daf6d96cc0ae3710766d91"));
+ cl_git_pass(git_oid_fromstr(&oid, "521d87c1ec3aef9824daf6d96cc0ae3710766d91", GIT_OID_SHA1));
cl_git_fail(git_revwalk_push(_walk, &oid));
}
@@ -345,7 +345,7 @@ void test_revwalk_basic__hide_then_push(void)
int i = 0;
revwalk_basic_setup_walk(NULL);
- cl_git_pass(git_oid_fromstr(&oid, "5b5b025afb0b4c913b4c338a42934a3863bf3644"));
+ cl_git_pass(git_oid_fromstr(&oid, "5b5b025afb0b4c913b4c338a42934a3863bf3644", GIT_OID_SHA1));
cl_git_pass(git_revwalk_hide(_walk, &oid));
cl_git_pass(git_revwalk_push(_walk, &oid));
@@ -359,7 +359,7 @@ void test_revwalk_basic__hide_then_push(void)
void test_revwalk_basic__topo_crash(void)
{
git_oid oid;
- git_oid_fromstr(&oid, "5b5b025afb0b4c913b4c338a42934a3863bf3644");
+ git_oid_fromstr(&oid, "5b5b025afb0b4c913b4c338a42934a3863bf3644", GIT_OID_SHA1);
revwalk_basic_setup_walk(NULL);
git_revwalk_sorting(_walk, GIT_SORT_TOPOLOGICAL);
@@ -378,8 +378,8 @@ void test_revwalk_basic__from_new_to_old(void)
revwalk_basic_setup_walk(NULL);
git_revwalk_sorting(_walk, GIT_SORT_TIME);
- cl_git_pass(git_oid_fromstr(&to_oid, "5b5b025afb0b4c913b4c338a42934a3863bf3644"));
- cl_git_pass(git_oid_fromstr(&from_oid, "a4a7dce85cf63874e984719f4fdd239f5145052f"));
+ cl_git_pass(git_oid_fromstr(&to_oid, "5b5b025afb0b4c913b4c338a42934a3863bf3644", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&from_oid, "a4a7dce85cf63874e984719f4fdd239f5145052f", GIT_OID_SHA1));
cl_git_pass(git_revwalk_push(_walk, &to_oid));
cl_git_pass(git_revwalk_hide(_walk, &from_oid));
@@ -479,7 +479,7 @@ void test_revwalk_basic__mimic_git_rev_list(void)
cl_git_pass(git_revwalk_push_ref(_walk, "refs/heads/br2"));
cl_git_pass(git_revwalk_push_ref(_walk, "refs/heads/master"));
- cl_git_pass(git_oid_fromstr(&oid, "e90810b8df3e80c413d903f631643c716887138d"));
+ cl_git_pass(git_oid_fromstr(&oid, "e90810b8df3e80c413d903f631643c716887138d", GIT_OID_SHA1));
cl_git_pass(git_revwalk_push(_walk, &oid));
cl_git_pass(git_revwalk_next(&oid, _walk));
@@ -563,10 +563,10 @@ void test_revwalk_basic__old_hidden_commit_one(void)
revwalk_basic_setup_walk("testrepo.git");
- cl_git_pass(git_oid_fromstr(&new_id, "bd758010071961f28336333bc41e9c64c9a64866"));
+ cl_git_pass(git_oid_fromstr(&new_id, "bd758010071961f28336333bc41e9c64c9a64866", GIT_OID_SHA1));
cl_git_pass(git_revwalk_push(_walk, &new_id));
- cl_git_pass(git_oid_fromstr(&old_id, "8e73b769e97678d684b809b163bebdae2911720f"));
+ cl_git_pass(git_oid_fromstr(&old_id, "8e73b769e97678d684b809b163bebdae2911720f", GIT_OID_SHA1));
cl_git_pass(git_revwalk_hide(_walk, &old_id));
cl_git_pass(git_revwalk_next(&oid, _walk));
@@ -587,10 +587,10 @@ void test_revwalk_basic__old_hidden_commit_two(void)
revwalk_basic_setup_walk("testrepo.git");
- cl_git_pass(git_oid_fromstr(&new_id, "bd758010071961f28336333bc41e9c64c9a64866"));
+ cl_git_pass(git_oid_fromstr(&new_id, "bd758010071961f28336333bc41e9c64c9a64866", GIT_OID_SHA1));
cl_git_pass(git_revwalk_push(_walk, &new_id));
- cl_git_pass(git_oid_fromstr(&old_id, "b91e763008b10db366442469339f90a2b8400d0a"));
+ cl_git_pass(git_oid_fromstr(&old_id, "b91e763008b10db366442469339f90a2b8400d0a", GIT_OID_SHA1));
cl_git_pass(git_revwalk_hide(_walk, &old_id));
cl_git_pass(git_revwalk_next(&oid, _walk));
diff --git a/tests/libgit2/revwalk/hidecb.c b/tests/libgit2/revwalk/hidecb.c
index 54315bc..5099047 100644
--- a/tests/libgit2/revwalk/hidecb.c
+++ b/tests/libgit2/revwalk/hidecb.c
@@ -32,10 +32,10 @@ void test_revwalk_hidecb__initialize(void)
int i;
cl_git_pass(git_repository_open(&_repo, cl_fixture("testrepo.git")));
- cl_git_pass(git_oid_fromstr(&_head_id, commit_head));
+ cl_git_pass(git_oid_fromstr(&_head_id, commit_head, GIT_OID_SHA1));
for (i = 0; i < commit_count; i++)
- cl_git_pass(git_oid_fromstr(&commit_ids[i], commit_strs[i]));
+ cl_git_pass(git_oid_fromstr(&commit_ids[i], commit_strs[i], GIT_OID_SHA1));
}
diff --git a/tests/libgit2/revwalk/mergebase.c b/tests/libgit2/revwalk/mergebase.c
index 0378c86..52e37b1 100644
--- a/tests/libgit2/revwalk/mergebase.c
+++ b/tests/libgit2/revwalk/mergebase.c
@@ -25,9 +25,9 @@ void test_revwalk_mergebase__single1(void)
git_oid result, one, two, expected;
size_t ahead, behind;
- cl_git_pass(git_oid_fromstr(&one, "c47800c7266a2be04c571c04d5a6614691ea99bd "));
- cl_git_pass(git_oid_fromstr(&two, "9fd738e8f7967c078dceed8190330fc8648ee56a"));
- cl_git_pass(git_oid_fromstr(&expected, "5b5b025afb0b4c913b4c338a42934a3863bf3644"));
+ cl_git_pass(git_oid_fromstr(&one, "c47800c7266a2be04c571c04d5a6614691ea99bd ", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&two, "9fd738e8f7967c078dceed8190330fc8648ee56a", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&expected, "5b5b025afb0b4c913b4c338a42934a3863bf3644", GIT_OID_SHA1));
cl_git_pass(git_merge_base(&result, _repo, &one, &two));
cl_assert_equal_oid(&expected, &result);
@@ -46,9 +46,9 @@ void test_revwalk_mergebase__single2(void)
git_oid result, one, two, expected;
size_t ahead, behind;
- cl_git_pass(git_oid_fromstr(&one, "763d71aadf09a7951596c9746c024e7eece7c7af"));
- cl_git_pass(git_oid_fromstr(&two, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750"));
- cl_git_pass(git_oid_fromstr(&expected, "c47800c7266a2be04c571c04d5a6614691ea99bd"));
+ cl_git_pass(git_oid_fromstr(&one, "763d71aadf09a7951596c9746c024e7eece7c7af", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&two, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&expected, "c47800c7266a2be04c571c04d5a6614691ea99bd", GIT_OID_SHA1));
cl_git_pass(git_merge_base(&result, _repo, &one, &two));
cl_assert_equal_oid(&expected, &result);
@@ -67,9 +67,9 @@ void test_revwalk_mergebase__merged_branch(void)
git_oid result, one, two, expected;
size_t ahead, behind;
- cl_git_pass(git_oid_fromstr(&one, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750"));
- cl_git_pass(git_oid_fromstr(&two, "9fd738e8f7967c078dceed8190330fc8648ee56a"));
- cl_git_pass(git_oid_fromstr(&expected, "9fd738e8f7967c078dceed8190330fc8648ee56a"));
+ cl_git_pass(git_oid_fromstr(&one, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&two, "9fd738e8f7967c078dceed8190330fc8648ee56a", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&expected, "9fd738e8f7967c078dceed8190330fc8648ee56a", GIT_OID_SHA1));
cl_git_pass(git_merge_base(&result, _repo, &one, &two));
cl_assert_equal_oid(&expected, &result);
@@ -91,8 +91,8 @@ void test_revwalk_mergebase__two_way_merge(void)
git_oid one, two;
size_t ahead, behind;
- cl_git_pass(git_oid_fromstr(&one, "9b219343610c88a1187c996d0dc58330b55cee28"));
- cl_git_pass(git_oid_fromstr(&two, "a953a018c5b10b20c86e69fef55ebc8ad4c5a417"));
+ cl_git_pass(git_oid_fromstr(&one, "9b219343610c88a1187c996d0dc58330b55cee28", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&two, "a953a018c5b10b20c86e69fef55ebc8ad4c5a417", GIT_OID_SHA1));
cl_git_pass(git_graph_ahead_behind(&ahead, &behind, _repo2, &one, &two));
cl_assert_equal_sz(ahead, 8);
@@ -110,8 +110,8 @@ void test_revwalk_mergebase__no_common_ancestor_returns_ENOTFOUND(void)
size_t ahead, behind;
int error;
- cl_git_pass(git_oid_fromstr(&one, "763d71aadf09a7951596c9746c024e7eece7c7af"));
- cl_git_pass(git_oid_fromstr(&two, "e90810b8df3e80c413d903f631643c716887138d"));
+ cl_git_pass(git_oid_fromstr(&one, "763d71aadf09a7951596c9746c024e7eece7c7af", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&two, "e90810b8df3e80c413d903f631643c716887138d", GIT_OID_SHA1));
error = git_merge_base(&result, _repo, &one, &two);
cl_git_fail(error);
@@ -127,9 +127,9 @@ void test_revwalk_mergebase__prefer_youngest_merge_base(void)
{
git_oid result, one, two, expected;
- cl_git_pass(git_oid_fromstr(&one, "a4a7dce85cf63874e984719f4fdd239f5145052f"));
- cl_git_pass(git_oid_fromstr(&two, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644"));
- cl_git_pass(git_oid_fromstr(&expected, "c47800c7266a2be04c571c04d5a6614691ea99bd"));
+ cl_git_pass(git_oid_fromstr(&one, "a4a7dce85cf63874e984719f4fdd239f5145052f", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&two, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&expected, "c47800c7266a2be04c571c04d5a6614691ea99bd", GIT_OID_SHA1));
cl_git_pass(git_merge_base(&result, _repo, &one, &two));
cl_assert_equal_oid(&expected, &result);
@@ -140,10 +140,10 @@ void test_revwalk_mergebase__multiple_merge_bases(void)
git_oid one, two, expected1, expected2;
git_oidarray result = {NULL, 0};
- cl_git_pass(git_oid_fromstr(&one, "a4a7dce85cf63874e984719f4fdd239f5145052f"));
- cl_git_pass(git_oid_fromstr(&two, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644"));
- cl_git_pass(git_oid_fromstr(&expected1, "c47800c7266a2be04c571c04d5a6614691ea99bd"));
- cl_git_pass(git_oid_fromstr(&expected2, "9fd738e8f7967c078dceed8190330fc8648ee56a"));
+ cl_git_pass(git_oid_fromstr(&one, "a4a7dce85cf63874e984719f4fdd239f5145052f", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&two, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&expected1, "c47800c7266a2be04c571c04d5a6614691ea99bd", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&expected2, "9fd738e8f7967c078dceed8190330fc8648ee56a", GIT_OID_SHA1));
cl_git_pass(git_merge_bases(&result, _repo, &one, &two));
cl_assert_equal_i(2, result.count);
@@ -160,10 +160,10 @@ void test_revwalk_mergebase__multiple_merge_bases_many_commits(void)
git_oid *input = git__malloc(sizeof(git_oid) * 2);
- cl_git_pass(git_oid_fromstr(&input[0], "a4a7dce85cf63874e984719f4fdd239f5145052f"));
- cl_git_pass(git_oid_fromstr(&input[1], "be3563ae3f795b2b4353bcce3a527ad0a4f7f644"));
- cl_git_pass(git_oid_fromstr(&expected1, "c47800c7266a2be04c571c04d5a6614691ea99bd"));
- cl_git_pass(git_oid_fromstr(&expected2, "9fd738e8f7967c078dceed8190330fc8648ee56a"));
+ cl_git_pass(git_oid_fromstr(&input[0], "a4a7dce85cf63874e984719f4fdd239f5145052f", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&input[1], "be3563ae3f795b2b4353bcce3a527ad0a4f7f644", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&expected1, "c47800c7266a2be04c571c04d5a6614691ea99bd", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&expected2, "9fd738e8f7967c078dceed8190330fc8648ee56a", GIT_OID_SHA1));
cl_git_pass(git_merge_bases_many(&result, _repo, 2, input));
cl_assert_equal_i(2, result.count);
@@ -178,8 +178,8 @@ void test_revwalk_mergebase__no_off_by_one_missing(void)
{
git_oid result, one, two;
- cl_git_pass(git_oid_fromstr(&one, "1a443023183e3f2bfbef8ac923cd81c1018a18fd"));
- cl_git_pass(git_oid_fromstr(&two, "9f13f7d0a9402c681f91dc590cf7b5470e6a77d2"));
+ cl_git_pass(git_oid_fromstr(&one, "1a443023183e3f2bfbef8ac923cd81c1018a18fd", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&two, "9f13f7d0a9402c681f91dc590cf7b5470e6a77d2", GIT_OID_SHA1));
cl_git_pass(git_merge_base(&result, _repo, &one, &two));
}
@@ -201,7 +201,7 @@ static void assert_mergebase_many(const char *expected_sha, int count, ...)
for (i = 0; i < count; ++i) {
partial_oid = va_arg(ap, char *);
- cl_git_pass(git_oid_fromstrn(&oid, partial_oid, strlen(partial_oid)));
+ cl_git_pass(git_oid_fromstrn(&oid, partial_oid, strlen(partial_oid), GIT_OID_SHA1));
cl_git_pass(git_object_lookup_prefix(&object, _repo, &oid, strlen(partial_oid), GIT_OBJECT_COMMIT));
git_oid_cpy(&oids[i], git_object_id(object));
@@ -214,7 +214,7 @@ static void assert_mergebase_many(const char *expected_sha, int count, ...)
cl_assert_equal_i(GIT_ENOTFOUND, git_merge_base_many(&oid, _repo, count, oids));
else {
cl_git_pass(git_merge_base_many(&oid, _repo, count, oids));
- cl_git_pass(git_oid_fromstr(&expected, expected_sha));
+ cl_git_pass(git_oid_fromstr(&expected, expected_sha, GIT_OID_SHA1));
cl_assert_equal_oid(&expected, &oid);
}
@@ -265,7 +265,7 @@ static void assert_mergebase_octopus(const char *expected_sha, int count, ...)
for (i = 0; i < count; ++i) {
partial_oid = va_arg(ap, char *);
- cl_git_pass(git_oid_fromstrn(&oid, partial_oid, strlen(partial_oid)));
+ cl_git_pass(git_oid_fromstrn(&oid, partial_oid, strlen(partial_oid), GIT_OID_SHA1));
cl_git_pass(git_object_lookup_prefix(&object, _repo, &oid, strlen(partial_oid), GIT_OBJECT_COMMIT));
git_oid_cpy(&oids[i], git_object_id(object));
@@ -278,7 +278,7 @@ static void assert_mergebase_octopus(const char *expected_sha, int count, ...)
cl_assert_equal_i(GIT_ENOTFOUND, git_merge_base_octopus(&oid, _repo, count, oids));
else {
cl_git_pass(git_merge_base_octopus(&oid, _repo, count, oids));
- cl_git_pass(git_oid_fromstr(&expected, expected_sha));
+ cl_git_pass(git_oid_fromstr(&expected, expected_sha, GIT_OID_SHA1));
cl_assert_equal_oid(&expected, &oid);
}
@@ -501,9 +501,9 @@ void test_revwalk_mergebase__remove_redundant(void)
cl_git_pass(git_repository_open(&repo, cl_fixture("redundant.git")));
- cl_git_pass(git_oid_fromstr(&one, "d89137c93ba1ee749214ff4ce52ae9137bc833f9"));
- cl_git_pass(git_oid_fromstr(&two, "91f4b95df4a59504a9813ba66912562931d990e3"));
- cl_git_pass(git_oid_fromstr(&base, "6cb1f2352d974e1c5a776093017e8772416ac97a"));
+ cl_git_pass(git_oid_fromstr(&one, "d89137c93ba1ee749214ff4ce52ae9137bc833f9", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&two, "91f4b95df4a59504a9813ba66912562931d990e3", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&base, "6cb1f2352d974e1c5a776093017e8772416ac97a", GIT_OID_SHA1));
cl_git_pass(git_merge_bases(&result, repo, &one, &two));
cl_assert_equal_i(1, result.count);
diff --git a/tests/libgit2/revwalk/simplify.c b/tests/libgit2/revwalk/simplify.c
index 6dd068a..fb7b900 100644
--- a/tests/libgit2/revwalk/simplify.c
+++ b/tests/libgit2/revwalk/simplify.c
@@ -32,13 +32,13 @@ void test_revwalk_simplify__first_parent(void)
int i, error;
for (i = 0; i < 4; i++) {
- git_oid_fromstr(&expected[i], expected_str[i]);
+ git_oid_fromstr(&expected[i], expected_str[i], GIT_OID_SHA1);
}
repo = cl_git_sandbox_init("testrepo.git");
cl_git_pass(git_revwalk_new(&walk, repo));
- git_oid_fromstr(&id, commit_head);
+ git_oid_fromstr(&id, commit_head, GIT_OID_SHA1);
cl_git_pass(git_revwalk_push(walk, &id));
git_revwalk_sorting(walk, GIT_SORT_TOPOLOGICAL);
git_revwalk_simplify_first_parent(walk);
diff --git a/tests/libgit2/status/single.c b/tests/libgit2/status/single.c
index e7f9209..a95d3d0 100644
--- a/tests/libgit2/status/single.c
+++ b/tests/libgit2/status/single.c
@@ -17,7 +17,7 @@ void test_status_single__hash_single_file(void)
git_oid expected_id, actual_id;
/* initialization */
- git_oid_fromstr(&expected_id, file_hash);
+ git_oid_fromstr(&expected_id, file_hash, GIT_OID_SHA1);
cl_git_mkfile(file_name, file_contents);
cl_set_cleanup(&cleanup__remove_file, (void *)file_name);
@@ -35,7 +35,7 @@ void test_status_single__hash_single_empty_file(void)
git_oid expected_id, actual_id;
/* initialization */
- git_oid_fromstr(&expected_id, file_hash);
+ git_oid_fromstr(&expected_id, file_hash, GIT_OID_SHA1);
cl_git_mkfile(file_name, file_contents);
cl_set_cleanup(&cleanup__remove_file, (void *)file_name);
diff --git a/tests/libgit2/status/submodules.c b/tests/libgit2/status/submodules.c
index d223657..e4e1f1b 100644
--- a/tests/libgit2/status/submodules.c
+++ b/tests/libgit2/status/submodules.c
@@ -142,7 +142,7 @@ void test_status_submodules__moved_head(void)
/* move submodule HEAD to c47800c7266a2be04c571c04d5a6614691ea99bd */
cl_git_pass(
- git_oid_fromstr(&oid, "c47800c7266a2be04c571c04d5a6614691ea99bd"));
+ git_oid_fromstr(&oid, "c47800c7266a2be04c571c04d5a6614691ea99bd", GIT_OID_SHA1));
cl_git_pass(git_repository_set_head_detached(smrepo, &oid));
/* first do a normal status, which should now include the submodule */
diff --git a/tests/libgit2/status/worktree.c b/tests/libgit2/status/worktree.c
index 5bd3987..a3c2e67 100644
--- a/tests/libgit2/status/worktree.c
+++ b/tests/libgit2/status/worktree.c
@@ -516,17 +516,20 @@ void test_status_worktree__conflict_with_diff3(void)
ancestor_entry.path = "modified_file";
ancestor_entry.mode = 0100644;
git_oid_fromstr(&ancestor_entry.id,
- "452e4244b5d083ddf0460acf1ecc74db9dcfa11a");
+ "452e4244b5d083ddf0460acf1ecc74db9dcfa11a",
+ GIT_OID_SHA1);
our_entry.path = "modified_file";
our_entry.mode = 0100644;
git_oid_fromstr(&our_entry.id,
- "452e4244b5d083ddf0460acf1ecc74db9dcfa11a");
+ "452e4244b5d083ddf0460acf1ecc74db9dcfa11a",
+ GIT_OID_SHA1);
their_entry.path = "modified_file";
their_entry.mode = 0100644;
git_oid_fromstr(&their_entry.id,
- "452e4244b5d083ddf0460acf1ecc74db9dcfa11a");
+ "452e4244b5d083ddf0460acf1ecc74db9dcfa11a",
+ GIT_OID_SHA1);
cl_git_pass(git_status_file(&status, repo, "modified_file"));
cl_assert_equal_i(GIT_STATUS_WT_MODIFIED, status);
@@ -712,17 +715,20 @@ void test_status_worktree__conflicted_item(void)
ancestor_entry.mode = 0100644;
ancestor_entry.path = "modified_file";
git_oid_fromstr(&ancestor_entry.id,
- "452e4244b5d083ddf0460acf1ecc74db9dcfa11a");
+ "452e4244b5d083ddf0460acf1ecc74db9dcfa11a",
+ GIT_OID_SHA1);
our_entry.mode = 0100644;
our_entry.path = "modified_file";
git_oid_fromstr(&our_entry.id,
- "452e4244b5d083ddf0460acf1ecc74db9dcfa11a");
+ "452e4244b5d083ddf0460acf1ecc74db9dcfa11a",
+ GIT_OID_SHA1);
their_entry.mode = 0100644;
their_entry.path = "modified_file";
git_oid_fromstr(&their_entry.id,
- "452e4244b5d083ddf0460acf1ecc74db9dcfa11a");
+ "452e4244b5d083ddf0460acf1ecc74db9dcfa11a",
+ GIT_OID_SHA1);
cl_git_pass(git_status_file(&status, repo, "modified_file"));
cl_assert_equal_i(GIT_STATUS_WT_MODIFIED, status);
@@ -748,7 +754,7 @@ void test_status_worktree__conflict_has_no_oid(void)
entry.mode = 0100644;
entry.path = "modified_file";
- git_oid_fromstr(&entry.id, "452e4244b5d083ddf0460acf1ecc74db9dcfa11a");
+ git_oid_fromstr(&entry.id, "452e4244b5d083ddf0460acf1ecc74db9dcfa11a", GIT_OID_SHA1);
cl_git_pass(git_repository_index(&index, repo));
cl_git_pass(git_index_conflict_add(index, &entry, &entry, &entry));
diff --git a/tests/libgit2/submodule/add.c b/tests/libgit2/submodule/add.c
index ae5507d..5219611 100644
--- a/tests/libgit2/submodule/add.c
+++ b/tests/libgit2/submodule/add.c
@@ -139,7 +139,7 @@ static void test_add_entry(
{
git_index_entry entry = {{0}};
- cl_git_pass(git_oid_fromstr(&entry.id, idstr));
+ cl_git_pass(git_oid_fromstr(&entry.id, idstr, GIT_OID_SHA1));
entry.path = path;
entry.mode = mode;
diff --git a/tests/libgit2/transports/smart/packet.c b/tests/libgit2/transports/smart/packet.c
index 5b623a3..422f830 100644
--- a/tests/libgit2/transports/smart/packet.c
+++ b/tests/libgit2/transports/smart/packet.c
@@ -68,7 +68,7 @@ static void assert_ack_parses(const char *line, const char *expected_oid, enum g
git_pkt_ack *pkt;
git_oid oid;
- cl_git_pass(git_oid_fromstr(&oid, expected_oid));
+ cl_git_pass(git_oid_fromstr(&oid, expected_oid, GIT_OID_SHA1));
cl_git_pass(git_pkt_parse_line((git_pkt **) &pkt, &endptr, line, linelen));
cl_assert_equal_i(pkt->type, GIT_PKT_ACK);
@@ -154,7 +154,7 @@ static void assert_ref_parses_(const char *line, size_t linelen, const char *exp
git_pkt_ref *pkt;
git_oid oid;
- cl_git_pass(git_oid_fromstr(&oid, expected_oid));
+ cl_git_pass(git_oid_fromstr(&oid, expected_oid, GIT_OID_SHA1));
cl_git_pass(git_pkt_parse_line((git_pkt **) &pkt, &endptr, line, linelen));
cl_assert_equal_i(pkt->type, GIT_PKT_REF);
diff --git a/tests/libgit2/win32/forbidden.c b/tests/libgit2/win32/forbidden.c
index 5c00798..0500a80 100644
--- a/tests/libgit2/win32/forbidden.c
+++ b/tests/libgit2/win32/forbidden.c
@@ -37,7 +37,7 @@ void test_win32_forbidden__can_add_forbidden_filename_with_entry(void)
entry.path = "aux";
entry.mode = GIT_FILEMODE_BLOB;
- git_oid_fromstr(&entry.id, "da623abd956bb2fd8052c708c7ed43f05d192d37");
+ git_oid_fromstr(&entry.id, "da623abd956bb2fd8052c708c7ed43f05d192d37", GIT_OID_SHA1);
cl_git_pass(git_index_add(index, &entry));
@@ -53,7 +53,7 @@ void test_win32_forbidden__cannot_add_dot_git_even_with_entry(void)
entry.path = "foo/.git";
entry.mode = GIT_FILEMODE_BLOB;
- git_oid_fromstr(&entry.id, "da623abd956bb2fd8052c708c7ed43f05d192d37");
+ git_oid_fromstr(&entry.id, "da623abd956bb2fd8052c708c7ed43f05d192d37", GIT_OID_SHA1);
cl_git_fail(git_index_add(index, &entry));