Merge pull request #4436 from pks-t/pks/packfile-stream-free pack: rename `git_packfile_stream_free`
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 8309 8310 8311 8312 8313 8314 8315 8316 8317 8318 8319 8320 8321 8322 8323 8324 8325 8326 8327 8328 8329 8330 8331 8332 8333 8334 8335 8336 8337 8338 8339 8340 8341 8342 8343 8344 8345 8346 8347 8348 8349 8350 8351 8352 8353 8354 8355 8356 8357 8358 8359 8360 8361 8362 8363 8364 8365 8366 8367 8368 8369 8370 8371 8372 8373 8374 8375 8376 8377 8378 8379 8380 8381 8382 8383 8384 8385 8386 8387 8388 8389 8390 8391 8392 8393 8394 8395 8396 8397 8398 8399 8400 8401 8402 8403 8404 8405 8406 8407 8408 8409 8410 8411 8412 8413 8414 8415 8416 8417 8418 8419 8420 8421 8422 8423 8424 8425 8426 8427 8428 8429 8430 8431 8432 8433 8434 8435 8436 8437 8438 8439 8440 8441 8442 8443 8444 8445 8446 8447 8448 8449 8450 8451 8452 8453 8454 8455 8456 8457 8458 8459 8460 8461 8462 8463 8464 8465 8466 8467 8468 8469 8470 8471 8472 8473 8474 8475 8476 8477 8478 8479 8480 8481 8482 8483 8484 8485 8486 8487 8488 8489 8490 8491 8492 8493 8494 8495 8496 8497 8498 8499 8500 8501 8502 8503 8504 8505 8506 8507 8508 8509 8510 8511 8512 8513 8514 8515 8516 8517 8518 8519 8520 8521 8522 8523 8524 8525 8526 8527 8528 8529 8530 8531 8532 8533 8534 8535 8536 8537 8538 8539 8540 8541 8542 8543 8544 8545 8546 8547 8548 8549 8550 8551 8552 8553 8554 8555 8556 8557 8558 8559 8560 8561 8562 8563 8564 8565 8566 8567 8568 8569 8570 8571 8572 8573 8574 8575 8576 8577 8578 8579 8580 8581 8582 8583 8584 8585 8586 8587 8588 8589 8590 8591 8592 8593 8594 8595 8596 8597 8598 8599 8600 8601 8602 8603 8604 8605 8606 8607 8608 8609 8610 8611 8612 8613 8614 8615 8616 8617 8618 8619 8620 8621 8622 8623 8624 8625 8626 8627 8628 8629 8630 8631 8632 8633 8634 8635 8636 8637 8638 8639 8640 8641 8642 8643 8644 8645 8646 8647 8648 8649 8650 8651 8652 8653 8654 8655 8656 8657 8658 8659 8660 8661 8662 8663 8664 8665 8666 8667 8668 8669 8670 8671 8672 8673 8674 8675 8676 8677 8678 8679 8680 8681 8682 8683 8684 8685 8686 8687 8688 8689 8690 8691 8692 8693 8694 8695 8696 8697 8698 8699 8700 8701 8702 8703 8704 8705 8706 8707 8708 8709 8710 8711 8712 8713 8714 8715 8716 8717 8718 8719 8720 8721 8722 8723 8724 8725 8726 8727 8728 8729 8730 8731 8732 8733 8734 8735 8736 8737 8738 8739 8740 8741 8742 8743 8744 8745 8746 8747 8748 8749 8750 8751 8752 8753 8754 8755 8756 8757 8758 8759 8760 8761 8762 8763 8764 8765 8766 8767 8768 8769 8770 8771 8772 8773 8774 8775 8776 8777 8778 8779 8780 8781 8782 8783 8784 8785 8786 8787 8788 8789 8790 8791 8792 8793 8794 8795 8796 8797 8798 8799 8800 8801 8802 8803 8804 8805 8806 8807 8808 8809 8810 8811 8812 8813 8814 8815 8816 8817 8818 8819 8820 8821 8822 8823 8824 8825 8826 8827 8828 8829 8830 8831 8832 8833 8834 8835 8836 8837 8838 8839 8840 8841 8842 8843 8844 8845 8846 8847 8848 8849 8850 8851 8852 8853 8854 8855 8856 8857 8858 8859 8860 8861 8862 8863 8864 8865 8866 8867 8868 8869 8870 8871 8872 8873 8874 8875 8876 8877 8878 8879 8880 8881 8882 8883 8884 8885 8886 8887 8888 8889 8890 8891 8892 8893 8894 8895 8896 8897 8898 8899 8900 8901 8902 8903 8904 8905 8906 8907 8908 8909 8910 8911 8912 8913 8914 8915 8916 8917 8918 8919 8920 8921 8922 8923 8924 8925 8926 8927 8928 8929 8930 8931 8932 8933 8934 8935 8936 8937 8938 8939 8940 8941 8942 8943 8944 8945 8946 8947 8948 8949 8950 8951 8952 8953 8954 8955 8956 8957 8958 8959 8960 8961 8962 8963 8964 8965 8966 8967 8968 8969 8970 8971 8972 8973 8974 8975 8976 8977 8978 8979 8980 8981 8982 8983 8984 8985 8986 8987 8988 8989 8990 8991 8992 8993 8994 8995 8996 8997 8998 8999 9000 9001 9002 9003 9004 9005 9006 9007 9008 9009 9010 9011 9012 9013 9014 9015 9016 9017 9018 9019 9020 9021 9022 9023 9024 9025
diff --git a/examples/diff.c b/examples/diff.c
index 9a4f7a5..1de0483 100644
--- a/examples/diff.c
+++ b/examples/diff.c
@@ -332,6 +332,6 @@ static void diff_print_stats(git_diff *diff, struct opts *o)
fputs(b.ptr, stdout);
- git_buf_free(&b);
+ git_buf_dispose(&b);
git_diff_stats_free(stats);
}
diff --git a/examples/remote.c b/examples/remote.c
index e0d5a14..1cb61cc 100644
--- a/examples/remote.c
+++ b/examples/remote.c
@@ -64,7 +64,7 @@ int main(int argc, char *argv[])
check_lg2(git_repository_open(&repo, buf.ptr),
"Could not open repository", NULL);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
switch (opt.cmd)
{
diff --git a/examples/tag.c b/examples/tag.c
index c6a70d9..29a04c4 100644
--- a/examples/tag.c
+++ b/examples/tag.c
@@ -184,7 +184,7 @@ static void action_delete_tag(tag_state *state)
printf("Deleted tag '%s' (was %s)\n", opts->tag_name, abbrev_oid.ptr);
- git_buf_free(&abbrev_oid);
+ git_buf_dispose(&abbrev_oid);
git_object_free(obj);
}
diff --git a/include/git2/buffer.h b/include/git2/buffer.h
index 9fc6a58..41cd126 100644
--- a/include/git2/buffer.h
+++ b/include/git2/buffer.h
@@ -69,7 +69,19 @@ typedef struct {
*
* @param buffer The buffer to deallocate
*/
-GIT_EXTERN(void) git_buf_free(git_buf *buffer);
+GIT_EXTERN(void) git_buf_dispose(git_buf *buffer);
+
+/**
+ * Alias of `git_buf_dispose`.
+ *
+ * This function is directly calls `git_buf_dispose` now and is deprecated.
+ * Going forward, we refer to functions freeing the internal state of a
+ * structure a `dispose` function, while functions freeing the structure
+ * themselves will be called a `free` function.
+ *
+ * This function is going to be removed in v0.30.0.
+ */
+GIT_EXTERN(void) GIT_DEPRECATED(git_buf_free)(git_buf *buffer);
/**
* Resize the buffer allocation to make more space.
diff --git a/include/git2/common.h b/include/git2/common.h
index f095e59..fc820ca 100644
--- a/include/git2/common.h
+++ b/include/git2/common.h
@@ -48,6 +48,17 @@ typedef size_t size_t;
# define GIT_EXTERN(type) extern type
#endif
+/** Declare a function as deprecated. */
+#if defined(__GNUC__)
+# define GIT_DEPRECATED(func) \
+ __attribute__((deprecated)) \
+ func
+#elif defined(_MSC_VER)
+# define GIT_DEPRECATED(func) __declspec(deprecated) func
+#else
+# define GIT_DEPRECATED(func) func
+#endif
+
/** Declare a function's takes printf style arguments. */
#ifdef __GNUC__
# define GIT_FORMAT_PRINTF(a,b) __attribute__((format (printf, a, b)))
diff --git a/src/apply.c b/src/apply.c
index 7801a0a..8c7bb6b 100644
--- a/src/apply.c
+++ b/src/apply.c
@@ -255,7 +255,7 @@ static int apply_binary_delta(
if (!error && inflated.size != binary_file->inflatedlen) {
error = apply_err("inflated delta does not match expected length");
- git_buf_free(out);
+ git_buf_dispose(out);
}
if (error < 0)
@@ -281,7 +281,7 @@ static int apply_binary_delta(
}
done:
- git_buf_free(&inflated);
+ git_buf_dispose(&inflated);
return error;
}
@@ -320,9 +320,9 @@ static int apply_binary(
done:
if (error < 0)
- git_buf_free(out);
+ git_buf_dispose(out);
- git_buf_free(&reverse);
+ git_buf_dispose(&reverse);
return error;
}
diff --git a/src/attr.c b/src/attr.c
index 93d9551..9950e6f 100644
--- a/src/attr.c
+++ b/src/attr.c
@@ -298,7 +298,7 @@ static int system_attr_file(
/* We can safely provide a git_buf with no allocation (asize == 0) to
* a consumer. This allows them to treat this as a regular `git_buf`,
- * but their call to `git_buf_free` will not attempt to free it.
+ * but their call to `git_buf_dispose` will not attempt to free it.
*/
git_buf_attach_notowned(
out, attr_session->sysdir.ptr, attr_session->sysdir.size);
@@ -359,7 +359,7 @@ static int attr_setup(git_repository *repo, git_attr_session *attr_session)
attr_session->init_setup = 1;
out:
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
@@ -565,8 +565,8 @@ static int collect_attr_files(
cleanup:
if (error < 0)
release_attr_files(files);
- git_buf_free(&attrfile);
- git_buf_free(&dir);
+ git_buf_dispose(&attrfile);
+ git_buf_dispose(&dir);
return error;
}
diff --git a/src/attr_file.c b/src/attr_file.c
index 6821587..f433755 100644
--- a/src/attr_file.c
+++ b/src/attr_file.c
@@ -178,7 +178,7 @@ int git_attr_file__load(
cleanup:
git_blob_free(blob);
- git_buf_free(&content);
+ git_buf_dispose(&content);
return error;
}
@@ -348,7 +348,7 @@ int git_attr_file__load_standalone(git_attr_file **out, const char *path)
if (!(error = git_futils_readbuffer(&content, path))) {
error = git_attr_file__parse_buffer(NULL, file, content.ptr);
- git_buf_free(&content);
+ git_buf_dispose(&content);
}
if (error < 0)
@@ -518,7 +518,7 @@ int git_attr_path__init(
void git_attr_path__free(git_attr_path *info)
{
- git_buf_free(&info->full);
+ git_buf_dispose(&info->full);
info->path = NULL;
info->basename = NULL;
}
@@ -876,8 +876,8 @@ void git_attr_session__free(git_attr_session *session)
if (!session)
return;
- git_buf_free(&session->sysdir);
- git_buf_free(&session->tmp);
+ git_buf_dispose(&session->sysdir);
+ git_buf_dispose(&session->tmp);
memset(session, 0, sizeof(git_attr_session));
}
diff --git a/src/attrcache.c b/src/attrcache.c
index 65e7b46..bb7e587 100644
--- a/src/attrcache.c
+++ b/src/attrcache.c
@@ -204,7 +204,7 @@ cleanup:
*out_file = file;
*out_entry = entry;
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
@@ -310,7 +310,7 @@ static int attr_cache__lookup_path(
}
git_config_entry_free(entry);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
diff --git a/src/blob.c b/src/blob.c
index 3396fe7..86ec95c 100644
--- a/src/blob.c
+++ b/src/blob.c
@@ -126,7 +126,7 @@ static int write_file_filtered(
error = git_odb_write(id, odb, tgt.ptr, tgt.size, GIT_OBJ_BLOB);
}
- git_buf_free(&tgt);
+ git_buf_dispose(&tgt);
return error;
}
@@ -238,7 +238,7 @@ int git_blob__create_from_paths(
done:
git_odb_free(odb);
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
@@ -257,7 +257,7 @@ int git_blob_create_fromdisk(
const char *workdir, *hintpath;
if ((error = git_path_prettify(&full_path, path, NULL)) < 0) {
- git_buf_free(&full_path);
+ git_buf_dispose(&full_path);
return error;
}
@@ -270,7 +270,7 @@ int git_blob_create_fromdisk(
error = git_blob__create_from_paths(
id, NULL, repo, git_buf_cstr(&full_path), hintpath, 0, true);
- git_buf_free(&full_path);
+ git_buf_dispose(&full_path);
return error;
}
@@ -340,7 +340,7 @@ cleanup:
if (error < 0)
blob_writestream_free((git_writestream *) stream);
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
diff --git a/src/branch.c b/src/branch.c
index 42addc2..e72d470 100644
--- a/src/branch.c
+++ b/src/branch.c
@@ -40,7 +40,7 @@ static int retrieve_branch_reference(
*branch_reference_out = branch; /* will be NULL on error */
- git_buf_free(&ref_name);
+ git_buf_dispose(&ref_name);
return error;
}
@@ -108,8 +108,8 @@ static int create_branch(
*ref_out = branch;
cleanup:
- git_buf_free(&canonical_branch_name);
- git_buf_free(&log_message);
+ git_buf_dispose(&canonical_branch_name);
+ git_buf_dispose(&log_message);
return error;
}
@@ -199,7 +199,7 @@ int git_branch_delete(git_reference *branch)
error = git_reference_delete(branch);
on_error:
- git_buf_free(&config_section);
+ git_buf_dispose(&config_section);
return error;
}
@@ -310,10 +310,10 @@ int git_branch_move(
git_buf_cstr(&new_config_section));
done:
- git_buf_free(&new_reference_name);
- git_buf_free(&old_config_section);
- git_buf_free(&new_config_section);
- git_buf_free(&log_message);
+ git_buf_dispose(&new_reference_name);
+ git_buf_dispose(&old_config_section);
+ git_buf_dispose(&new_config_section);
+ git_buf_dispose(&log_message);
return error;
}
@@ -366,7 +366,7 @@ static int retrieve_upstream_configuration(
return -1;
error = git_config_get_string_buf(out, config, git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
@@ -429,9 +429,9 @@ int git_branch_upstream_name(
cleanup:
git_config_free(config);
git_remote_free(remote);
- git_buf_free(&remote_name);
- git_buf_free(&merge_name);
- git_buf_free(&buf);
+ git_buf_dispose(&remote_name);
+ git_buf_dispose(&merge_name);
+ git_buf_dispose(&buf);
return error;
}
@@ -522,7 +522,7 @@ int git_branch_remote_name(git_buf *buf, git_repository *repo, const char *refna
cleanup:
if (error < 0)
- git_buf_free(buf);
+ git_buf_dispose(buf);
git_strarray_free(&remote_list);
return error;
@@ -544,7 +544,7 @@ int git_branch_upstream(
git_reference_owner(branch),
git_buf_cstr(&tracking_name));
- git_buf_free(&tracking_name);
+ git_buf_dispose(&tracking_name);
return error;
}
@@ -565,11 +565,11 @@ static int unset_upstream(git_config *config, const char *shortname)
if (git_config_delete_entry(config, git_buf_cstr(&buf)) < 0)
goto on_error;
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return 0;
on_error:
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return -1;
}
@@ -655,15 +655,15 @@ int git_branch_set_upstream(git_reference *branch, const char *upstream_name)
goto on_error;
git_reference_free(upstream);
- git_buf_free(&key);
- git_buf_free(&value);
+ git_buf_dispose(&key);
+ git_buf_dispose(&value);
return 0;
on_error:
git_reference_free(upstream);
- git_buf_free(&key);
- git_buf_free(&value);
+ git_buf_dispose(&key);
+ git_buf_dispose(&value);
git_remote_free(remote);
return -1;
diff --git a/src/buffer.c b/src/buffer.c
index 8a58d1a..1361bc0 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -116,7 +116,7 @@ int git_buf_grow_by(git_buf *buffer, size_t additional_size)
return git_buf_try_grow(buffer, newsize, true);
}
-void git_buf_free(git_buf *buf)
+void git_buf_dispose(git_buf *buf)
{
if (!buf) return;
@@ -126,6 +126,11 @@ void git_buf_free(git_buf *buf)
git_buf_init(buf, 0);
}
+void git_buf_free(git_buf *buf)
+{
+ git_buf_dispose(buf);
+}
+
void git_buf_sanitize(git_buf *buf)
{
if (buf->ptr == NULL) {
@@ -610,7 +615,7 @@ char *git_buf_detach(git_buf *buf)
int git_buf_attach(git_buf *buf, char *ptr, size_t asize)
{
- git_buf_free(buf);
+ git_buf_dispose(buf);
if (ptr) {
buf->ptr = ptr;
@@ -628,7 +633,7 @@ int git_buf_attach(git_buf *buf, char *ptr, size_t asize)
void git_buf_attach_notowned(git_buf *buf, const char *ptr, size_t size)
{
if (git_buf_is_allocated(buf))
- git_buf_free(buf);
+ git_buf_dispose(buf);
if (!size) {
git_buf_init(buf, 0);
@@ -949,7 +954,7 @@ int git_buf_quote(git_buf *buf)
git_buf_swap("ed, buf);
done:
- git_buf_free("ed);
+ git_buf_dispose("ed);
return error;
}
diff --git a/src/checkout.c b/src/checkout.c
index debdbe9..c6936bf 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -1604,7 +1604,7 @@ static int blob_content_to_link(
st->st_mode = GIT_FILEMODE_LINK;
}
- git_buf_free(&linktarget);
+ git_buf_dispose(&linktarget);
return error;
}
@@ -2161,13 +2161,13 @@ static int checkout_write_merge(
done:
git_filter_list_free(fl);
- git_buf_free(&out_data);
- git_buf_free(&our_label);
- git_buf_free(&their_label);
+ git_buf_dispose(&out_data);
+ git_buf_dispose(&our_label);
+ git_buf_dispose(&their_label);
git_merge_file_result_free(&result);
- git_buf_free(&path_workdir);
- git_buf_free(&path_suffixed);
+ git_buf_dispose(&path_workdir);
+ git_buf_dispose(&path_suffixed);
return error;
}
@@ -2347,8 +2347,8 @@ static void checkout_data_clear(checkout_data *data)
git__free(data->pfx);
data->pfx = NULL;
- git_buf_free(&data->target_path);
- git_buf_free(&data->tmp);
+ git_buf_dispose(&data->target_path);
+ git_buf_dispose(&data->tmp);
git_index_free(data->index);
data->index = NULL;
diff --git a/src/cherrypick.c b/src/cherrypick.c
index e42b748..b61ce31 100644
--- a/src/cherrypick.c
+++ b/src/cherrypick.c
@@ -37,7 +37,7 @@ static int write_cherrypick_head(
if (error < 0)
git_filebuf_cleanup(&file);
- git_buf_free(&file_path);
+ git_buf_dispose(&file_path);
return error;
}
@@ -61,7 +61,7 @@ cleanup:
if (error < 0)
git_filebuf_cleanup(&file);
- git_buf_free(&file_path);
+ git_buf_dispose(&file_path);
return error;
}
@@ -216,7 +216,7 @@ done:
git_index_free(index);
git_commit_free(our_commit);
git_reference_free(our_ref);
- git_buf_free(&their_label);
+ git_buf_dispose(&their_label);
return error;
}
diff --git a/src/clone.c b/src/clone.c
index 8764bb7..e2bf320 100644
--- a/src/clone.c
+++ b/src/clone.c
@@ -48,7 +48,7 @@ static int create_branch(
return error;
error = git_reference_create(&branch_ref, repo, git_buf_cstr(&refname), target, 0, log_message);
- git_buf_free(&refname);
+ git_buf_dispose(&refname);
git_commit_free(head_obj);
if (!error)
@@ -87,8 +87,8 @@ static int setup_tracking_config(
error = 0;
cleanup:
- git_buf_free(&remote_key);
- git_buf_free(&merge_key);
+ git_buf_dispose(&remote_key);
+ git_buf_dispose(&merge_key);
return error;
}
@@ -195,8 +195,8 @@ static int update_head_to_remote(
reflog_message);
cleanup:
- git_buf_free(&remote_master_name);
- git_buf_free(&branch);
+ git_buf_dispose(&remote_master_name);
+ git_buf_dispose(&branch);
return error;
}
@@ -225,7 +225,7 @@ static int update_head_to_branch(
cleanup:
git_reference_free(remote_ref);
- git_buf_free(&remote_branch_name);
+ git_buf_dispose(&remote_branch_name);
return retcode;
}
@@ -351,7 +351,7 @@ static int clone_into(git_repository *repo, git_remote *_remote, const git_fetch
cleanup:
git_remote_free(remote);
- git_buf_free(&reflog_message);
+ git_buf_dispose(&reflog_message);
return error;
}
@@ -378,7 +378,7 @@ int git_clone__should_clone_local(const char *url_or_path, git_clone_local_t loc
git_path_isdir(path);
done:
- git_buf_free(&fromurl);
+ git_buf_dispose(&fromurl);
return is_local;
}
@@ -510,7 +510,7 @@ static int clone_local_into(git_repository *repo, git_remote *remote, const git_
/* Copy .git/objects/ from the source to the target */
if ((error = git_repository_open(&src, git_buf_cstr(&src_path))) < 0) {
- git_buf_free(&src_path);
+ git_buf_dispose(&src_path);
return error;
}
@@ -549,10 +549,10 @@ static int clone_local_into(git_repository *repo, git_remote *remote, const git_
error = checkout_branch(repo, remote, co_opts, branch, git_buf_cstr(&reflog_message));
cleanup:
- git_buf_free(&reflog_message);
- git_buf_free(&src_path);
- git_buf_free(&src_odb);
- git_buf_free(&dst_odb);
+ git_buf_dispose(&reflog_message);
+ git_buf_dispose(&src_path);
+ git_buf_dispose(&src_odb);
+ git_buf_dispose(&dst_odb);
git_repository_free(src);
return error;
}
diff --git a/src/commit.c b/src/commit.c
index 838688b..e0c090a 100644
--- a/src/commit.c
+++ b/src/commit.c
@@ -74,7 +74,7 @@ static int git_commit__create_buffer_internal(
return 0;
on_error:
- git_buf_free(out);
+ git_buf_dispose(out);
return -1;
}
@@ -176,7 +176,7 @@ static int git_commit__create_internal(
cleanup:
git_array_clear(parents);
git_reference_free(ref);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
@@ -886,6 +886,6 @@ int git_commit_create_with_signature(
goto cleanup;
cleanup:
- git_buf_free(&commit);
+ git_buf_dispose(&commit);
return error;
}
diff --git a/src/config.c b/src/config.c
index 1bc11b9..03473af 100644
--- a/src/config.c
+++ b/src/config.c
@@ -1164,7 +1164,7 @@ int git_config_open_default(git_config **out)
error = git_config_add_file_ondisk(cfg, buf.ptr,
GIT_CONFIG_LEVEL_PROGRAMDATA, NULL, 0);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
if (error) {
git_config_free(cfg);
@@ -1478,8 +1478,8 @@ int git_config_rename_section(
config, git_buf_cstr(&pattern), rename_config_entries_cb, &data);
cleanup:
- git_buf_free(&pattern);
- git_buf_free(&replace);
+ git_buf_dispose(&pattern);
+ git_buf_dispose(&replace);
return error;
}
diff --git a/src/config_file.c b/src/config_file.c
index 6c65208..90255c9 100644
--- a/src/config_file.c
+++ b/src/config_file.c
@@ -300,7 +300,7 @@ static int config_is_modified(int *modified, struct config_file *file)
}
out:
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
@@ -688,7 +688,7 @@ static int config_unlock(git_config_backend *_cfg, int success)
}
git_filebuf_cleanup(&cfg->locked_buf);
- git_buf_free(&cfg->locked_content);
+ git_buf_dispose(&cfg->locked_content);
cfg->locked = false;
return error;
@@ -877,7 +877,7 @@ static char *escape_value(const char *ptr)
}
if (git_buf_oom(&buf)) {
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return NULL;
}
@@ -956,7 +956,7 @@ static int do_match_gitdir(
*matches = (error == 0);
out:
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
@@ -1111,7 +1111,7 @@ static int config_read(
error = git_config_parse(&reader, NULL, read_on_variable, NULL, NULL, &parse_data);
out:
- git_buf_free(&contents);
+ git_buf_dispose(&contents);
return error;
}
@@ -1140,7 +1140,7 @@ static int write_section(git_buf *fbuf, const char *key)
return -1;
result = git_buf_put(fbuf, git_buf_cstr(&buf), buf.size);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return result;
}
@@ -1359,7 +1359,7 @@ static int config_write(diskfile_backend *cfg, const char *orig_key, const char
/* Lock the file */
if ((result = git_filebuf_open(
&file, cfg->file.path, GIT_FILEBUF_HASH_CONTENTS, GIT_CONFIG_FILE_MODE)) < 0) {
- git_buf_free(&contents);
+ git_buf_dispose(&contents);
return result;
}
@@ -1404,7 +1404,7 @@ static int config_write(diskfile_backend *cfg, const char *orig_key, const char
&write_data);
git__free(section);
git__free(orig_section);
- git_buf_free(&write_data.buffered_comment);
+ git_buf_dispose(&write_data.buffered_comment);
if (result < 0) {
git_filebuf_cleanup(&file);
@@ -1414,7 +1414,7 @@ static int config_write(diskfile_backend *cfg, const char *orig_key, const char
if (cfg->locked) {
size_t len = buf.asize;
/* Update our copy with the modified contents */
- git_buf_free(&cfg->locked_content);
+ git_buf_dispose(&cfg->locked_content);
git_buf_attach(&cfg->locked_content, git_buf_detach(&buf), len);
} else {
git_filebuf_write(&file, git_buf_cstr(&buf), git_buf_len(&buf));
@@ -1422,8 +1422,8 @@ static int config_write(diskfile_backend *cfg, const char *orig_key, const char
}
done:
- git_buf_free(&buf);
- git_buf_free(&contents);
+ git_buf_dispose(&buf);
+ git_buf_dispose(&contents);
git_parse_ctx_clear(&reader.ctx);
return result;
}
diff --git a/src/config_parse.c b/src/config_parse.c
index 149550d..66ac432 100644
--- a/src/config_parse.c
+++ b/src/config_parse.c
@@ -130,7 +130,7 @@ end_parse:
if (line[rpos] != '"' || line[rpos + 1] != ']') {
set_parse_error(reader, rpos, "Unexpected text after closing quotes");
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return -1;
}
@@ -138,7 +138,7 @@ end_parse:
return 0;
end_error:
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return -1;
}
@@ -437,7 +437,7 @@ static int parse_variable(git_config_parser *reader, char **var_name, char **var
if (parse_multiline_variable(reader, &multi_value, quote_count) < 0 ||
git_buf_oom(&multi_value)) {
- git_buf_free(&multi_value);
+ git_buf_dispose(&multi_value);
goto on_error;
}
diff --git a/src/diff.c b/src/diff.c
index c7a6528..c93e36b 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -439,7 +439,7 @@ static int file_cb(
goto out;
out:
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
@@ -477,7 +477,7 @@ static int line_cb(
goto out;
out:
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
diff --git a/src/diff_driver.c b/src/diff_driver.c
index 7114b06..f75efb1 100644
--- a/src/diff_driver.c
+++ b/src/diff_driver.c
@@ -121,7 +121,7 @@ static int diff_driver_add_patterns(
if (error && pat != NULL)
(void)git_array_pop(drv->fn_patterns); /* release last item */
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
/* We want to ignore bad patterns, so return success regardless */
return 0;
@@ -338,7 +338,7 @@ static int git_diff_driver_load(
done:
git_config_entry_free(ce);
- git_buf_free(&name);
+ git_buf_dispose(&name);
git_config_free(cfg);
if (!*out) {
@@ -516,7 +516,7 @@ void git_diff_find_context_init(
void git_diff_find_context_clear(git_diff_find_context_payload *payload)
{
if (payload) {
- git_buf_free(&payload->line);
+ git_buf_dispose(&payload->line);
payload->driver = NULL;
}
}
diff --git a/src/diff_file.c b/src/diff_file.c
index 5bb9c37..b98995d 100644
--- a/src/diff_file.c
+++ b/src/diff_file.c
@@ -280,7 +280,7 @@ static int diff_file_content_load_workdir_symlink_fake(
fc->map.data = git_buf_detach(&target);
fc->flags |= GIT_DIFF_FLAG__FREE_DATA;
- git_buf_free(&target);
+ git_buf_dispose(&target);
return error;
}
@@ -361,7 +361,7 @@ static int diff_file_content_load_workdir_file(
error = git_filter_list_apply_to_data(&out, fl, &raw);
if (out.ptr != raw.ptr)
- git_buf_free(&raw);
+ git_buf_dispose(&raw);
if (!error) {
fc->map.len = out.size;
@@ -406,7 +406,7 @@ static int diff_file_content_load_workdir(
fc->file->flags |= GIT_DIFF_FLAG_VALID_ID;
}
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
diff --git a/src/diff_generate.c b/src/diff_generate.c
index 0105c17..539269a 100644
--- a/src/diff_generate.c
+++ b/src/diff_generate.c
@@ -601,7 +601,7 @@ int git_diff__oid_for_entry(
if (p_stat(full_path.ptr, &st) < 0) {
error = git_path_set_error(errno, entry.path, "stat");
- git_buf_free(&full_path);
+ git_buf_dispose(&full_path);
return error;
}
@@ -664,7 +664,7 @@ int git_diff__oid_for_entry(
}
}
- git_buf_free(&full_path);
+ git_buf_dispose(&full_path);
return error;
}
diff --git a/src/diff_print.c b/src/diff_print.c
index 5e53548..090b4e8 100644
--- a/src/diff_print.c
+++ b/src/diff_print.c
@@ -373,8 +373,8 @@ int diff_delta_format_similarity_header(
error = -1;
done:
- git_buf_free(&old_path);
- git_buf_free(&new_path);
+ git_buf_dispose(&old_path);
+ git_buf_dispose(&new_path);
return error;
}
@@ -446,8 +446,8 @@ int git_diff_delta__format_file_header(
error = -1;
done:
- git_buf_free(&old_path);
- git_buf_free(&new_path);
+ git_buf_dispose(&old_path);
+ git_buf_dispose(&new_path);
return error;
}
@@ -509,8 +509,8 @@ static int diff_print_patch_file_binary_noshow(
old_path.ptr, new_path.ptr);
done:
- git_buf_free(&old_path);
- git_buf_free(&new_path);
+ git_buf_dispose(&old_path);
+ git_buf_dispose(&new_path);
return error;
}
@@ -696,7 +696,7 @@ int git_diff_print(
giterr_set_after_callback_function(error, "git_diff_print");
}
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
@@ -776,7 +776,7 @@ int git_patch_print(
giterr_set_after_callback_function(error, "git_patch_print");
}
- git_buf_free(&temp);
+ git_buf_dispose(&temp);
return error;
}
diff --git a/src/diff_tform.c b/src/diff_tform.c
index bc664dd..7133065 100644
--- a/src/diff_tform.c
+++ b/src/diff_tform.c
@@ -529,7 +529,7 @@ static void similarity_unload(similarity_info *info)
if (info->blob)
git_blob_free(info->blob);
else
- git_buf_free(&info->data);
+ git_buf_dispose(&info->data);
}
#define FLAG_SET(opts,flag_name) (((opts)->flags & flag_name) != 0)
diff --git a/src/fetchhead.c b/src/fetchhead.c
index e55e7c8..e710216 100644
--- a/src/fetchhead.c
+++ b/src/fetchhead.c
@@ -119,11 +119,11 @@ int git_fetchhead_write(git_repository *repo, git_vector *fetchhead_refs)
return -1;
if (git_filebuf_open(&file, path.ptr, GIT_FILEBUF_APPEND, GIT_REFS_FILE_MODE) < 0) {
- git_buf_free(&path);
+ git_buf_dispose(&path);
return -1;
}
- git_buf_free(&path);
+ git_buf_dispose(&path);
git_vector_sort(fetchhead_refs);
@@ -283,9 +283,9 @@ int git_repository_fetchhead_foreach(git_repository *repo,
}
done:
- git_buf_free(&file);
- git_buf_free(&path);
- git_buf_free(&name);
+ git_buf_dispose(&file);
+ git_buf_dispose(&path);
+ git_buf_dispose(&name);
return error;
}
diff --git a/src/filebuf.c b/src/filebuf.c
index 8b7e489..401910c 100644
--- a/src/filebuf.c
+++ b/src/filebuf.c
@@ -256,7 +256,7 @@ static int resolve_symlink(git_buf *out, const char *path)
goto cleanup;
git_buf_swap(&curpath, &dir);
- git_buf_free(&dir);
+ git_buf_dispose(&dir);
if ((error = git_path_apply_relative(&curpath, target.ptr)) < 0)
goto cleanup;
@@ -267,8 +267,8 @@ static int resolve_symlink(git_buf *out, const char *path)
error = -1;
cleanup:
- git_buf_free(&curpath);
- git_buf_free(&target);
+ git_buf_dispose(&curpath);
+ git_buf_dispose(&target);
return error;
}
@@ -343,7 +343,7 @@ int git_filebuf_open_withsize(git_filebuf *file, const char *path, int flags, mo
file->fd = git_futils_mktmp(&tmp_path, path, mode);
if (file->fd < 0) {
- git_buf_free(&tmp_path);
+ git_buf_dispose(&tmp_path);
goto cleanup;
}
file->fd_is_open = true;
diff --git a/src/fileops.c b/src/fileops.c
index 58988c2..b1a9f03 100644
--- a/src/fileops.c
+++ b/src/fileops.c
@@ -159,7 +159,7 @@ int git_futils_readbuffer_fd(git_buf *buf, git_file fd, size_t len)
if (read_size != (ssize_t)len) {
giterr_set(GITERR_OS, "failed to read descriptor");
- git_buf_free(buf);
+ git_buf_dispose(buf);
return -1;
}
@@ -209,7 +209,7 @@ int git_futils_readbuffer_updated(
if (checksum) {
if ((error = git_hash_buf(&checksum_new, buf.ptr, buf.size)) < 0) {
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
@@ -217,7 +217,7 @@ int git_futils_readbuffer_updated(
* If we were given a checksum, we only want to use it if it's different
*/
if (!git_oid__cmp(checksum, &checksum_new)) {
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
if (updated)
*updated = 0;
@@ -234,7 +234,7 @@ int git_futils_readbuffer_updated(
*updated = 1;
git_buf_swap(out, &buf);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return 0;
}
@@ -526,8 +526,8 @@ int git_futils_mkdir(
parent_path.size ? parent_path.ptr : NULL, mode, flags, &opts);
done:
- git_buf_free(&make_path);
- git_buf_free(&parent_path);
+ git_buf_dispose(&make_path);
+ git_buf_dispose(&parent_path);
return error;
}
@@ -661,7 +661,7 @@ retry_lstat:
}
done:
- git_buf_free(&make_path);
+ git_buf_dispose(&make_path);
return error;
}
@@ -822,7 +822,7 @@ int git_futils_rmdir_r(
error = 0;
}
- git_buf_free(&fullpath);
+ git_buf_dispose(&fullpath);
return error;
}
@@ -1081,8 +1081,8 @@ int git_futils_cp_r(
error = _cp_r_callback(&info, &path);
- git_buf_free(&path);
- git_buf_free(&info.to);
+ git_buf_dispose(&path);
+ git_buf_dispose(&info.to);
return error;
}
diff --git a/src/filter.c b/src/filter.c
index 6ab0979..cf8fe7d 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -841,8 +841,8 @@ static void proxy_stream_free(git_writestream *s)
struct proxy_stream *proxy_stream = (struct proxy_stream *)s;
assert(proxy_stream);
- git_buf_free(&proxy_stream->input);
- git_buf_free(&proxy_stream->temp_buf);
+ git_buf_dispose(&proxy_stream->input);
+ git_buf_dispose(&proxy_stream->temp_buf);
git__free(proxy_stream);
}
@@ -977,7 +977,7 @@ done:
if (fd >= 0)
p_close(fd);
stream_list_free(&filter_streams);
- git_buf_free(&abspath);
+ git_buf_dispose(&abspath);
return error;
}
diff --git a/src/ignore.c b/src/ignore.c
index 3b68e14..e1d5fc9 100644
--- a/src/ignore.c
+++ b/src/ignore.c
@@ -158,7 +158,7 @@ static int does_negate_rule(int *out, git_vector *rules, git_attr_fnmatch *match
out:
git__free(path);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
@@ -315,7 +315,7 @@ int git_ignore__for_path(
(error = git_path_to_dir(&local)) < 0 ||
(error = git_buf_joinpath(&ignores->dir, workdir, local.ptr)) < 0)
{;} /* Nothing, we just want to stop on the first error */
- git_buf_free(&local);
+ git_buf_dispose(&local);
} else {
error = git_buf_joinpath(&ignores->dir, path, "");
}
@@ -355,7 +355,7 @@ int git_ignore__for_path(
git_repository_attr_cache(repo)->cfg_excl_file);
cleanup:
- git_buf_free(&infopath);
+ git_buf_dispose(&infopath);
if (error < 0)
git_ignore__free(ignores);
@@ -427,7 +427,7 @@ void git_ignore__free(git_ignores *ignores)
}
git_vector_free(&ignores->ign_global);
- git_buf_free(&ignores->dir);
+ git_buf_dispose(&ignores->dir);
}
static bool ignore_lookup_in_rules(
@@ -632,7 +632,7 @@ int git_ignore__check_pathspec_for_exact_ignores(
}
git_index_free(idx);
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
diff --git a/src/index.c b/src/index.c
index 18853f3..67c844c 100644
--- a/src/index.c
+++ b/src/index.c
@@ -668,7 +668,7 @@ int git_index_read(git_index *index, int force)
if (!error)
git_futils_filestamp_set(&index->stamp, &stamp);
- git_buf_free(&buffer);
+ git_buf_dispose(&buffer);
return error;
}
@@ -949,7 +949,7 @@ static int index_entry_init(
return -1;
error = git_path_lstat(path.ptr, &st);
- git_buf_free(&path);
+ git_buf_dispose(&path);
if (error < 0)
return error;
@@ -1509,7 +1509,7 @@ static int add_repo_as_submodule(git_index_entry **out, git_index *index, const
git_reference_free(head);
git_repository_free(sub);
- git_buf_free(&abspath);
+ git_buf_dispose(&abspath);
*out = entry;
return 0;
@@ -1693,7 +1693,7 @@ int git_index_remove_directory(git_index *index, const char *dir, int stage)
/* removed entry at 'pos' so we don't need to increment */
}
- git_buf_free(&pfx);
+ git_buf_dispose(&pfx);
return error;
}
@@ -2819,7 +2819,7 @@ static int write_name_extension(git_index *index, git_filebuf *file)
error = write_extension(file, &extension, &name_buf);
- git_buf_free(&name_buf);
+ git_buf_dispose(&name_buf);
done:
return error;
@@ -2867,7 +2867,7 @@ static int write_reuc_extension(git_index *index, git_filebuf *file)
error = write_extension(file, &extension, &reuc_buf);
- git_buf_free(&reuc_buf);
+ git_buf_dispose(&reuc_buf);
done:
return error;
@@ -2891,7 +2891,7 @@ static int write_tree_extension(git_index *index, git_filebuf *file)
error = write_extension(file, &extension, &buf);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
@@ -3008,7 +3008,7 @@ static int read_tree_cb(
}
index_entry_adjust_namemask(entry, path.size);
- git_buf_free(&path);
+ git_buf_dispose(&path);
if (git_vector_insert(data->new_entries, entry) < 0) {
index_entry_free(entry);
@@ -3463,7 +3463,7 @@ static int index_apply_to_all(
}
}
- git_buf_free(&path);
+ git_buf_dispose(&path);
git_pathspec__clear(&ps);
return error;
diff --git a/src/indexer.c b/src/indexer.c
index c0976f2..744a03c 100644
--- a/src/indexer.c
+++ b/src/indexer.c
@@ -134,12 +134,12 @@ int git_indexer_new(
goto cleanup;
fd = git_futils_mktmp(&tmp_path, git_buf_cstr(&path), idx->mode);
- git_buf_free(&path);
+ git_buf_dispose(&path);
if (fd < 0)
goto cleanup;
error = git_packfile_alloc(&idx->pack, git_buf_cstr(&tmp_path));
- git_buf_free(&tmp_path);
+ git_buf_dispose(&tmp_path);
if (error < 0)
goto cleanup;
@@ -161,8 +161,8 @@ cleanup:
if (idx->pack != NULL)
p_unlink(idx->pack->pack_name);
- git_buf_free(&path);
- git_buf_free(&tmp_path);
+ git_buf_dispose(&path);
+ git_buf_dispose(&tmp_path);
git__free(idx);
return -1;
}
@@ -650,7 +650,7 @@ int git_indexer_append(git_indexer *idx, const void *data, size_t size, git_tran
/* We want to free the stream reasorces no matter what here */
idx->have_stream = 0;
- git_packfile_stream_free(stream);
+ git_packfile_stream_dispose(stream);
if (error < 0)
goto on_error;
@@ -758,7 +758,7 @@ static int inject_object(git_indexer *idx, git_oid *id)
idx->pack->mwf.size += buf.size;
entry->crc = htonl(crc32(entry->crc, (unsigned char *)buf.ptr, (uInt)buf.size));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
/* Write a fake trailer so the pack functions play ball */
@@ -1121,13 +1121,13 @@ int git_indexer_commit(git_indexer *idx, git_transfer_progress *stats)
idx->pack_committed = 1;
- git_buf_free(&filename);
+ git_buf_dispose(&filename);
return 0;
on_error:
git_mwindow_free_all(&idx->pack->mwf);
git_filebuf_cleanup(&index_file);
- git_buf_free(&filename);
+ git_buf_dispose(&filename);
return -1;
}
@@ -1137,7 +1137,7 @@ void git_indexer_free(git_indexer *idx)
return;
if (idx->have_stream)
- git_packfile_stream_free(&idx->stream);
+ git_packfile_stream_dispose(&idx->stream);
git_vector_free_deep(&idx->objects);
diff --git a/src/iterator.c b/src/iterator.c
index ff075ce..6e7300a 100644
--- a/src/iterator.c
+++ b/src/iterator.c
@@ -701,7 +701,7 @@ static void tree_iterator_frame_pop(tree_iterator *iter)
do {
buf = git_array_pop(frame->similar_paths);
- git_buf_free(buf);
+ git_buf_dispose(buf);
} while (buf != NULL);
git_array_clear(frame->similar_paths);
@@ -711,7 +711,7 @@ static void tree_iterator_frame_pop(tree_iterator *iter)
git_vector_free(&frame->similar_trees);
- git_buf_free(&frame->path);
+ git_buf_dispose(&frame->path);
}
static int tree_iterator_current(
@@ -929,7 +929,7 @@ static void tree_iterator_free(git_iterator *i)
tree_iterator_clear(iter);
git_tree_free(iter->root);
- git_buf_free(&iter->entry_path);
+ git_buf_dispose(&iter->entry_path);
}
int git_iterator_for_tree(
@@ -1435,7 +1435,7 @@ done:
if (error < 0)
git_array_pop(iter->frames);
- git_buf_free(&root);
+ git_buf_dispose(&root);
git_path_diriter_free(&diriter);
return error;
}
@@ -1523,7 +1523,7 @@ static int filesystem_iterator_is_dir(
*is_dir = S_ISDIR(st.st_mode);
done:
- git_buf_free(&fullpath);
+ git_buf_dispose(&fullpath);
return error;
}
@@ -1804,7 +1804,7 @@ static void filesystem_iterator_clear(filesystem_iterator *iter)
git_array_clear(iter->frames);
git_ignore__free(&iter->ignores);
- git_buf_free(&iter->tmp_buf);
+ git_buf_dispose(&iter->tmp_buf);
iterator_clear(&iter->base);
}
@@ -1838,7 +1838,7 @@ static void filesystem_iterator_free(git_iterator *i)
{
filesystem_iterator *iter = (filesystem_iterator *)i;
git__free(iter->root);
- git_buf_free(&iter->current_path);
+ git_buf_dispose(&iter->current_path);
git_tree_free(iter->tree);
if (iter->index)
git_index_snapshot_release(&iter->index_snapshot, iter->index);
@@ -2176,7 +2176,7 @@ static void index_iterator_free(git_iterator *i)
index_iterator *iter = (index_iterator *)i;
git_index_snapshot_release(&iter->entries, iter->base.index);
- git_buf_free(&iter->tree_buf);
+ git_buf_dispose(&iter->tree_buf);
}
int git_iterator_for_index(
diff --git a/src/merge.c b/src/merge.c
index 6c98d13..068a23e 100644
--- a/src/merge.c
+++ b/src/merge.c
@@ -599,8 +599,8 @@ int git_repository_mergehead_foreach(
}
cleanup:
- git_buf_free(&merge_head_path);
- git_buf_free(&merge_head_file);
+ git_buf_dispose(&merge_head_path);
+ git_buf_dispose(&merge_head_file);
return error;
}
@@ -875,7 +875,7 @@ static int merge_conflict_invoke_driver(
*out = result;
done:
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_odb_free(odb);
return error;
@@ -2444,7 +2444,7 @@ cleanup:
if (error < 0)
git_filebuf_cleanup(&file);
- git_buf_free(&file_path);
+ git_buf_dispose(&file_path);
return error;
}
@@ -2470,7 +2470,7 @@ cleanup:
if (error < 0)
git_filebuf_cleanup(&file);
- git_buf_free(&file_path);
+ git_buf_dispose(&file_path);
return error;
}
@@ -2770,7 +2770,7 @@ cleanup:
if (error < 0)
git_filebuf_cleanup(&file);
- git_buf_free(&file_path);
+ git_buf_dispose(&file_path);
git_vector_free(&matching);
git__free(entries);
@@ -3090,7 +3090,7 @@ cleanup:
if (error < 0)
git_filebuf_cleanup(&file);
- git_buf_free(&file_path);
+ git_buf_dispose(&file_path);
return error;
}
diff --git a/src/netops.c b/src/netops.c
index fa20cba..efcc6c5 100644
--- a/src/netops.c
+++ b/src/netops.c
@@ -292,10 +292,10 @@ int gitno_extract_url_parts(
*password_out = git_buf_detach(&password);
done:
- git_buf_free(&host);
- git_buf_free(&port);
- git_buf_free(&path);
- git_buf_free(&username);
- git_buf_free(&password);
+ git_buf_dispose(&host);
+ git_buf_dispose(&port);
+ git_buf_dispose(&path);
+ git_buf_dispose(&username);
+ git_buf_dispose(&password);
return error;
}
diff --git a/src/notes.c b/src/notes.c
index f63ef36..b4c0122 100644
--- a/src/notes.c
+++ b/src/notes.c
@@ -710,7 +710,7 @@ static int process_entry_path(
error = git_oid_fromstr(annotated_object_id, buf.ptr);
cleanup:
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
diff --git a/src/odb.c b/src/odb.c
index ef9c875..919a951 100644
--- a/src/odb.c
+++ b/src/odb.c
@@ -260,12 +260,12 @@ int git_odb__hashfd_filtered(
error = git_filter_list_apply_to_data(&post, fl, &raw);
- git_buf_free(&raw);
+ git_buf_dispose(&raw);
if (!error)
error = git_odb_hash(out, post.ptr, post.size, type);
- git_buf_free(&post);
+ git_buf_dispose(&post);
}
return error;
@@ -588,12 +588,12 @@ static int load_alternates(git_odb *odb, const char *objects_dir, int alternate_
return -1;
if (git_path_exists(alternates_path.ptr) == false) {
- git_buf_free(&alternates_path);
+ git_buf_dispose(&alternates_path);
return 0;
}
if (git_futils_readbuffer(&alternates_buf, alternates_path.ptr) < 0) {
- git_buf_free(&alternates_path);
+ git_buf_dispose(&alternates_path);
return -1;
}
@@ -619,8 +619,8 @@ static int load_alternates(git_odb *odb, const char *objects_dir, int alternate_
break;
}
- git_buf_free(&alternates_path);
- git_buf_free(&alternates_buf);
+ git_buf_dispose(&alternates_path);
+ git_buf_dispose(&alternates_buf);
return result;
}
@@ -1181,7 +1181,7 @@ static int read_prefix_1(git_odb_object **out, git_odb *db,
git_oid_tostr_s(&found_full_oid));
error = git_odb__error_ambiguous(buf.ptr);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
goto out;
}
diff --git a/src/odb_loose.c b/src/odb_loose.c
index 470421e..c37b1ed 100644
--- a/src/odb_loose.c
+++ b/src/odb_loose.c
@@ -266,7 +266,7 @@ static int read_loose_packlike(git_rawobj *out, git_buf *obj)
out->data = git_buf_detach(&body);
done:
- git_buf_free(&body);
+ git_buf_dispose(&body);
return error;
}
@@ -362,7 +362,7 @@ static int read_loose(git_rawobj *out, git_buf *loc)
error = read_loose_standard(out, &obj);
done:
- git_buf_free(&obj);
+ git_buf_dispose(&obj);
return error;
}
@@ -593,7 +593,7 @@ static int loose_backend__read_header(size_t *len_p, git_otype *type_p, git_odb_
*type_p = raw.type;
}
- git_buf_free(&object_path);
+ git_buf_dispose(&object_path);
return error;
}
@@ -615,7 +615,7 @@ static int loose_backend__read(void **buffer_p, size_t *len_p, git_otype *type_p
*type_p = raw.type;
}
- git_buf_free(&object_path);
+ git_buf_dispose(&object_path);
return error;
}
@@ -653,7 +653,7 @@ static int loose_backend__read_prefix(
*type_p = raw.type;
}
- git_buf_free(&object_path);
+ git_buf_dispose(&object_path);
}
return error;
@@ -668,7 +668,7 @@ static int loose_backend__exists(git_odb_backend *backend, const git_oid *oid)
error = locate_object(&object_path, (loose_backend *)backend, oid);
- git_buf_free(&object_path);
+ git_buf_dispose(&object_path);
return !error;
}
@@ -684,7 +684,7 @@ static int loose_backend__exists_prefix(
error = locate_object_short_oid(
&object_path, out, (loose_backend *)backend, short_id, len);
- git_buf_free(&object_path);
+ git_buf_dispose(&object_path);
return error;
}
@@ -770,7 +770,7 @@ static int loose_backend__foreach(git_odb_backend *_backend, git_odb_foreach_cb
error = git_path_direach(&buf, 0, foreach_cb, &state);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
@@ -789,7 +789,7 @@ static int loose_backend__writestream_finalize(git_odb_stream *_stream, const gi
error = git_filebuf_commit_at(
&stream->fbuf, final_path.ptr);
- git_buf_free(&final_path);
+ git_buf_dispose(&final_path);
return error;
}
@@ -856,7 +856,7 @@ static int loose_backend__writestream(git_odb_stream **stream_out, git_odb_backe
git__free(stream);
stream = NULL;
}
- git_buf_free(&tmp_path);
+ git_buf_dispose(&tmp_path);
*stream_out = (git_odb_stream *)stream;
return !stream ? -1 : 0;
@@ -1035,7 +1035,7 @@ done:
git__free(stream);
}
- git_buf_free(&object_path);
+ git_buf_dispose(&object_path);
return error;
}
@@ -1074,7 +1074,7 @@ static int loose_backend__write(git_odb_backend *_backend, const git_oid *oid, c
cleanup:
if (error < 0)
git_filebuf_cleanup(&fbuf);
- git_buf_free(&final_path);
+ git_buf_dispose(&final_path);
return error;
}
@@ -1090,7 +1090,7 @@ static int loose_backend__freshen(
return -1;
error = git_futils_touch(path.ptr, NULL);
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
diff --git a/src/odb_pack.c b/src/odb_pack.c
index 20aff53..2c30480 100644
--- a/src/odb_pack.c
+++ b/src/odb_pack.c
@@ -346,7 +346,7 @@ static int pack_backend__refresh(git_odb_backend *backend_)
/* reload all packs */
error = git_path_direach(&path, 0, packfile_load__cb, backend);
- git_buf_free(&path);
+ git_buf_dispose(&path);
git_vector_sort(&backend->packs);
return error;
@@ -635,7 +635,7 @@ int git_odb_backend_pack(git_odb_backend **backend_out, const char *objects_dir)
*backend_out = (git_odb_backend *)backend;
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
diff --git a/src/pack-objects.c b/src/pack-objects.c
index e924514..bc5fb2e 100644
--- a/src/pack-objects.c
+++ b/src/pack-objects.c
@@ -1095,7 +1095,7 @@ on_error:
git__free(array[i].data);
}
git__free(array);
- git_buf_free(&zbuf);
+ git_buf_dispose(&zbuf);
return error;
}
@@ -1463,7 +1463,7 @@ int git_packbuilder_insert_tree(git_packbuilder *pb, const git_oid *oid)
error = git_tree_walk(tree, GIT_TREEWALK_PRE, cb_tree_walk, &context);
git_tree_free(tree);
- git_buf_free(&context.buf);
+ git_buf_dispose(&context.buf);
return error;
}
diff --git a/src/pack.c b/src/pack.c
index 9ed3ec1..6f837cd 100644
--- a/src/pack.c
+++ b/src/pack.c
@@ -326,19 +326,19 @@ static int pack_index_open(struct git_pack_file *p)
git_buf_put(&idx_name, p->pack_name, name_len - strlen(".pack"));
git_buf_puts(&idx_name, ".idx");
if (git_buf_oom(&idx_name)) {
- git_buf_free(&idx_name);
+ git_buf_dispose(&idx_name);
return -1;
}
if ((error = git_mutex_lock(&p->lock)) < 0) {
- git_buf_free(&idx_name);
+ git_buf_dispose(&idx_name);
return error;
}
if (p->index_version == -1)
error = pack_index_check(idx_name.ptr, p);
- git_buf_free(&idx_name);
+ git_buf_dispose(&idx_name);
git_mutex_unlock(&p->lock);
@@ -499,7 +499,7 @@ int git_packfile_resolve_header(
if ((error = git_packfile_stream_open(&stream, p, curpos)) < 0)
return error;
error = git_delta_read_header_fromstream(&base_size, size_p, &stream);
- git_packfile_stream_free(&stream);
+ git_packfile_stream_dispose(&stream);
if (error < 0)
return error;
} else {
@@ -840,7 +840,7 @@ ssize_t git_packfile_stream_read(git_packfile_stream *obj, void *buffer, size_t
}
-void git_packfile_stream_free(git_packfile_stream *obj)
+void git_packfile_stream_dispose(git_packfile_stream *obj)
{
inflateEnd(&obj->zstream);
}
diff --git a/src/pack.h b/src/pack.h
index c0ca74f..e1d8d04 100644
--- a/src/pack.h
+++ b/src/pack.h
@@ -144,7 +144,7 @@ int git_packfile_unpack(git_rawobj *obj, struct git_pack_file *p, git_off_t *obj
int git_packfile_stream_open(git_packfile_stream *obj, struct git_pack_file *p, git_off_t curpos);
ssize_t git_packfile_stream_read(git_packfile_stream *obj, void *buffer, size_t len);
-void git_packfile_stream_free(git_packfile_stream *obj);
+void git_packfile_stream_dispose(git_packfile_stream *obj);
git_off_t get_delta_base(struct git_pack_file *p, git_mwindow **w_curs,
git_off_t *curpos, git_otype type,
diff --git a/src/patch.c b/src/patch.c
index 5e32951..15d2ca8 100644
--- a/src/patch.c
+++ b/src/patch.c
@@ -84,7 +84,7 @@ size_t git_patch_size(
else
out += git_buf_len(&file_header);
- git_buf_free(&file_header);
+ git_buf_dispose(&file_header);
}
return out;
diff --git a/src/patch_generate.c b/src/patch_generate.c
index 29cda8b..800d0e2 100644
--- a/src/patch_generate.c
+++ b/src/patch_generate.c
@@ -314,8 +314,8 @@ static int create_binary(
}
done:
- git_buf_free(&deflate);
- git_buf_free(&delta);
+ git_buf_dispose(&deflate);
+ git_buf_dispose(&delta);
return error;
}
diff --git a/src/patch_parse.c b/src/patch_parse.c
index acdd45e..2fd6e97 100644
--- a/src/patch_parse.c
+++ b/src/patch_parse.c
@@ -98,7 +98,7 @@ static int parse_header_git_oldpath(
patch->old_path = git_buf_detach(&old_path);
out:
- git_buf_free(&old_path);
+ git_buf_dispose(&old_path);
return error;
}
@@ -114,7 +114,7 @@ static int parse_header_git_newpath(
patch->new_path = git_buf_detach(&new_path);
out:
- git_buf_free(&new_path);
+ git_buf_dispose(&new_path);
return error;
}
@@ -770,8 +770,8 @@ static int parse_patch_binary_side(
binary->data = git_buf_detach(&decoded);
done:
- git_buf_free(&base85);
- git_buf_free(&decoded);
+ git_buf_dispose(&base85);
+ git_buf_dispose(&decoded);
return error;
}
diff --git a/src/path.c b/src/path.c
index 77833ee..e411f35 100644
--- a/src/path.c
+++ b/src/path.c
@@ -207,7 +207,7 @@ char *git_path_dirname(const char *path)
git_path_dirname_r(&buf, path);
dirname = git_buf_detach(&buf);
- git_buf_free(&buf); /* avoid memleak if error occurs */
+ git_buf_dispose(&buf); /* avoid memleak if error occurs */
return dirname;
}
@@ -219,7 +219,7 @@ char *git_path_basename(const char *path)
git_path_basename_r(&buf, path);
basename = git_buf_detach(&buf);
- git_buf_free(&buf); /* avoid memleak if error occurs */
+ git_buf_dispose(&buf); /* avoid memleak if error occurs */
return basename;
}
@@ -642,7 +642,7 @@ bool git_path_is_empty_dir(const char *path)
else
error = git_path_direach(&dir, 0, path_found_entry, NULL);
- git_buf_free(&dir);
+ git_buf_dispose(&dir);
return !error;
}
@@ -956,7 +956,7 @@ void git_path_iconv_clear(git_path_iconv_t *ic)
if (ic) {
if (ic->map != (iconv_t)-1)
iconv_close(ic->map);
- git_buf_free(&ic->buf);
+ git_buf_dispose(&ic->buf);
}
}
@@ -1060,7 +1060,7 @@ bool git_path_does_fs_decompose_unicode(const char *root)
(void)p_unlink(path.ptr);
done:
- git_buf_free(&path);
+ git_buf_dispose(&path);
return found_decomposed;
}
@@ -1308,7 +1308,7 @@ void git_path_diriter_free(git_path_diriter *diriter)
if (diriter == NULL)
return;
- git_buf_free(&diriter->path_utf8);
+ git_buf_dispose(&diriter->path_utf8);
if (diriter->handle != INVALID_HANDLE_VALUE) {
FindClose(diriter->handle);
@@ -1338,7 +1338,7 @@ int git_path_diriter_init(
}
if ((diriter->dir = opendir(diriter->path.ptr)) == NULL) {
- git_buf_free(&diriter->path);
+ git_buf_dispose(&diriter->path);
giterr_set(GITERR_OS, "failed to open directory '%s'", path);
return -1;
@@ -1448,7 +1448,7 @@ void git_path_diriter_free(git_path_diriter *diriter)
git_path_iconv_clear(&diriter->ic);
#endif
- git_buf_free(&diriter->path);
+ git_buf_dispose(&diriter->path);
}
#endif
diff --git a/src/pathspec.c b/src/pathspec.c
index 998b6fb..3415f66 100644
--- a/src/pathspec.c
+++ b/src/pathspec.c
@@ -36,7 +36,7 @@ char *git_pathspec_prefix(const git_strarray *pathspec)
git_buf_truncate(&prefix, scan - prefix.ptr);
if (prefix.size <= 0) {
- git_buf_free(&prefix);
+ git_buf_dispose(&prefix);
return NULL;
}
diff --git a/src/push.c b/src/push.c
index 85b683e..ab60428 100644
--- a/src/push.c
+++ b/src/push.c
@@ -228,7 +228,7 @@ int git_push_update_tips(git_push *push, const git_remote_callbacks *callbacks)
error = 0;
on_error:
- git_buf_free(&remote_ref_name);
+ git_buf_dispose(&remote_ref_name);
return error;
}
diff --git a/src/rebase.c b/src/rebase.c
index f1cb22f..bc3c599 100644
--- a/src/rebase.c
+++ b/src/rebase.c
@@ -116,7 +116,7 @@ done:
if (type != GIT_REBASE_TYPE_NONE && path_out)
*path_out = git_buf_detach(&path);
- git_buf_free(&path);
+ git_buf_dispose(&path);
return 0;
}
@@ -251,9 +251,9 @@ static int rebase_open_merge(git_rebase *rebase)
rebase->onto_name = git_buf_detach(&buf);
done:
- git_buf_free(&cmt);
- git_buf_free(&state_path);
- git_buf_free(&buf);
+ git_buf_dispose(&cmt);
+ git_buf_dispose(&state_path);
+ git_buf_dispose(&buf);
return error;
}
@@ -390,10 +390,10 @@ done:
else
git_rebase_free(rebase);
- git_buf_free(&path);
- git_buf_free(&orig_head_name);
- git_buf_free(&orig_head_id);
- git_buf_free(&onto_id);
+ git_buf_dispose(&path);
+ git_buf_dispose(&orig_head_name);
+ git_buf_dispose(&orig_head_id);
+ git_buf_dispose(&onto_id);
return error;
}
@@ -421,8 +421,8 @@ static int rebase_setupfile(git_rebase *rebase, const char *filename, int flags,
if ((error = git_buf_joinpath(&path, rebase->state_path, filename)) == 0)
error = git_futils_writebuffer(&contents, path.ptr, flags, REBASE_FILE_MODE);
- git_buf_free(&path);
- git_buf_free(&contents);
+ git_buf_dispose(&path);
+ git_buf_dispose(&contents);
return error;
}
@@ -463,7 +463,7 @@ static int rebase_setupfiles_merge(git_rebase *rebase)
}
done:
- git_buf_free(&commit_filename);
+ git_buf_dispose(&commit_filename);
return error;
}
@@ -659,8 +659,8 @@ static int rebase_init_merge(
done:
git_reference_free(head_ref);
git_commit_free(onto_commit);
- git_buf_free(&reflog);
- git_buf_free(&state_path);
+ git_buf_dispose(&reflog);
+ git_buf_dispose(&state_path);
return error;
}
@@ -839,7 +839,7 @@ done:
git_tree_free(parent_tree);
git_commit_free(parent_commit);
git_commit_free(current_commit);
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
@@ -1263,9 +1263,9 @@ on_error:
error = -1;
done:
- git_buf_free(&rewritten);
- git_buf_free(&path);
- git_buf_free(¬es_ref);
+ git_buf_dispose(&rewritten);
+ git_buf_dispose(&path);
+ git_buf_dispose(¬es_ref);
return error;
}
@@ -1297,8 +1297,8 @@ static int return_to_orig_head(git_rebase *rebase)
rebase->repo, GIT_HEAD_FILE, rebase->orig_head_name, 1,
head_msg.ptr);
- git_buf_free(&head_msg);
- git_buf_free(&branch_msg);
+ git_buf_dispose(&head_msg);
+ git_buf_dispose(&branch_msg);
git_commit_free(terminal_commit);
git_reference_free(head_ref);
git_reference_free(branch_ref);
diff --git a/src/refdb_fs.c b/src/refdb_fs.c
index 0b4bbb4..49b567c 100644
--- a/src/refdb_fs.c
+++ b/src/refdb_fs.c
@@ -183,7 +183,7 @@ static int packed_reload(refdb_fs_backend *backend)
}
git_sortedcache_wunlock(backend->refcache);
- git_buf_free(&packedrefs);
+ git_buf_dispose(&packedrefs);
return 0;
@@ -192,7 +192,7 @@ parse_failed:
git_sortedcache_clear(backend->refcache, false);
git_sortedcache_wunlock(backend->refcache);
- git_buf_free(&packedrefs);
+ git_buf_dispose(&packedrefs);
return -1;
}
@@ -226,7 +226,7 @@ static int loose_readbuffer(git_buf *buf, const char *base, const char *path)
/* build full path to file */
if ((error = git_buf_joinpath(buf, base, path)) < 0 ||
(error = git_futils_readbuffer(buf, buf->ptr)) < 0)
- git_buf_free(buf);
+ git_buf_dispose(buf);
return error;
}
@@ -266,7 +266,7 @@ static int loose_lookup_to_packfile(refdb_fs_backend *backend, const char *name)
git_sortedcache_wunlock(backend->refcache);
done:
- git_buf_free(&ref_file);
+ git_buf_dispose(&ref_file);
return error;
}
@@ -317,7 +317,7 @@ static int packed_loadloose(refdb_fs_backend *backend)
error = git_path_direach(
&refs_path, backend->direach_flags, _dirent_loose_load, backend);
- git_buf_free(&refs_path);
+ git_buf_dispose(&refs_path);
return error;
}
@@ -340,7 +340,7 @@ static int refdb_fs_backend__exists(
*exists = git_path_isfile(ref_path.ptr) ||
(git_sortedcache_lookup(backend->refcache, ref_name) != NULL);
- git_buf_free(&ref_path);
+ git_buf_dispose(&ref_path);
return 0;
}
@@ -414,7 +414,7 @@ static int loose_lookup(
*out = git_reference__alloc(ref_name, &oid, NULL);
}
- git_buf_free(&ref_file);
+ git_buf_dispose(&ref_file);
return error;
}
@@ -539,12 +539,12 @@ static int iter_load_loose_paths(refdb_fs_backend *backend, refdb_fs_iter *iter)
if ((error = git_buf_printf(&path, "%s/", backend->commonpath)) < 0 ||
(error = git_buf_put(&path, ref_prefix, ref_prefix_len)) < 0) {
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
if ((error = git_iterator_for_filesystem(&fsit, path.ptr, &fsit_opts)) < 0) {
- git_buf_free(&path);
+ git_buf_dispose(&path);
return (iter->glob && error == GIT_ENOTFOUND)? 0 : error;
}
@@ -577,7 +577,7 @@ static int iter_load_loose_paths(refdb_fs_backend *backend, refdb_fs_iter *iter)
}
git_iterator_free(fsit);
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
@@ -803,7 +803,7 @@ static int loose_lock(git_filebuf *file, refdb_fs_backend *backend, const char *
if (error == GIT_EDIRECTORY)
giterr_set(GITERR_REFERENCE, "cannot lock ref '%s', there are refs beneath that folder", name);
- git_buf_free(&ref_path);
+ git_buf_dispose(&ref_path);
return error;
}
@@ -990,7 +990,7 @@ static int packed_remove_loose(refdb_fs_backend *backend)
continue;
if (error < 0) {
- git_buf_free(&ref_content);
+ git_buf_dispose(&ref_content);
giterr_set(GITERR_REFERENCE, "failed to lock loose reference '%s'", ref->name);
return error;
}
@@ -1021,7 +1021,7 @@ static int packed_remove_loose(refdb_fs_backend *backend)
p_unlink(lock.path_original);
}
- git_buf_free(&ref_content);
+ git_buf_dispose(&ref_content);
git_filebuf_cleanup(&lock);
return 0;
}
@@ -1383,7 +1383,7 @@ static int refdb_fs_backend__delete_tail(
error = packed_write(backend);
cleanup:
- git_buf_free(&loose_path);
+ git_buf_dispose(&loose_path);
git_filebuf_cleanup(file);
return error;
@@ -1522,7 +1522,7 @@ static char *setup_namespace(git_repository *repo, const char *in)
out = git_buf_detach(&path);
done:
- git_buf_free(&path);
+ git_buf_dispose(&path);
return out;
}
@@ -1655,7 +1655,7 @@ static int refdb_reflog_fs__ensure_log(git_refdb_backend *_backend, const char *
return error;
error = create_new_reflog_file(git_buf_cstr(&path));
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
@@ -1671,7 +1671,7 @@ static int has_reflog(git_repository *repo, const char *name)
ret = git_path_isfile(git_buf_cstr(&path));
cleanup:
- git_buf_free(&path);
+ git_buf_dispose(&path);
return ret;
}
@@ -1725,8 +1725,8 @@ cleanup:
git_reflog_free(log);
success:
- git_buf_free(&log_file);
- git_buf_free(&log_path);
+ git_buf_dispose(&log_file);
+ git_buf_dispose(&log_path);
return error;
}
@@ -1791,7 +1791,7 @@ static int lock_reflog(git_filebuf *file, refdb_fs_backend *backend, const char
error = git_filebuf_open(file, git_buf_cstr(&log_path), 0, GIT_REFLOG_FILE_MODE);
cleanup:
- git_buf_free(&log_path);
+ git_buf_dispose(&log_path);
return error;
}
@@ -1827,7 +1827,7 @@ cleanup:
git_filebuf_cleanup(&fbuf);
success:
- git_buf_free(&log);
+ git_buf_dispose(&log);
return error;
}
@@ -1911,8 +1911,8 @@ static int reflog_append(refdb_fs_backend *backend, const git_reference *ref, co
error = git_futils_writebuffer(&buf, git_buf_cstr(&path), open_flags, GIT_REFLOG_FILE_MODE);
cleanup:
- git_buf_free(&buf);
- git_buf_free(&path);
+ git_buf_dispose(&buf);
+ git_buf_dispose(&path);
return error;
}
@@ -1990,10 +1990,10 @@ static int refdb_reflog_fs__rename(git_refdb_backend *_backend, const char *old_
}
cleanup:
- git_buf_free(&temp_path);
- git_buf_free(&old_path);
- git_buf_free(&new_path);
- git_buf_free(&normalized);
+ git_buf_dispose(&temp_path);
+ git_buf_dispose(&old_path);
+ git_buf_dispose(&new_path);
+ git_buf_dispose(&normalized);
return error;
}
@@ -2016,7 +2016,7 @@ static int refdb_reflog_fs__delete(git_refdb_backend *_backend, const char *name
if (!error && git_path_exists(path.ptr))
error = p_unlink(path.ptr);
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
@@ -2055,7 +2055,7 @@ int git_refdb_backend_fs(
NULL, NULL, packref_cmp, git_buf_cstr(&gitpath)) < 0)
goto fail;
- git_buf_free(&gitpath);
+ git_buf_dispose(&gitpath);
if (!git_repository__cvar(&t, backend->repo, GIT_CVAR_IGNORECASE) && t) {
backend->iterator_flags |= GIT_ITERATOR_IGNORE_CASE;
@@ -2091,7 +2091,7 @@ int git_refdb_backend_fs(
return 0;
fail:
- git_buf_free(&gitpath);
+ git_buf_dispose(&gitpath);
git__free(backend->gitpath);
git__free(backend->commonpath);
git__free(backend);
diff --git a/src/refs.c b/src/refs.c
index c429683..b3e94d8 100644
--- a/src/refs.c
+++ b/src/refs.c
@@ -282,7 +282,7 @@ int git_reference__read_head(
out:
git__free(name);
- git_buf_free(&reference);
+ git_buf_dispose(&reference);
return error;
}
@@ -346,8 +346,8 @@ cleanup:
if (error == GIT_ENOTFOUND)
giterr_set(GITERR_REFERENCE, "no reference found for shorthand '%s'", refname);
- git_buf_free(&name);
- git_buf_free(&refnamebuf);
+ git_buf_dispose(&name);
+ git_buf_dispose(&refnamebuf);
return error;
}
@@ -1076,7 +1076,7 @@ cleanup:
"the given reference name '%s' is not valid", name);
if (error && normalize)
- git_buf_free(buf);
+ git_buf_dispose(buf);
#ifdef GIT_USE_ICONV
git_path_iconv_clear(&ic);
@@ -1110,7 +1110,7 @@ int git_reference_normalize_name(
error = 0;
cleanup:
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
@@ -1262,7 +1262,7 @@ int git_reference__update_for_commit(
done:
git_reference_free(ref_new);
- git_buf_free(&reflog_msg);
+ git_buf_dispose(&reflog_msg);
git_commit_free(commit);
return error;
}
diff --git a/src/refspec.c b/src/refspec.c
index 943a9c7..8061788 100644
--- a/src/refspec.c
+++ b/src/refspec.c
@@ -359,7 +359,7 @@ int git_refspec__dwim_one(git_vector *out, git_refspec *spec, git_vector *refs)
cur->dst = git_buf_detach(&buf);
}
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
if (cur->dst == NULL && spec->dst != NULL) {
cur->dst = git__strdup(spec->dst);
diff --git a/src/remote.c b/src/remote.c
index d8a6b99..8b1d2da 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -67,7 +67,7 @@ static int download_tags_value(git_remote *remote, git_config *cfg)
return -1;
error = git_config__lookup_entry(&ce, cfg, git_buf_cstr(&buf), false);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
if (!error && ce && ce->value) {
if (!strcmp(ce->value, "--no-tags"))
@@ -132,7 +132,7 @@ static int write_add_refspec(git_repository *repo, const char *name, const char
}
cleanup:
- git_buf_free(&var);
+ git_buf_dispose(&var);
return 0;
}
@@ -255,7 +255,7 @@ static int create_internal(git_remote **out, git_repository *repo, const char *n
remote->download_tags = GIT_REMOTE_DOWNLOAD_TAGS_AUTO;
- git_buf_free(&var);
+ git_buf_dispose(&var);
*out = remote;
error = 0;
@@ -265,8 +265,8 @@ on_error:
git_remote_free(remote);
git_config_free(config_ro);
- git_buf_free(&canonical_url);
- git_buf_free(&var);
+ git_buf_dispose(&canonical_url);
+ git_buf_dispose(&var);
return error;
}
@@ -302,7 +302,7 @@ int git_remote_create(git_remote **out, git_repository *repo, const char *name,
return -1;
error = git_remote_create_with_fetchspec(out, repo, name, url, git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
@@ -524,7 +524,7 @@ int git_remote_lookup(git_remote **out, git_repository *repo, const char *name)
cleanup:
git_config_free(config);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
if (error < 0)
git_remote_free(remote);
@@ -552,7 +552,7 @@ static int lookup_remote_prune_config(git_remote *remote, git_config *config, co
}
}
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
@@ -601,8 +601,8 @@ static int set_url(git_repository *repo, const char *remote, const char *pattern
}
cleanup:
- git_buf_free(&canonical_url);
- git_buf_free(&buf);
+ git_buf_dispose(&canonical_url);
+ git_buf_dispose(&buf);
return error;
}
@@ -761,7 +761,7 @@ int git_remote__get_http_proxy(git_remote *remote, bool use_ssl, char **proxy_ur
return error;
error = git_config__lookup_entry(&ce, cfg, git_buf_cstr(&buf), false);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
if (error < 0)
return error;
@@ -985,7 +985,7 @@ int git_remote_fetch(
/* Create "remote/foo" branches for all remote branches */
error = git_remote_update_tips(remote, cbs, update_fetchhead, tagopt, git_buf_cstr(&reflog_msg_buf));
- git_buf_free(&reflog_msg_buf);
+ git_buf_dispose(&reflog_msg_buf);
if (error < 0)
return error;
@@ -1050,8 +1050,8 @@ static int ref_to_update(int *update, git_buf *remote_name, git_remote *remote,
*update = 1;
}
- git_buf_free(&upstream_remote);
- git_buf_free(&upstream_name);
+ git_buf_dispose(&upstream_remote);
+ git_buf_dispose(&upstream_name);
return error;
}
@@ -1084,7 +1084,7 @@ static int remote_head_for_ref(git_remote_head **out, git_remote *remote, git_re
error = remote_head_for_fetchspec_src(out, update_heads, git_buf_cstr(&remote_name));
cleanup:
- git_buf_free(&remote_name);
+ git_buf_dispose(&remote_name);
git_reference_free(resolved_ref);
git_config_free(config);
return error;
@@ -1235,7 +1235,7 @@ int git_remote_prune(git_remote *remote, const git_remote_callbacks *callbacks)
key.name = (char *) git_buf_cstr(&buf);
error = git_vector_search(&pos, &remote_refs, &key);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
if (error < 0 && error != GIT_ENOTFOUND)
goto cleanup;
@@ -1417,13 +1417,13 @@ static int update_tips_for_spec(
git_vector_free(&update_heads);
git_refspec__free(&tagspec);
- git_buf_free(&refname);
+ git_buf_dispose(&refname);
return 0;
on_error:
git_vector_free(&update_heads);
git_refspec__free(&tagspec);
- git_buf_free(&refname);
+ git_buf_dispose(&refname);
return -1;
}
@@ -1537,7 +1537,7 @@ static int opportunistic_updates(const git_remote *remote, const git_remote_call
error = 0;
cleanup:
- git_buf_free(&refname);
+ git_buf_dispose(&refname);
return error;
}
@@ -1550,7 +1550,7 @@ static int truncate_fetch_head(const char *gitdir)
return error;
error = git_futils_truncate(path.ptr, GIT_REFS_FILE_MODE);
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
@@ -1759,7 +1759,7 @@ int git_remote_set_autotag(git_repository *repo, const char *remote, git_remote_
error = -1;
}
- git_buf_free(&var);
+ git_buf_dispose(&var);
return error;
}
@@ -1790,8 +1790,8 @@ static int rename_remote_config_section(
new_name ? git_buf_cstr(&new_section_name) : NULL);
cleanup:
- git_buf_free(&old_section_name);
- git_buf_free(&new_section_name);
+ git_buf_dispose(&old_section_name);
+ git_buf_dispose(&new_section_name);
return error;
}
@@ -1887,10 +1887,10 @@ static int rename_one_remote_reference(
cleanup:
git_reference_free(reference_in);
git_reference_free(ref);
- git_buf_free(&namespace);
- git_buf_free(&old_namespace);
- git_buf_free(&new_name);
- git_buf_free(&log_message);
+ git_buf_dispose(&namespace);
+ git_buf_dispose(&old_namespace);
+ git_buf_dispose(&new_name);
+ git_buf_dispose(&log_message);
return error;
}
@@ -1908,7 +1908,7 @@ static int rename_remote_references(
return error;
error = git_reference_iterator_glob_new(&iter, repo, git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
if (error < 0)
return error;
@@ -1976,9 +1976,9 @@ static int rename_fetch_refspecs(git_vector *problems, git_remote *remote, const
break;
}
- git_buf_free(&base);
- git_buf_free(&var);
- git_buf_free(&val);
+ git_buf_dispose(&base);
+ git_buf_dispose(&var);
+ git_buf_dispose(&val);
if (error < 0) {
char *str;
@@ -2044,7 +2044,7 @@ int git_remote_is_valid_name(
git_buf_printf(&buf, "refs/heads/test:refs/remotes/%s/test", remote_name);
error = git_refspec__parse(&refspec, git_buf_cstr(&buf), true);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_refspec__free(&refspec);
giterr_clear();
@@ -2219,7 +2219,7 @@ static int remove_branch_config_related_entries(
if (error == GIT_ITEROVER)
error = 0;
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_config_iterator_free(iter);
return error;
}
diff --git a/src/repository.c b/src/repository.c
index 3c89879..a2f88a2 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -166,7 +166,7 @@ void git_repository_free(git_repository *repo)
repo->diff_drivers = NULL;
for (i = 0; i < repo->reserved_names.size; i++)
- git_buf_free(git_array_get(repo->reserved_names, i));
+ git_buf_dispose(git_array_get(repo->reserved_names, i));
git_array_clear(repo->reserved_names);
git__free(repo->gitlink);
@@ -203,7 +203,7 @@ static bool valid_repository_path(git_buf *repository_path, git_buf *common_path
git_buf_swap(common_path, &common_link);
}
- git_buf_free(&common_link);
+ git_buf_dispose(&common_link);
}
else {
git_buf_set(common_path, repository_path->ptr, repository_path->size);
@@ -333,7 +333,7 @@ static int load_workdir(git_repository *repo, git_config *config, git_buf *paren
GITERR_CHECK_ALLOC(repo->workdir);
cleanup:
- git_buf_free(&path);
+ git_buf_dispose(&path);
git_config_entry_free(ce);
return error;
}
@@ -425,7 +425,7 @@ static int read_gitfile(git_buf *path_out, const char *file_path)
path_out, gitlink, git_buf_cstr(path_out));
}
- git_buf_free(&file);
+ git_buf_dispose(&file);
return error;
}
@@ -556,9 +556,9 @@ static int find_repo(
error = GIT_ENOTFOUND;
}
- git_buf_free(&path);
- git_buf_free(&repo_link);
- git_buf_free(&common_link);
+ git_buf_dispose(&path);
+ git_buf_dispose(&repo_link);
+ git_buf_dispose(&common_link);
return error;
}
@@ -574,8 +574,8 @@ int git_repository_open_bare(
return error;
if (!valid_repository_path(&path, &common_path)) {
- git_buf_free(&path);
- git_buf_free(&common_path);
+ git_buf_dispose(&path);
+ git_buf_dispose(&common_path);
giterr_set(GITERR_REPOSITORY, "path is not a repository: %s", bare_path);
return GIT_ENOTFOUND;
}
@@ -754,15 +754,15 @@ error:
success:
git_odb_free(odb);
git_index_free(index);
- git_buf_free(&common_dir_buf);
- git_buf_free(&work_tree_buf);
- git_buf_free(&alts_buf);
- git_buf_free(&object_dir_buf);
- git_buf_free(&namespace_buf);
- git_buf_free(&index_file_buf);
- git_buf_free(&across_fs_buf);
- git_buf_free(&ceiling_dirs_buf);
- git_buf_free(&dir_buf);
+ git_buf_dispose(&common_dir_buf);
+ git_buf_dispose(&work_tree_buf);
+ git_buf_dispose(&alts_buf);
+ git_buf_dispose(&object_dir_buf);
+ git_buf_dispose(&namespace_buf);
+ git_buf_dispose(&index_file_buf);
+ git_buf_dispose(&across_fs_buf);
+ git_buf_dispose(&ceiling_dirs_buf);
+ git_buf_dispose(&dir_buf);
return error;
}
@@ -785,7 +785,7 @@ static int repo_is_worktree(unsigned *out, const git_repository *repo)
* only used when the repository is a working tree. */
*out = !!git_path_exists(gitdir_link.ptr);
- git_buf_free(&gitdir_link);
+ git_buf_dispose(&gitdir_link);
return error;
}
@@ -856,8 +856,8 @@ int git_repository_open_ext(
}
cleanup:
- git_buf_free(&gitdir);
- git_buf_free(&workdir);
+ git_buf_dispose(&gitdir);
+ git_buf_dispose(&workdir);
git_config_free(config);
if (error < 0)
@@ -899,7 +899,7 @@ int git_repository_open_from_worktree(git_repository **repo_out, git_worktree *w
*repo_out = repo;
out:
- git_buf_free(&path);
+ git_buf_dispose(&path);
return err;
}
@@ -955,7 +955,7 @@ static int load_config(
if (error && error != GIT_ENOTFOUND)
goto on_error;
- git_buf_free(&config_path);
+ git_buf_dispose(&config_path);
if (global_config_path != NULL &&
(error = git_config_add_file_ondisk(
@@ -987,7 +987,7 @@ static int load_config(
return 0;
on_error:
- git_buf_free(&config_path);
+ git_buf_dispose(&config_path);
git_config_free(cfg);
*out = NULL;
return error;
@@ -1034,10 +1034,10 @@ int git_repository_config__weakptr(git_config **out, git_repository *repo)
}
}
- git_buf_free(&global_buf);
- git_buf_free(&xdg_buf);
- git_buf_free(&system_buf);
- git_buf_free(&programdata_buf);
+ git_buf_dispose(&global_buf);
+ git_buf_dispose(&xdg_buf);
+ git_buf_dispose(&system_buf);
+ git_buf_dispose(&programdata_buf);
}
*out = repo->_config;
@@ -1099,7 +1099,7 @@ int git_repository_odb__weakptr(git_odb **out, git_repository *repo)
git_odb_free(odb);
}
- git_buf_free(&odb_path);
+ git_buf_dispose(&odb_path);
}
*out = repo->_odb;
@@ -1187,7 +1187,7 @@ int git_repository_index__weakptr(git_index **out, git_repository *repo)
error = git_index_set_caps(repo->_index, GIT_INDEXCAP_FROM_OWNER);
}
- git_buf_free(&index_path);
+ git_buf_dispose(&index_path);
}
*out = repo->_index;
@@ -1372,11 +1372,11 @@ int git_repository_create_head(const char *git_dir, const char *ref_name)
git_filebuf_commit(&ref) < 0)
goto fail;
- git_buf_free(&ref_path);
+ git_buf_dispose(&ref_path);
return 0;
fail:
- git_buf_free(&ref_path);
+ git_buf_dispose(&ref_path);
git_filebuf_cleanup(&ref);
return -1;
}
@@ -1405,7 +1405,7 @@ static bool is_filesystem_case_insensitive(const char *gitdir_path)
if (!git_buf_joinpath(&path, gitdir_path, "CoNfIg"))
is_insensitive = git_path_exists(git_buf_cstr(&path));
- git_buf_free(&path);
+ git_buf_dispose(&path);
return is_insensitive;
}
@@ -1426,7 +1426,7 @@ static bool are_symlinks_supported(const char *wd_path)
symlinks_supported = (S_ISLNK(st.st_mode) != 0);
(void)p_unlink(path.ptr);
- git_buf_free(&path);
+ git_buf_dispose(&path);
return symlinks_supported;
}
@@ -1586,8 +1586,8 @@ static int repo_init_config(
}
cleanup:
- git_buf_free(&cfg_path);
- git_buf_free(&worktree_path);
+ git_buf_dispose(&cfg_path);
+ git_buf_dispose(&worktree_path);
git_config_free(config);
return error;
@@ -1618,7 +1618,7 @@ int git_repository_reinit_filesystem(git_repository *repo, int recurse)
config, path.ptr, repo_dir, git_repository_workdir(repo), true);
git_config_free(config);
- git_buf_free(&path);
+ git_buf_dispose(&path);
git_repository__cvar_cache_clear(repo);
@@ -1666,7 +1666,7 @@ static int repo_write_template(
GIT_UNUSED(hidden);
#endif
- git_buf_free(&path);
+ git_buf_dispose(&path);
if (error)
giterr_set(GITERR_OS,
@@ -1720,8 +1720,8 @@ static int repo_write_gitlink(
error = repo_write_template(in_dir, true, DOT_GIT, 0666, true, buf.ptr);
cleanup:
- git_buf_free(&buf);
- git_buf_free(&path_to_repo);
+ git_buf_dispose(&buf);
+ git_buf_dispose(&path_to_repo);
return error;
}
@@ -1805,7 +1805,7 @@ static int repo_init_structure(
error = git_futils_cp_r(tdir, repo_dir, cpflags, dmode);
}
- git_buf_free(&template_buf);
+ git_buf_dispose(&template_buf);
git_config_free(cfg);
if (error < 0) {
@@ -2065,9 +2065,9 @@ int git_repository_init_ext(
error = repo_init_create_origin(*out, opts->origin_url);
cleanup:
- git_buf_free(&common_path);
- git_buf_free(&repo_path);
- git_buf_free(&wd_path);
+ git_buf_dispose(&common_path);
+ git_buf_dispose(&repo_path);
+ git_buf_dispose(&wd_path);
return error;
}
@@ -2165,7 +2165,7 @@ out:
if (error)
git_reference_free(head);
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
@@ -2197,7 +2197,7 @@ int git_repository_foreach_head(git_repository *repo, git_repository_foreach_hea
}
out:
- git_buf_free(&path);
+ git_buf_dispose(&path);
git_strarray_free(&worktrees);
return error;
}
@@ -2440,7 +2440,7 @@ int git_repository__set_orig_head(git_repository *repo, const git_oid *orig_head
if (error < 0)
git_filebuf_cleanup(&file);
- git_buf_free(&file_path);
+ git_buf_dispose(&file_path);
return error;
}
@@ -2464,7 +2464,7 @@ int git_repository_message(git_buf *out, git_repository *repo)
error = git_futils_readbuffer(out, git_buf_cstr(&path));
}
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
@@ -2478,7 +2478,7 @@ int git_repository_message_remove(git_repository *repo)
return -1;
error = p_unlink(git_buf_cstr(&path));
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
@@ -2548,7 +2548,7 @@ cleanup:
if (fd >= 0)
p_close(fd);
git_filter_list_free(fl);
- git_buf_free(&full_path);
+ git_buf_dispose(&full_path);
return error;
}
@@ -2604,7 +2604,7 @@ static int detach(git_repository *repo, const git_oid *id, const char *new)
error = git_reference_create(&new_head, repo, GIT_HEAD_FILE, git_object_id(peeled), true, git_buf_cstr(&log_message));
cleanup:
- git_buf_free(&log_message);
+ git_buf_dispose(&log_message);
git_object_free(object);
git_object_free(peeled);
git_reference_free(current);
@@ -2654,7 +2654,7 @@ int git_repository_set_head(
}
cleanup:
- git_buf_free(&log_message);
+ git_buf_dispose(&log_message);
git_reference_free(current);
git_reference_free(ref);
git_reference_free(new_head);
@@ -2702,7 +2702,7 @@ int git_repository_detach_head(git_repository* repo)
1, git_buf_cstr(&log_message));
cleanup:
- git_buf_free(&log_message);
+ git_buf_dispose(&log_message);
git_object_free(object);
git_reference_free(old_head);
git_reference_free(new_head);
@@ -2749,7 +2749,7 @@ int git_repository_state(git_repository *repo)
} else if (git_path_contains_file(&repo_path, GIT_BISECT_LOG_FILE))
state = GIT_REPOSITORY_STATE_BISECT;
- git_buf_free(&repo_path);
+ git_buf_dispose(&repo_path);
return state;
}
@@ -2778,7 +2778,7 @@ int git_repository__cleanup_files(
git_buf_clear(&buf);
}
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
@@ -2811,7 +2811,7 @@ int git_repository_is_shallow(git_repository *repo)
return error;
error = git_path_lstat(path.ptr, &st);
- git_buf_free(&path);
+ git_buf_dispose(&path);
if (error == GIT_ENOTFOUND) {
giterr_clear();
diff --git a/src/reset.c b/src/reset.c
index 2159681..01b0b21 100644
--- a/src/reset.c
+++ b/src/reset.c
@@ -176,7 +176,7 @@ cleanup:
git_object_free(commit);
git_index_free(index);
git_tree_free(tree);
- git_buf_free(&log_message);
+ git_buf_dispose(&log_message);
return error;
}
diff --git a/src/revert.c b/src/revert.c
index 54f6d48..e4cbcf5 100644
--- a/src/revert.c
+++ b/src/revert.c
@@ -36,7 +36,7 @@ static int write_revert_head(
if (error < 0)
git_filebuf_cleanup(&file);
- git_buf_free(&file_path);
+ git_buf_dispose(&file_path);
return error;
}
@@ -62,7 +62,7 @@ cleanup:
if (error < 0)
git_filebuf_cleanup(&file);
- git_buf_free(&file_path);
+ git_buf_dispose(&file_path);
return error;
}
@@ -219,7 +219,7 @@ done:
git_index_free(index);
git_commit_free(our_commit);
git_reference_free(our_ref);
- git_buf_free(&their_label);
+ git_buf_dispose(&their_label);
return error;
}
diff --git a/src/revparse.c b/src/revparse.c
index 7cb22f4..bdbf875 100644
--- a/src/revparse.c
+++ b/src/revparse.c
@@ -197,7 +197,7 @@ static int retrieve_previously_checked_out_branch_or_revision(git_object **out,
cleanup:
git_reference_free(ref);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
regfree(&preg);
git_reflog_free(reflog);
return error;
@@ -350,7 +350,7 @@ static int handle_at_syntax(git_object **out, git_reference **ref, const char *s
error = retrieve_revobject_from_reflog(out, ref, repo, git_buf_cstr(&identifier), (size_t)timestamp);
cleanup:
- git_buf_free(&identifier);
+ git_buf_dispose(&identifier);
return error;
}
@@ -624,7 +624,7 @@ static int ensure_base_rev_loaded(git_object **object, git_reference **reference
return -1;
error = revparse_lookup_object(object, reference, repo, git_buf_cstr(&identifier));
- git_buf_free(&identifier);
+ git_buf_dispose(&identifier);
return error;
}
@@ -820,7 +820,7 @@ cleanup:
git_reference_free(reference);
}
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
diff --git a/src/revwalk.c b/src/revwalk.c
index eb228a5..e7bbc12 100644
--- a/src/revwalk.c
+++ b/src/revwalk.c
@@ -152,7 +152,7 @@ static int push_glob(git_revwalk *walk, const char *glob, int hide)
if (error == GIT_ITEROVER)
error = 0;
out:
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
diff --git a/src/stash.c b/src/stash.c
index 4b7e92a..b85a5e7 100644
--- a/src/stash.c
+++ b/src/stash.c
@@ -149,7 +149,7 @@ static int commit_index(
cleanup:
git_tree_free(i_tree);
- git_buf_free(&msg);
+ git_buf_dispose(&msg);
return error;
}
@@ -291,7 +291,7 @@ static int commit_untracked(
cleanup:
git_tree_free(u_tree);
- git_buf_free(&msg);
+ git_buf_dispose(&msg);
return error;
}
@@ -423,7 +423,7 @@ static int prepare_worktree_commit_message(
error = (git_buf_oom(msg) || git_buf_oom(&buf)) ? -1 : 0;
cleanup:
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
@@ -565,7 +565,7 @@ int git_stash_save(
cleanup:
- git_buf_free(&msg);
+ git_buf_dispose(&msg);
git_commit_free(i_commit);
git_commit_free(b_commit);
git_commit_free(u_commit);
diff --git a/src/submodule.c b/src/submodule.c
index d0aef2e..d0c7d04 100644
--- a/src/submodule.c
+++ b/src/submodule.c
@@ -190,7 +190,7 @@ static int is_path_occupied(bool *occupied, git_repository *repo, const char *pa
error = 0;
out:
- git_buf_free(&dir);
+ git_buf_dispose(&dir);
return error;
}
@@ -271,7 +271,7 @@ static int load_submodule_names(git_strmap **out, git_repository *repo, git_conf
out:
free_submodule_names(names);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_config_iterator_free(iter);
return error;
}
@@ -338,7 +338,7 @@ int git_submodule_lookup(
if (error < 0) {
git_submodule_free(sm);
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
@@ -354,7 +354,7 @@ int git_submodule_lookup(
}
}
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
if ((error = git_submodule_location(&location, sm)) < 0) {
@@ -377,7 +377,7 @@ int git_submodule_lookup(
if (git_path_exists(path.ptr))
error = GIT_EEXISTS;
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
submodule_set_lookup_error(error, name);
@@ -409,7 +409,7 @@ int git_submodule_name_is_valid(git_repository *repo, const char *name, int flag
}
isvalid = git_path_isvalid(repo, buf.ptr, 0, flags);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return isvalid;
}
@@ -624,7 +624,7 @@ cleanup:
/* TODO: if we got an error, mark submodule config as invalid? */
git_index_free(idx);
git_tree_free(head);
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
@@ -729,8 +729,8 @@ static int submodule_repo_init(
error = git_repository_init_ext(&subrepo, workdir.ptr, &initopt);
cleanup:
- git_buf_free(&workdir);
- git_buf_free(&repodir);
+ git_buf_dispose(&workdir);
+ git_buf_dispose(&repodir);
*out = subrepo;
@@ -835,8 +835,8 @@ cleanup:
git_config_file_free(mods);
git_repository_free(subrepo);
- git_buf_free(&real_url);
- git_buf_free(&name);
+ git_buf_dispose(&real_url);
+ git_buf_dispose(&name);
return error;
}
@@ -865,7 +865,7 @@ int git_submodule_repo_init(
done:
git_config_free(cfg);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
@@ -949,7 +949,7 @@ int git_submodule_add_to_index(git_submodule *sm, int write_index)
cleanup:
git_repository_free(sm_repo);
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
@@ -1014,7 +1014,7 @@ int git_submodule_resolve_url(git_buf *out, git_repository *repo, const char *ur
error = -1;
}
- git_buf_free(&normalized);
+ git_buf_dispose(&normalized);
return error;
}
@@ -1036,7 +1036,7 @@ static int write_var(git_repository *repo, const char *name, const char *var, co
else
error = git_config_file_delete(mods, key.ptr);
- git_buf_free(&key);
+ git_buf_dispose(&key);
cleanup:
git_config_file_free(mods);
@@ -1201,8 +1201,8 @@ static int submodule_repo_create(
error = git_repository_init_ext(&subrepo, repodir.ptr, &initopt);
cleanup:
- git_buf_free(&workdir);
- git_buf_free(&repodir);
+ git_buf_dispose(&workdir);
+ git_buf_dispose(&repodir);
*out = subrepo;
@@ -1355,7 +1355,7 @@ int git_submodule_update(git_submodule *sm, int init, git_submodule_update_optio
}
done:
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_config_free(config);
git_object_free(target_commit);
git_remote_free(remote);
@@ -1402,8 +1402,8 @@ int git_submodule_init(git_submodule *sm, int overwrite)
cleanup:
git_config_free(cfg);
- git_buf_free(&key);
- git_buf_free(&effective_submodule_url);
+ git_buf_dispose(&key);
+ git_buf_dispose(&effective_submodule_url);
return error;
}
@@ -1443,7 +1443,7 @@ int git_submodule_sync(git_submodule *sm)
} else {
error = git_buf_join3(
&key, '.', "remote", remote_name.ptr, "url");
- git_buf_free(&remote_name);
+ git_buf_dispose(&remote_name);
}
if (!error)
@@ -1452,7 +1452,7 @@ int git_submodule_sync(git_submodule *sm)
git_repository_free(smrepo);
}
- git_buf_free(&key);
+ git_buf_dispose(&key);
return error;
}
@@ -1506,7 +1506,7 @@ static int git_submodule__open(
sm->flags |= GIT_SUBMODULE_STATUS__WD_SCANNED;
}
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
@@ -1938,7 +1938,7 @@ static int submodule_read_config(git_submodule *sm, git_config *cfg)
error = 0;
cleanup:
- git_buf_free(&key);
+ git_buf_dispose(&key);
return error;
}
@@ -2000,7 +2000,7 @@ static int submodule_load_each(const git_config_entry *entry, void *payload)
error = 0;
done:
- git_buf_free(&name);
+ git_buf_dispose(&name);
return error;
}
@@ -2017,7 +2017,7 @@ static int submodule_load_from_wd_lite(git_submodule *sm)
if (git_path_contains(&path, DOT_GIT))
sm->flags |= GIT_SUBMODULE_STATUS_IN_WD;
- git_buf_free(&path);
+ git_buf_dispose(&path);
return 0;
}
@@ -2041,6 +2041,7 @@ static int gitmodules_snapshot(git_config **snap, git_repository *repo)
if ((error = git_config_open_ondisk(&mods, path.ptr)) < 0)
goto cleanup;
+ git_buf_dispose(&path);
if ((error = git_config_snapshot(snap, mods)) < 0)
goto cleanup;
@@ -2050,7 +2051,7 @@ static int gitmodules_snapshot(git_config **snap, git_repository *repo)
cleanup:
if (mods)
git_config_free(mods);
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
@@ -2079,7 +2080,7 @@ static git_config_backend *open_gitmodules(
}
}
- git_buf_free(&path);
+ git_buf_dispose(&path);
return mods;
}
@@ -2119,7 +2120,7 @@ static int lookup_head_remote_key(git_buf *remote_name, git_repository *repo)
goto done;
done:
- git_buf_free(&upstream_name);
+ git_buf_dispose(&upstream_name);
git_reference_free(head);
return error;
@@ -2135,7 +2136,7 @@ static int lookup_head_remote(git_remote **remote, git_repository *repo)
if (!(error = lookup_head_remote_key(&remote_name, repo)))
error = git_remote_lookup(remote, repo, remote_name.ptr);
- git_buf_free(&remote_name);
+ git_buf_dispose(&remote_name);
return error;
}
diff --git a/src/sysdir.c b/src/sysdir.c
index 509b23b..5b1549e 100644
--- a/src/sysdir.c
+++ b/src/sysdir.c
@@ -136,7 +136,7 @@ static int git_sysdir_guess_xdg_dirs(git_buf *out)
error = 0;
}
- git_buf_free(&env);
+ git_buf_dispose(&env);
return error;
#endif
}
@@ -168,7 +168,7 @@ static void git_sysdir_global_shutdown(void)
size_t i;
for (i = 0; i < ARRAY_SIZE(git_sysdir__dirs); ++i)
- git_buf_free(&git_sysdir__dirs[i].buf);
+ git_buf_dispose(&git_sysdir__dirs[i].buf);
}
int git_sysdir_global_init(void)
@@ -262,7 +262,7 @@ int git_sysdir_set(git_sysdir_t which, const char *search_path)
git_buf_join(&merge, GIT_PATH_LIST_SEPARATOR, merge.ptr, expand_path);
git_buf_swap(&git_sysdir__dirs[which].buf, &merge);
- git_buf_free(&merge);
+ git_buf_dispose(&merge);
done:
if (git_buf_oom(&git_sysdir__dirs[which].buf))
@@ -307,7 +307,7 @@ static int git_sysdir_find_in_dirlist(
}
done:
- git_buf_free(path);
+ git_buf_dispose(path);
giterr_set(GITERR_OS, "the %s file '%s' doesn't exist", label, name);
return GIT_ENOTFOUND;
}
diff --git a/src/tag.c b/src/tag.c
index 445c3ff..a7c55d0 100644
--- a/src/tag.c
+++ b/src/tag.c
@@ -229,11 +229,11 @@ static int write_tag_annotation(
if (git_odb_write(oid, odb, tag.ptr, tag.size, GIT_OBJ_TAG) < 0)
goto on_error;
- git_buf_free(&tag);
+ git_buf_dispose(&tag);
return 0;
on_error:
- git_buf_free(&tag);
+ git_buf_dispose(&tag);
giterr_set(GITERR_OBJECT, "failed to create tag annotation");
return -1;
}
@@ -268,7 +268,7 @@ static int git_tag_create__internal(
/** Ensure the tag name doesn't conflict with an already existing
* reference unless overwriting has explicitly been requested **/
if (error == 0 && !allow_ref_overwrite) {
- git_buf_free(&ref_name);
+ git_buf_dispose(&ref_name);
giterr_set(GITERR_TAG, "tag already exists");
return GIT_EEXISTS;
}
@@ -283,7 +283,7 @@ static int git_tag_create__internal(
cleanup:
git_reference_free(new_ref);
- git_buf_free(&ref_name);
+ git_buf_dispose(&ref_name);
return error;
}
@@ -381,7 +381,7 @@ int git_tag_create_frombuffer(git_oid *oid, git_repository *repo, const char *bu
git_odb_stream_free(stream);
if (error < 0) {
- git_buf_free(&ref_name);
+ git_buf_dispose(&ref_name);
return error;
}
@@ -389,7 +389,7 @@ int git_tag_create_frombuffer(git_oid *oid, git_repository *repo, const char *bu
&new_ref, repo, ref_name.ptr, oid, allow_ref_overwrite, NULL);
git_reference_free(new_ref);
- git_buf_free(&ref_name);
+ git_buf_dispose(&ref_name);
return error;
@@ -409,7 +409,7 @@ int git_tag_delete(git_repository *repo, const char *tag_name)
error = retrieve_tag_reference(&tag_ref, &ref_name, repo, tag_name);
- git_buf_free(&ref_name);
+ git_buf_dispose(&ref_name);
if (error < 0)
return error;
diff --git a/src/trace.h b/src/trace.h
index 4989440..1eaf6c9 100644
--- a/src/trace.h
+++ b/src/trace.h
@@ -35,7 +35,7 @@ GIT_INLINE(void) git_trace__write_fmt(
callback(level, git_buf_cstr(&message));
- git_buf_free(&message);
+ git_buf_dispose(&message);
}
#define git_trace_level() (git_trace__data.level)
diff --git a/src/transport.c b/src/transport.c
index f1e18b3..bf13fe7 100644
--- a/src/transport.c
+++ b/src/transport.c
@@ -174,7 +174,7 @@ int git_transport_register(
return 0;
on_error:
- git_buf_free(&prefix);
+ git_buf_dispose(&prefix);
git__free(definition);
return error;
}
@@ -210,7 +210,7 @@ int git_transport_unregister(const char *scheme)
error = GIT_ENOTFOUND;
done:
- git_buf_free(&prefix);
+ git_buf_dispose(&prefix);
return error;
}
diff --git a/src/transports/auth.c b/src/transports/auth.c
index 9597cc2..c8e6adb 100644
--- a/src/transports/auth.c
+++ b/src/transports/auth.c
@@ -40,7 +40,7 @@ on_error:
if (raw.size)
git__memzero(raw.ptr, raw.size);
- git_buf_free(&raw);
+ git_buf_dispose(&raw);
return error;
}
diff --git a/src/transports/auth_negotiate.c b/src/transports/auth_negotiate.c
index c9bc304..eeabe8a 100644
--- a/src/transports/auth_negotiate.c
+++ b/src/transports/auth_negotiate.c
@@ -165,7 +165,7 @@ static int negotiate_next_token(
done:
gss_release_name(&status_minor, &server);
gss_release_buffer(&status_minor, (gss_buffer_t) &output_token);
- git_buf_free(&input_buf);
+ git_buf_dispose(&input_buf);
return error;
}
@@ -180,7 +180,7 @@ static void negotiate_context_free(git_http_auth_context *c)
ctx->gss_context = GSS_C_NO_CONTEXT;
}
- git_buf_free(&ctx->target);
+ git_buf_dispose(&ctx->target);
git__free(ctx->challenge);
diff --git a/src/transports/git.c b/src/transports/git.c
index 94178f2..82a565f 100644
--- a/src/transports/git.c
+++ b/src/transports/git.c
@@ -87,7 +87,7 @@ static int send_command(git_proto_stream *s)
s->sent_command = 1;
cleanup:
- git_buf_free(&request);
+ git_buf_dispose(&request);
return error;
}
diff --git a/src/transports/http.c b/src/transports/http.c
index e051c8a..ea3e57a 100644
--- a/src/transports/http.c
+++ b/src/transports/http.c
@@ -449,14 +449,14 @@ static int on_headers_complete(http_parser *parser)
return t->parse_error = PARSE_ERROR_GENERIC;
if (strcmp(t->content_type, git_buf_cstr(&buf))) {
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
giterr_set(GITERR_NET,
"invalid Content-Type: %s",
t->content_type);
return t->parse_error = PARSE_ERROR_GENERIC;
}
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return 0;
}
@@ -508,10 +508,10 @@ static void clear_parser_state(http_subtransport *t)
t->parse_error = 0;
t->parse_finished = 0;
- git_buf_free(&t->parse_header_name);
+ git_buf_dispose(&t->parse_header_name);
git_buf_init(&t->parse_header_name, 0);
- git_buf_free(&t->parse_header_value);
+ git_buf_dispose(&t->parse_header_value);
git_buf_init(&t->parse_header_value, 0);
git__free(t->content_type);
@@ -534,11 +534,11 @@ static int write_chunk(git_stream *io, const char *buffer, size_t len)
return -1;
if (git_stream_write(io, buf.ptr, buf.size, 0) < 0) {
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return -1;
}
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
/* Chunk body */
if (len > 0 && git_stream_write(io, buffer, len, 0) < 0)
@@ -671,11 +671,11 @@ replay:
return -1;
if (git_stream_write(t->io, request.ptr, request.size, 0) < 0) {
- git_buf_free(&request);
+ git_buf_dispose(&request);
return -1;
}
- git_buf_free(&request);
+ git_buf_dispose(&request);
s->sent_request = 1;
}
@@ -792,11 +792,11 @@ static int http_stream_write_chunked(
return -1;
if (git_stream_write(t->io, request.ptr, request.size, 0) < 0) {
- git_buf_free(&request);
+ git_buf_dispose(&request);
return -1;
}
- git_buf_free(&request);
+ git_buf_dispose(&request);
s->sent_request = 1;
}
@@ -870,13 +870,13 @@ static int http_stream_write_single(
if (len && git_stream_write(t->io, buffer, len, 0) < 0)
goto on_error;
- git_buf_free(&request);
+ git_buf_dispose(&request);
s->sent_request = 1;
return 0;
on_error:
- git_buf_free(&request);
+ git_buf_dispose(&request);
return -1;
}
diff --git a/src/transports/local.c b/src/transports/local.c
index 541c552..b1522d1 100644
--- a/src/transports/local.c
+++ b/src/transports/local.c
@@ -228,14 +228,14 @@ static int local_connect(
/* 'url' may be a url or path; convert to a path */
if ((error = git_path_from_url_or_path(&buf, url)) < 0) {
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
path = git_buf_cstr(&buf);
error = git_repository_open(&repo, path);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
if (error < 0)
return -1;
@@ -354,14 +354,14 @@ static int local_push(
/* 'push->remote->url' may be a url or path; convert to a path */
if ((error = git_path_from_url_or_path(&buf, push->remote->url)) < 0) {
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
path = git_buf_cstr(&buf);
error = git_repository_open(&remote_repo, path);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
if (error < 0)
return error;
@@ -383,7 +383,7 @@ static int local_push(
goto on_error;
error = git_packbuilder_write(push->pb, odb_path.ptr, 0, transfer_to_push_transfer, (void *) cbs);
- git_buf_free(&odb_path);
+ git_buf_dispose(&odb_path);
if (error < 0)
goto on_error;
@@ -502,7 +502,7 @@ static int local_counting(int stage, unsigned int current, unsigned int total, v
return -1;
error = t->progress_cb(git_buf_cstr(&progress_info), git_buf_len(&progress_info), t->message_cb_payload);
- git_buf_free(&progress_info);
+ git_buf_dispose(&progress_info);
return error;
}
@@ -627,7 +627,7 @@ static int local_download_pack(
cleanup:
if (writepack) writepack->free(writepack);
- git_buf_free(&progress_info);
+ git_buf_dispose(&progress_info);
git_packbuilder_free(pack);
git_revwalk_free(walk);
return error;
diff --git a/src/transports/smart.c b/src/transports/smart.c
index 6d5d95f..79b5a3e 100644
--- a/src/transports/smart.c
+++ b/src/transports/smart.c
@@ -171,7 +171,7 @@ int git_smart__update_heads(transport_smart *t, git_vector *symrefs)
ref->head.symref_target = git_buf_detach(&buf);
}
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
if (error < 0)
return error;
diff --git a/src/transports/smart_pkt.c b/src/transports/smart_pkt.c
index a661dfe..4824330 100644
--- a/src/transports/smart_pkt.c
+++ b/src/transports/smart_pkt.c
@@ -551,7 +551,7 @@ static int buffer_want_with_caps(const git_remote_head *head, transport_smart_ca
git_oid_fmt(oid, &head->oid);
git_buf_printf(buf,
"%04xwant %s %s\n", (unsigned int)len, oid, git_buf_cstr(&str));
- git_buf_free(&str);
+ git_buf_dispose(&str);
GITERR_CHECK_ALLOC_BUF(buf);
diff --git a/src/transports/smart_protocol.c b/src/transports/smart_protocol.c
index ab52e04..8a094b6 100644
--- a/src/transports/smart_protocol.c
+++ b/src/transports/smart_protocol.c
@@ -106,7 +106,7 @@ static int append_symref(const char **out, git_vector *symrefs, const char *ptr)
GITERR_CHECK_ALLOC(mapping);
error = git_refspec__parse(mapping, git_buf_cstr(&buf), true);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
/* if the error isn't OOM, then it's a parse error; let's use a nicer message */
if (error < 0) {
@@ -465,7 +465,7 @@ int git_smart__negotiate_fetch(git_transport *transport, git_repository *repo, c
if ((error = git_smart__negotiation_step(&t->parent, data.ptr, data.size)) < 0)
goto on_error;
- git_buf_free(&data);
+ git_buf_dispose(&data);
git_revwalk_free(walk);
/* Now let's eat up whatever the server gives us */
@@ -485,7 +485,7 @@ int git_smart__negotiate_fetch(git_transport *transport, git_repository *repo, c
on_error:
git_revwalk_free(walk);
- git_buf_free(&data);
+ git_buf_dispose(&data);
return error;
}
@@ -862,7 +862,7 @@ static int parse_report(transport_smart *transport, git_push *push)
}
}
done:
- git_buf_free(&data_pkt_buf);
+ git_buf_dispose(&data_pkt_buf);
return error;
}
@@ -1085,6 +1085,6 @@ int git_smart__push(git_transport *transport, git_push *push, const git_remote_c
}
done:
- git_buf_free(&pktline);
+ git_buf_dispose(&pktline);
return error;
}
diff --git a/src/transports/ssh.c b/src/transports/ssh.c
index 23c6433..7d9114c 100644
--- a/src/transports/ssh.c
+++ b/src/transports/ssh.c
@@ -121,7 +121,7 @@ static int send_command(ssh_stream *s)
s->sent_command = 1;
cleanup:
- git_buf_free(&request);
+ git_buf_dispose(&request);
return error;
}
diff --git a/src/transports/winhttp.c b/src/transports/winhttp.c
index e52d54b..4eb8b42 100644
--- a/src/transports/winhttp.c
+++ b/src/transports/winhttp.c
@@ -455,7 +455,7 @@ static int winhttp_stream_connect(winhttp_stream *s)
/* Convert URL to wide characters */
error = git__utf8_to_16_alloc(&proxy_wide, processed_url.ptr);
- git_buf_free(&processed_url);
+ git_buf_dispose(&processed_url);
if (error < 0)
goto on_error;
@@ -599,7 +599,7 @@ on_error:
winhttp_stream_close(s);
git__free(proxy_url);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
@@ -659,12 +659,12 @@ static int write_chunk(HINTERNET request, const char *buffer, size_t len)
if (!WinHttpWriteData(request,
git_buf_cstr(&buf), (DWORD)git_buf_len(&buf),
&bytes_written)) {
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
giterr_set(GITERR_OS, "failed to write chunk header");
return -1;
}
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
/* Chunk body */
if (!WinHttpWriteData(request,
@@ -779,11 +779,11 @@ static int winhttp_connect(
if (git__utf8_to_16_alloc(&wide_ua, git_buf_cstr(&ua)) < 0) {
giterr_set(GITERR_OS, "unable to convert host to wide characters");
git__free(wide_host);
- git_buf_free(&ua);
+ git_buf_dispose(&ua);
return -1;
}
- git_buf_free(&ua);
+ git_buf_dispose(&ua);
/* Establish session */
t->session = WinHttpOpen(
diff --git a/src/tree.c b/src/tree.c
index 1262297..2d7c91c 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -650,7 +650,7 @@ int git_tree__write_index(
}
ret = write_tree(oid, repo, index, "", 0, &shared_buf);
- git_buf_free(&shared_buf);
+ git_buf_dispose(&shared_buf);
if (old_ignore_case)
git_index__set_ignore_case(index, true);
@@ -814,7 +814,7 @@ int git_treebuilder_write(git_oid *oid, git_treebuilder *bld)
error = git_treebuilder_write_with_buffer(oid, bld, &buffer);
- git_buf_free(&buffer);
+ git_buf_dispose(&buffer);
return error;
}
@@ -1055,7 +1055,7 @@ int git_tree_walk(
error = tree_walk(
tree, callback, &root_path, payload, (mode == GIT_TREEWALK_PRE));
- git_buf_free(&root_path);
+ git_buf_dispose(&root_path);
return error;
}
@@ -1320,7 +1320,7 @@ cleanup:
}
}
- git_buf_free(&component);
+ git_buf_dispose(&component);
git_array_clear(stack);
git_vector_free(&entries);
return error;
diff --git a/src/win32/findfile.c b/src/win32/findfile.c
index d56aa1f..b5419be 100644
--- a/src/win32/findfile.c
+++ b/src/win32/findfile.c
@@ -158,7 +158,7 @@ static int win32_find_existing_dirs(
}
}
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return (git_buf_oom(out) ? -1 : 0);
}
@@ -185,7 +185,7 @@ int git_win32__find_system_dirs(git_buf *out, const wchar_t *subdir)
&buf, HKEY_LOCAL_MACHINE, REG_MSYSGIT_INSTALL, subdir) && buf.size)
git_buf_join(out, GIT_PATH_LIST_SEPARATOR, out->ptr, buf.ptr);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return (git_buf_oom(out) ? -1 : 0);
}
diff --git a/src/worktree.c b/src/worktree.c
index 48d3ef9..591df1c 100644
--- a/src/worktree.c
+++ b/src/worktree.c
@@ -25,7 +25,7 @@ static bool is_worktree_dir(const char *dir)
&& git_path_contains_file(&buf, "gitdir")
&& git_path_contains_file(&buf, "HEAD");
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return error;
}
@@ -64,7 +64,7 @@ int git_worktree_list(git_strarray *wts, git_repository *repo)
wts->strings = (char **)git_vector_detach(&wts->count, NULL, &worktrees);
exit:
- git_buf_free(&path);
+ git_buf_dispose(&path);
return error;
}
@@ -79,7 +79,7 @@ char *git_worktree__read_link(const char *base, const char *file)
goto err;
if (git_futils_readbuffer(&buf, path.ptr) < 0)
goto err;
- git_buf_free(&path);
+ git_buf_dispose(&path);
git_buf_rtrim(&buf);
@@ -90,13 +90,13 @@ char *git_worktree__read_link(const char *base, const char *file)
goto err;
if (git_path_apply_relative(&path, buf.ptr) < 0)
goto err;
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return git_buf_detach(&path);
err:
- git_buf_free(&buf);
- git_buf_free(&path);
+ git_buf_dispose(&buf);
+ git_buf_dispose(&path);
return NULL;
}
@@ -115,7 +115,7 @@ static int write_wtfile(const char *base, const char *file, const git_buf *buf)
goto out;
out:
- git_buf_free(&path);
+ git_buf_dispose(&path);
return err;
}
@@ -156,7 +156,7 @@ static int open_worktree_dir(git_worktree **out, const char *parent, const char
out:
if (error)
git_worktree_free(wt);
- git_buf_free(&gitdir);
+ git_buf_dispose(&gitdir);
return error;
}
@@ -178,7 +178,7 @@ int git_worktree_lookup(git_worktree **out, git_repository *repo, const char *na
goto out;
out:
- git_buf_free(&path);
+ git_buf_dispose(&path);
if (error)
git_worktree_free(wt);
@@ -213,7 +213,7 @@ int git_worktree_open_from_repository(git_worktree **out, git_repository *repo)
out:
git__free(name);
- git_buf_free(&parent);
+ git_buf_dispose(&parent);
return error;
}
@@ -265,7 +265,7 @@ int git_worktree_validate(const git_worktree *wt)
}
out:
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return err;
}
@@ -391,9 +391,9 @@ int git_worktree_add(git_worktree **out, git_repository *repo,
goto out;
out:
- git_buf_free(&gitdir);
- git_buf_free(&wddir);
- git_buf_free(&buf);
+ git_buf_dispose(&gitdir);
+ git_buf_dispose(&wddir);
+ git_buf_dispose(&buf);
git_reference_free(ref);
git_reference_free(head);
git_commit_free(commit);
@@ -424,7 +424,7 @@ int git_worktree_lock(git_worktree *wt, const char *reason)
wt->locked = 1;
out:
- git_buf_free(&path);
+ git_buf_dispose(&path);
return err;
}
@@ -442,13 +442,13 @@ int git_worktree_unlock(git_worktree *wt)
return -1;
if (p_unlink(path.ptr) != 0) {
- git_buf_free(&path);
+ git_buf_dispose(&path);
return -1;
}
wt->locked = 0;
- git_buf_free(&path);
+ git_buf_dispose(&path);
return 0;
}
@@ -469,7 +469,7 @@ int git_worktree_is_locked(git_buf *reason, const git_worktree *wt)
git_futils_readbuffer(reason, path.ptr);
out:
- git_buf_free(&path);
+ git_buf_dispose(&path);
return ret;
}
@@ -514,7 +514,7 @@ int git_worktree_is_prunable(git_worktree *wt,
if (!reason.size)
git_buf_attach_notowned(&reason, "no reason given", 15);
giterr_set(GITERR_WORKTREE, "Not pruning locked working tree: '%s'", reason.ptr);
- git_buf_free(&reason);
+ git_buf_dispose(&reason);
return 0;
}
@@ -582,7 +582,7 @@ int git_worktree_prune(git_worktree *wt,
goto out;
out:
- git_buf_free(&path);
+ git_buf_dispose(&path);
return err;
}
diff --git a/tests/apply/fromdiff.c b/tests/apply/fromdiff.c
index 3497739..6110609 100644
--- a/tests/apply/fromdiff.c
+++ b/tests/apply/fromdiff.c
@@ -63,8 +63,8 @@ static int apply_gitbuf(
}
git__free(filename);
- git_buf_free(&result);
- git_buf_free(&patchbuf);
+ git_buf_dispose(&result);
+ git_buf_dispose(&patchbuf);
git_patch_free(patch);
return error;
diff --git a/tests/apply/fromfile.c b/tests/apply/fromfile.c
index 31fffa1..0ace639 100644
--- a/tests/apply/fromfile.c
+++ b/tests/apply/fromfile.c
@@ -50,8 +50,8 @@ static int apply_patchfile(
}
git__free(filename);
- git_buf_free(&result);
- git_buf_free(&patchbuf);
+ git_buf_dispose(&result);
+ git_buf_dispose(&patchbuf);
git_patch_free(patch);
return error;
@@ -81,7 +81,7 @@ static int validate_and_apply_patchfile(
error = apply_patchfile(old, old_len, new, new_len, patchfile, filename_expected, mode_expected);
- git_buf_free(&validated);
+ git_buf_dispose(&validated);
git_patch_free(patch_fromdiff);
return error;
diff --git a/tests/attr/repo.c b/tests/attr/repo.c
index 8baf506..eb4300b 100644
--- a/tests/attr/repo.c
+++ b/tests/attr/repo.c
@@ -303,7 +303,7 @@ static void add_to_workdir(const char *filename, const char *content)
cl_git_pass(git_buf_joinpath(&buf, "attr", filename));
cl_git_rewritefile(git_buf_cstr(&buf), content);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
static void assert_proper_normalization(git_index *index, const char *filename, const char *expected_sha)
diff --git a/tests/buf/basic.c b/tests/buf/basic.c
index 14ea3e7..f90c4c6 100644
--- a/tests/buf/basic.c
+++ b/tests/buf/basic.c
@@ -12,7 +12,7 @@ void test_buf_basic__resize(void)
git_buf_puts(&buf1, test_string);
cl_assert(strlen(git_buf_cstr(&buf1)) == strlen(test_string) * 2);
- git_buf_free(&buf1);
+ git_buf_dispose(&buf1);
}
void test_buf_basic__resize_incremental(void)
@@ -34,7 +34,7 @@ void test_buf_basic__resize_incremental(void)
cl_assert_equal_i(5, buf1.size);
cl_assert(buf1.asize > 8);
- git_buf_free(&buf1);
+ git_buf_dispose(&buf1);
}
void test_buf_basic__printf(void)
@@ -47,5 +47,5 @@ void test_buf_basic__printf(void)
git_buf_printf(&buf2, "%s %d", "woop", 42);
cl_assert(git_buf_oom(&buf2) == 0);
cl_assert_equal_s(git_buf_cstr(&buf2), "shoop da 23 woop 42");
- git_buf_free(&buf2);
+ git_buf_dispose(&buf2);
}
diff --git a/tests/buf/oom.c b/tests/buf/oom.c
index b9fd29c..4294a90 100644
--- a/tests/buf/oom.c
+++ b/tests/buf/oom.c
@@ -27,7 +27,7 @@ void test_buf_oom__grow(void)
cl_assert(git_buf_grow(&buf, TOOBIG) == -1);
cl_assert(git_buf_oom(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_buf_oom__grow_by(void)
diff --git a/tests/buf/percent.c b/tests/buf/percent.c
index 60534a0..8c47b83 100644
--- a/tests/buf/percent.c
+++ b/tests/buf/percent.c
@@ -18,8 +18,8 @@ static void expect_decode_pass(const char *expected, const char *encoded)
cl_assert_equal_s(expected, git_buf_cstr(&out));
cl_assert_equal_i(strlen(expected), git_buf_len(&out));
- git_buf_free(&in);
- git_buf_free(&out);
+ git_buf_dispose(&in);
+ git_buf_dispose(&out);
}
void test_buf_percent__decode_succeeds(void)
diff --git a/tests/buf/quote.c b/tests/buf/quote.c
index 6f77ab9..8867ae7 100644
--- a/tests/buf/quote.c
+++ b/tests/buf/quote.c
@@ -11,7 +11,7 @@ static void expect_quote_pass(const char *expected, const char *str)
cl_assert_equal_s(expected, git_buf_cstr(&buf));
cl_assert_equal_i(strlen(expected), git_buf_len(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_buf_quote__quote_succeeds(void)
@@ -38,7 +38,7 @@ static void expect_unquote_pass(const char *expected, const char *quoted)
cl_assert_equal_s(expected, git_buf_cstr(&buf));
cl_assert_equal_i(strlen(expected), git_buf_len(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
static void expect_unquote_fail(const char *quoted)
@@ -48,7 +48,7 @@ static void expect_unquote_fail(const char *quoted)
cl_git_pass(git_buf_puts(&buf, quoted));
cl_git_fail(git_buf_unquote(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_buf_quote__unquote_succeeds(void)
diff --git a/tests/buf/splice.c b/tests/buf/splice.c
index e80c931..18c7c3f 100644
--- a/tests/buf/splice.c
+++ b/tests/buf/splice.c
@@ -8,7 +8,7 @@ void test_buf_splice__initialize(void) {
}
void test_buf_splice__cleanup(void) {
- git_buf_free(&_buf);
+ git_buf_dispose(&_buf);
}
void test_buf_splice__preprend(void)
diff --git a/tests/checkout/checkout_helpers.c b/tests/checkout/checkout_helpers.c
index d7d24f3..144be6a 100644
--- a/tests/checkout/checkout_helpers.c
+++ b/tests/checkout/checkout_helpers.c
@@ -16,7 +16,7 @@ void assert_on_branch(git_repository *repo, const char *branch)
cl_assert_equal_s(bname.ptr, git_reference_symbolic_target(head));
git_reference_free(head);
- git_buf_free(&bname);
+ git_buf_dispose(&bname);
}
void reset_index_to_treeish(git_object *treeish)
diff --git a/tests/checkout/conflict.c b/tests/checkout/conflict.c
index dd2dd31..9b86cfa 100644
--- a/tests/checkout/conflict.c
+++ b/tests/checkout/conflict.c
@@ -109,7 +109,7 @@ static void create_index(struct checkout_index_entry *entries, size_t entries_le
cl_git_pass(git_index_add(g_index, &entry));
}
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
static void create_index_names(struct checkout_name_entry *entries, size_t entries_len)
@@ -146,8 +146,8 @@ static void ensure_workdir_contents(const char *path, const char *contents)
cl_git_pass(git_futils_readbuffer(&data_buf, git_buf_cstr(&fullpath)));
cl_assert(strcmp(git_buf_cstr(&data_buf), contents) == 0);
- git_buf_free(&fullpath);
- git_buf_free(&data_buf);
+ git_buf_dispose(&fullpath);
+ git_buf_dispose(&data_buf);
}
static void ensure_workdir_oid(const char *path, const char *oid_str)
@@ -174,7 +174,7 @@ static void ensure_workdir_mode(const char *path, int mode)
cl_git_pass(p_stat(git_buf_cstr(&fullpath), &st));
cl_assert_equal_i((mode & S_IRWXU), (st.st_mode & S_IRWXU));
- git_buf_free(&fullpath);
+ git_buf_dispose(&fullpath);
#endif
}
@@ -204,7 +204,7 @@ static void ensure_workdir_link(const char *path, const char *target)
actual[len] = '\0';
cl_assert(strcmp(actual, target) == 0);
- git_buf_free(&fullpath);
+ git_buf_dispose(&fullpath);
#endif
}
diff --git a/tests/checkout/crlf.c b/tests/checkout/crlf.c
index d467eaa..ed9745d 100644
--- a/tests/checkout/crlf.c
+++ b/tests/checkout/crlf.c
@@ -29,7 +29,7 @@ void test_checkout_crlf__cleanup(void)
if (expected_fixture.size) {
cl_fixture_cleanup(expected_fixture.ptr);
- git_buf_free(&expected_fixture);
+ git_buf_dispose(&expected_fixture);
}
}
@@ -84,13 +84,13 @@ done:
git_path_basename(actual_path->ptr), systype, cd->autocrlf, cd->attrs);
clar__fail(__FILE__, __LINE__,
"checked out contents did not match expected", details.ptr, 0);
- git_buf_free(&details);
+ git_buf_dispose(&details);
}
git__free(basename);
- git_buf_free(&expected_contents);
- git_buf_free(&actual_contents);
- git_buf_free(&expected_path);
+ git_buf_dispose(&expected_contents);
+ git_buf_dispose(&actual_contents);
+ git_buf_dispose(&expected_path);
return 0;
}
@@ -139,13 +139,13 @@ static void test_checkout(const char *autocrlf, const char *attrs)
cl_git_pass(git_path_direach(&reponame, 0, compare_file, &compare_data));
cl_fixture_cleanup(expected_fixture.ptr);
- git_buf_free(&expected_fixture);
+ git_buf_dispose(&expected_fixture);
- git_buf_free(&attrbuf);
- git_buf_free(&expected_fixture);
- git_buf_free(&expected_dirname);
- git_buf_free(&sandboxname);
- git_buf_free(&reponame);
+ git_buf_dispose(&attrbuf);
+ git_buf_dispose(&expected_fixture);
+ git_buf_dispose(&expected_dirname);
+ git_buf_dispose(&sandboxname);
+ git_buf_dispose(&reponame);
}
static void empty_workdir(const char *name)
diff --git a/tests/checkout/icase.c b/tests/checkout/icase.c
index 55ab3ab..560c1ad 100644
--- a/tests/checkout/icase.c
+++ b/tests/checkout/icase.c
@@ -89,7 +89,7 @@ static char *get_filename(const char *in)
git__free(search_dirname);
git__free(search_filename);
- git_buf_free(&out);
+ git_buf_dispose(&out);
return filename;
#endif
diff --git a/tests/checkout/index.c b/tests/checkout/index.c
index ca63dc3..a649d85 100644
--- a/tests/checkout/index.c
+++ b/tests/checkout/index.c
@@ -718,7 +718,7 @@ void test_checkout_index__writes_conflict_file(void)
"=======\n"
"this file is changed in branch and master\n"
">>>>>>> theirs\n") == 0);
- git_buf_free(&conflicting_buf);
+ git_buf_dispose(&conflicting_buf);
git_index_free(index);
}
@@ -768,7 +768,7 @@ void test_checkout_index__conflicts_honor_coreautocrlf(void)
"=======\r\n"
"this file is changed in branch and master\r\n"
">>>>>>> theirs\r\n") == 0);
- git_buf_free(&conflicting_buf);
+ git_buf_dispose(&conflicting_buf);
git_index_free(index);
#endif
diff --git a/tests/checkout/nasty.c b/tests/checkout/nasty.c
index d4d3c8f..042fbba 100644
--- a/tests/checkout/nasty.c
+++ b/tests/checkout/nasty.c
@@ -42,7 +42,7 @@ static void test_checkout_passes(const char *refname, const char *filename)
cl_assert(!git_path_exists(path.ptr));
git_commit_free(commit);
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
static void test_checkout_fails(const char *refname, const char *filename)
@@ -63,7 +63,7 @@ static void test_checkout_fails(const char *refname, const char *filename)
cl_assert(!git_path_exists(path.ptr));
git_commit_free(commit);
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
/* A tree that contains ".git" as a tree, with a blob inside
diff --git a/tests/checkout/tree.c b/tests/checkout/tree.c
index a7e29b3..35c0ece 100644
--- a/tests/checkout/tree.c
+++ b/tests/checkout/tree.c
@@ -550,7 +550,7 @@ void assert_conflict(
/* Create a conflicting file */
cl_git_pass(git_buf_joinpath(&file_path, "./testrepo", entry_path));
cl_git_mkfile(git_buf_cstr(&file_path), new_content);
- git_buf_free(&file_path);
+ git_buf_dispose(&file_path);
/* Trying to checkout the original commit */
cl_git_pass(git_revparse_single(&g_object, g_repo, commit_sha));
@@ -1044,7 +1044,7 @@ mode_t read_filemode(const char *path)
result = GIT_PERMS_IS_EXEC(st.st_mode) ?
GIT_FILEMODE_BLOB_EXECUTABLE : GIT_FILEMODE_BLOB;
- git_buf_free(&fullpath);
+ git_buf_dispose(&fullpath);
return result;
}
@@ -1343,8 +1343,8 @@ void test_checkout_tree__caches_attributes_during_checkout(void)
cl_assert_equal_strn(ident1.ptr, "# $Id: ", 7);
cl_assert_equal_strn(ident2.ptr, "# $Id: ", 7);
- git_buf_free(&ident1);
- git_buf_free(&ident2);
+ git_buf_dispose(&ident1);
+ git_buf_dispose(&ident2);
git_object_free(obj);
}
diff --git a/tests/checkout/typechange.c b/tests/checkout/typechange.c
index 647b534..7299f8d 100644
--- a/tests/checkout/typechange.c
+++ b/tests/checkout/typechange.c
@@ -139,7 +139,7 @@ static void assert_workdir_matches_tree(
}
git_tree_free(tree);
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
void test_checkout_typechange__checkout_typechanges_safe(void)
@@ -249,8 +249,8 @@ static int make_submodule_dirty(git_submodule *sm, const char *name, void *paylo
git_buf_joinpath(&dirtypath, git_repository_workdir(submodule_repo), "dirty"));
force_create_file(git_buf_cstr(&dirtypath));
- git_buf_free(&dirtypath);
- git_buf_free(&submodulepath);
+ git_buf_dispose(&dirtypath);
+ git_buf_dispose(&submodulepath);
git_repository_free(submodule_repo);
return 0;
diff --git a/tests/cherrypick/workdir.c b/tests/cherrypick/workdir.c
index 2b45f5a..d83f54b 100644
--- a/tests/cherrypick/workdir.c
+++ b/tests/cherrypick/workdir.c
@@ -228,8 +228,8 @@ void test_cherrypick_workdir__conflicts(void)
git_commit_free(commit);
git_commit_free(head);
- git_buf_free(&mergemsg_buf);
- git_buf_free(&conflicting_buf);
+ git_buf_dispose(&mergemsg_buf);
+ git_buf_dispose(&conflicting_buf);
}
/* git reset --hard bafbf6912c09505ac60575cd43d3f2aba3bd84d8
@@ -358,7 +358,7 @@ void test_cherrypick_workdir__both_renamed(void)
"\tfile3.txt.renamed\n" \
"\tfile3.txt.renamed_on_branch\n") == 0);
- git_buf_free(&mergemsg_buf);
+ git_buf_dispose(&mergemsg_buf);
git_commit_free(commit);
git_commit_free(head);
}
diff --git a/tests/clar_libgit2.c b/tests/clar_libgit2.c
index bd10c00..92404b5 100644
--- a/tests/clar_libgit2.c
+++ b/tests/clar_libgit2.c
@@ -310,8 +310,8 @@ const char* cl_git_path_url(const char *path)
cl_assert(url_buf.size < 4096);
strncpy(url, git_buf_cstr(&url_buf), 4096);
- git_buf_free(&url_buf);
- git_buf_free(&path_buf);
+ git_buf_dispose(&url_buf);
+ git_buf_dispose(&path_buf);
return url;
}
@@ -359,7 +359,7 @@ int cl_git_remove_placeholders(const char *directory_path, const char *filename)
error = remove_placeholders_recurs(&data, &buffer);
- git_buf_free(&buffer);
+ git_buf_dispose(&buffer);
return error;
}
@@ -544,7 +544,7 @@ void cl_fake_home(void)
cl_git_pass(git_path_prettify(&path, "home", NULL));
cl_git_pass(git_libgit2_opts(
GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_GLOBAL, path.ptr));
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
void cl_sandbox_set_search_path_defaults(void)
@@ -565,7 +565,7 @@ void cl_sandbox_set_search_path_defaults(void)
git_libgit2_opts(
GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_PROGRAMDATA, path.ptr);
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
#ifdef GIT_WIN32
@@ -584,7 +584,7 @@ bool cl_sandbox_supports_8dot3(void)
supported = (shortname != NULL);
git__free(shortname);
- git_buf_free(&longpath);
+ git_buf_dispose(&longpath);
return supported;
}
diff --git a/tests/clone/empty.c b/tests/clone/empty.c
index 2a62175..8e59d2b 100644
--- a/tests/clone/empty.c
+++ b/tests/clone/empty.c
@@ -53,13 +53,13 @@ void test_clone_empty__can_clone_an_empty_local_repo_barely(void)
cl_git_pass(git_branch_upstream_name(&buf, g_repo_cloned, local_name));
cl_assert_equal_s(expected_tracked_branch_name, buf.ptr);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
/* ...and the name of the remote... */
cl_git_pass(git_branch_remote_name(&buf, g_repo_cloned, expected_tracked_branch_name));
cl_assert_equal_s(expected_remote_name, buf.ptr);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
/* ...even when the remote HEAD is unborn as well */
cl_assert_equal_i(GIT_ENOTFOUND, git_reference_lookup(&ref, g_repo_cloned,
diff --git a/tests/clone/local.c b/tests/clone/local.c
index 7f54d05..9416918 100644
--- a/tests/clone/local.c
+++ b/tests/clone/local.c
@@ -91,7 +91,7 @@ void test_clone_local__should_clone_local(void)
cl_assert_equal_i(1, git_clone__should_clone_local(path, GIT_CLONE_LOCAL_NO_LINKS));
cl_assert_equal_i(0, git_clone__should_clone_local(path, GIT_CLONE_NO_LOCAL));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_clone_local__hardlinks(void)
@@ -149,7 +149,7 @@ void test_clone_local__hardlinks(void)
cl_assert_equal_i(3, st.st_nlink);
#endif
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_repository_free(repo);
cl_git_pass(git_futils_rmdir_r("./clone.git", NULL, GIT_RMDIR_REMOVE_FILES));
@@ -179,8 +179,8 @@ void test_clone_local__standard_unc_paths_are_written_git_style(void)
git_remote_free(remote);
git_repository_free(repo);
- git_buf_free(&unc);
- git_buf_free(&git_unc);
+ git_buf_dispose(&unc);
+ git_buf_dispose(&git_unc);
cl_git_pass(git_futils_rmdir_r("./clone.git", NULL, GIT_RMDIR_REMOVE_FILES));
#endif
@@ -206,7 +206,7 @@ void test_clone_local__git_style_unc_paths(void)
git_remote_free(remote);
git_repository_free(repo);
- git_buf_free(&git_unc);
+ git_buf_dispose(&git_unc);
cl_git_pass(git_futils_rmdir_r("./clone.git", NULL, GIT_RMDIR_REMOVE_FILES));
#endif
diff --git a/tests/clone/nonetwork.c b/tests/clone/nonetwork.c
index 7ebf19f..9c3a1e5 100644
--- a/tests/clone/nonetwork.c
+++ b/tests/clone/nonetwork.c
@@ -154,7 +154,7 @@ void test_clone_nonetwork__can_prevent_the_checkout_of_a_standard_repo(void)
cl_git_pass(git_buf_joinpath(&path, git_repository_workdir(g_repo), "master.txt"));
cl_assert_equal_i(false, git_path_isfile(git_buf_cstr(&path)));
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
void test_clone_nonetwork__can_checkout_given_branch(void)
@@ -309,7 +309,7 @@ static void assert_correct_reflog(const char *name)
git_reflog_free(log);
- git_buf_free(&expected_message);
+ git_buf_dispose(&expected_message);
}
void test_clone_nonetwork__clone_updates_reflog_properly(void)
diff --git a/tests/commit/parse.c b/tests/commit/parse.c
index 297fccc..e61589d 100644
--- a/tests/commit/parse.c
+++ b/tests/commit/parse.c
@@ -464,7 +464,7 @@ cpxtDQQMGYFpXK/71stq\n\
cl_git_pass(git_commit_header_field(&buf, commit, "committer"));
cl_assert_equal_s("Vicent Marti <tanoku@gmail.com> 1273848544 +0200", buf.ptr);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_commit__free(commit);
}
@@ -547,7 +547,7 @@ corrupt signature\n";
cl_assert_equal_s(oneline_data, signed_data.ptr);
- git_buf_free(&signature);
- git_buf_free(&signed_data);
+ git_buf_dispose(&signature);
+ git_buf_dispose(&signed_data);
}
diff --git a/tests/commit/write.c b/tests/commit/write.c
index 030d415..7b0af8c 100644
--- a/tests/commit/write.c
+++ b/tests/commit/write.c
@@ -130,7 +130,7 @@ This is a root commit\n\
This is a root commit and should be the only one in this branch\n\
");
- git_buf_free(&commit);
+ git_buf_dispose(&commit);
git_tree_free(tree);
git_commit_free(parent);
git_signature_free(author);
diff --git a/tests/config/conditionals.c b/tests/config/conditionals.c
index 3a87de2..cb1f916 100644
--- a/tests/config/conditionals.c
+++ b/tests/config/conditionals.c
@@ -43,7 +43,7 @@ static void assert_condition_includes(const char *keyword, const char *path, boo
git_config_get_string_buf(&buf, cfg, "foo.bar"));
}
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_config_free(cfg);
}
@@ -77,7 +77,7 @@ void test_config_conditionals__gitdir(void)
assert_condition_includes("gitdir", path.ptr, false);
git__free(sandbox_path);
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
void test_config_conditionals__gitdir_i(void)
@@ -94,7 +94,7 @@ void test_config_conditionals__gitdir_i(void)
assert_condition_includes("gitdir/i", path.ptr, true);
git__free(sandbox_path);
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
void test_config_conditionals__invalid_conditional_fails(void)
diff --git a/tests/config/config_helpers.c b/tests/config/config_helpers.c
index 025838a..d92ff1a 100644
--- a/tests/config/config_helpers.c
+++ b/tests/config/config_helpers.c
@@ -36,7 +36,7 @@ void assert_config_entry_value(
cl_git_pass(git_config_get_string_buf(&buf, config, name));
cl_assert_equal_s(expected_value, git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
static int count_config_entries_cb(
diff --git a/tests/config/configlevel.c b/tests/config/configlevel.c
index b73656c..15c469f 100644
--- a/tests/config/configlevel.c
+++ b/tests/config/configlevel.c
@@ -33,7 +33,7 @@ void test_config_configlevel__can_replace_a_config_file_at_an_existing_level(voi
cl_git_pass(git_config_get_string_buf(&buf, cfg, "core.stringglobal"));
cl_assert_equal_s("don't find me!", buf.ptr);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_config_free(cfg);
}
@@ -56,7 +56,7 @@ void test_config_configlevel__can_read_from_a_single_level_focused_file_after_pa
cl_git_pass(git_config_get_string_buf(&buf, single_level_cfg, "core.stringglobal"));
cl_assert_equal_s("don't find me!", buf.ptr);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_config_free(single_level_cfg);
}
diff --git a/tests/config/global.c b/tests/config/global.c
index a149dc0..9446d8d 100644
--- a/tests/config/global.c
+++ b/tests/config/global.c
@@ -21,7 +21,7 @@ void test_config_global__initialize(void)
cl_git_pass(git_libgit2_opts(
GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_SYSTEM, path.ptr));
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
void test_config_global__cleanup(void)
@@ -60,7 +60,7 @@ void test_config_global__open_xdg(void)
cl_git_pass(git_config_get_string_buf(&buf, selected, key));
cl_assert_equal_s(str, buf.ptr);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_config_free(selected);
git_config_free(xdg);
git_config_free(cfg);
@@ -87,7 +87,7 @@ void test_config_global__open_programdata(void)
cl_git_pass(git_config_open_ondisk(&cfg, config_path.ptr));
cl_git_pass(git_config_set_string(cfg, "programdata.var", "even higher level"));
- git_buf_free(&config_path);
+ git_buf_dispose(&config_path);
git_config_free(cfg);
git_config_open_default(&cfg);
@@ -95,7 +95,7 @@ void test_config_global__open_programdata(void)
cl_assert_equal_s("even higher level", var_contents.ptr);
git_config_free(cfg);
- git_buf_free(&var_contents);
+ git_buf_dispose(&var_contents);
cl_git_pass(git_repository_init(&repo, "./foo.git", true));
cl_git_pass(git_repository_config(&cfg, repo));
@@ -103,7 +103,7 @@ void test_config_global__open_programdata(void)
cl_assert_equal_s("even higher level", var_contents.ptr);
git_config_free(cfg);
- git_buf_free(&var_contents);
+ git_buf_dispose(&var_contents);
git_repository_free(repo);
cl_fixture_cleanup("./foo.git");
}
diff --git a/tests/config/include.c b/tests/config/include.c
index e440b9a..d2ea2c2 100644
--- a/tests/config/include.c
+++ b/tests/config/include.c
@@ -14,7 +14,7 @@ void test_config_include__initialize(void)
void test_config_include__cleanup(void)
{
git_config_free(cfg);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_config_include__relative(void)
@@ -30,7 +30,7 @@ void test_config_include__absolute(void)
cl_git_pass(git_buf_printf(&buf, "[include]\npath = %s/config-included", cl_fixture("config")));
cl_git_mkfile("config-include-absolute", git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
cl_git_pass(git_config_open_ondisk(&cfg, "config-include-absolute"));
cl_git_pass(git_config_get_string_buf(&buf, cfg, "foo.bar.baz"));
diff --git a/tests/config/new.c b/tests/config/new.c
index b39baa0..bb3a2d9 100644
--- a/tests/config/new.c
+++ b/tests/config/new.c
@@ -27,7 +27,7 @@ void test_config_new__write_new_config(void)
cl_git_pass(git_config_get_string_buf(&buf, config, "core.editor"));
cl_assert_equal_s("ed", git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_config_free(config);
p_unlink(TEST_CONFIG);
diff --git a/tests/config/read.c b/tests/config/read.c
index ebcd2eb..ddc5c8c 100644
--- a/tests/config/read.c
+++ b/tests/config/read.c
@@ -6,7 +6,7 @@ static git_buf buf = GIT_BUF_INIT;
void test_config_read__cleanup(void)
{
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_config_read__simple_read(void)
@@ -688,29 +688,29 @@ void test_config_read__path(void)
cl_git_pass(git_config_open_ondisk(&cfg, "./testconfig"));
cl_git_pass(git_config_get_path(&path, cfg, "some.path"));
cl_assert_equal_s(expected_path.ptr, path.ptr);
- git_buf_free(&path);
+ git_buf_dispose(&path);
cl_git_mkfile("./testconfig", "[some]\n path = ~/");
cl_git_pass(git_path_join_unrooted(&expected_path, "", home_path.ptr, NULL));
cl_git_pass(git_config_get_path(&path, cfg, "some.path"));
cl_assert_equal_s(expected_path.ptr, path.ptr);
- git_buf_free(&path);
+ git_buf_dispose(&path);
cl_git_mkfile("./testconfig", "[some]\n path = ~");
cl_git_pass(git_buf_sets(&expected_path, home_path.ptr));
cl_git_pass(git_config_get_path(&path, cfg, "some.path"));
cl_assert_equal_s(expected_path.ptr, path.ptr);
- git_buf_free(&path);
+ git_buf_dispose(&path);
cl_git_mkfile("./testconfig", "[some]\n path = ~user/foo");
cl_git_fail(git_config_get_path(&path, cfg, "some.path"));
cl_git_pass(git_libgit2_opts(GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_GLOBAL, old_path.ptr));
- git_buf_free(&old_path);
- git_buf_free(&home_path);
- git_buf_free(&expected_path);
+ git_buf_dispose(&old_path);
+ git_buf_dispose(&home_path);
+ git_buf_dispose(&expected_path);
git_config_free(cfg);
}
@@ -726,7 +726,7 @@ void test_config_read__crlf_style_line_endings(void)
cl_assert_equal_s(buf.ptr, "value");
git_config_free(cfg);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_config_read__trailing_crlf(void)
@@ -741,7 +741,7 @@ void test_config_read__trailing_crlf(void)
cl_assert_equal_s(buf.ptr, "value");
git_config_free(cfg);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_config_read__bom(void)
@@ -756,5 +756,5 @@ void test_config_read__bom(void)
cl_assert_equal_s(buf.ptr, "value");
git_config_free(cfg);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
diff --git a/tests/config/stress.c b/tests/config/stress.c
index a6b6655..d86a11d 100644
--- a/tests/config/stress.c
+++ b/tests/config/stress.c
@@ -22,7 +22,7 @@ void test_config_stress__initialize(void)
void test_config_stress__cleanup(void)
{
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
p_unlink(TEST_CONFIG);
}
diff --git a/tests/config/write.c b/tests/config/write.c
index 6687ba1..cffa54e 100644
--- a/tests/config/write.c
+++ b/tests/config/write.c
@@ -293,7 +293,7 @@ void test_config_write__write_subsection(void)
cl_git_pass(git_config_get_string_buf(&buf, cfg, "my.own.var"));
cl_assert_equal_s("works", git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_config_free(cfg);
}
@@ -335,7 +335,7 @@ void test_config_write__value_containing_quotes(void)
cl_git_pass(git_config_open_ondisk(&cfg, "config9"));
cl_git_pass(git_config_get_string_buf(&buf, cfg, "core.somevar"));
cl_assert_equal_s("this also \"has\" quotes", git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_config_free(cfg);
}
@@ -354,7 +354,7 @@ void test_config_write__escape_value(void)
cl_git_pass(git_config_open_ondisk(&cfg, "config9"));
cl_git_pass(git_config_get_string_buf(&buf, cfg, "core.somevar"));
cl_assert_equal_s("this \"has\" quotes and \t", git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_config_free(cfg);
}
@@ -393,7 +393,7 @@ void test_config_write__add_value_at_specific_level(void)
cl_git_pass(git_config_get_string_buf(&buf, cfg, "core.stringglobal"));
cl_assert_equal_s("I'm a global config value!", git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_config_free(cfg);
}
@@ -489,7 +489,7 @@ void test_config_write__can_set_an_empty_value(void)
cl_git_pass(git_config_get_string_buf(&buf, config, "core.somevar"));
cl_assert_equal_s("", buf.ptr);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_config_free(config);
cl_git_sandbox_cleanup();
}
@@ -581,7 +581,7 @@ void test_config_write__preserves_whitespace_and_comments(void)
cl_assert_equal_s("[newsection]\n\tnewname = new_value\n", n);
- git_buf_free(&newfile);
+ git_buf_dispose(&newfile);
git_config_free(cfg);
}
@@ -600,7 +600,7 @@ void test_config_write__preserves_entry_with_name_only(void)
cl_git_pass(git_futils_readbuffer(&newfile, file_name));
cl_assert_equal_s("[section \"foo\"]\n\tname\n\tother = otherval\n[newsection]\n\tnewname = new_value\n", newfile.ptr);
- git_buf_free(&newfile);
+ git_buf_dispose(&newfile);
git_config_free(cfg);
}
@@ -618,7 +618,7 @@ void test_config_write__to_empty_file(void)
cl_git_pass(git_futils_readbuffer(&result, "config-file"));
cl_assert_equal_s("[section]\n\tname = value\n", result.ptr);
- git_buf_free(&result);
+ git_buf_dispose(&result);
}
void test_config_write__to_file_with_only_comment(void)
@@ -635,7 +635,7 @@ void test_config_write__to_file_with_only_comment(void)
cl_git_pass(git_futils_readbuffer(&result, "config-file"));
cl_assert_equal_s("\n\n[section]\n\tname = value\n", result.ptr);
- git_buf_free(&result);
+ git_buf_dispose(&result);
}
void test_config_write__locking(void)
@@ -718,7 +718,7 @@ void test_config_write__repeated(void)
cl_git_pass(git_futils_readbuffer(&result, filename));
cl_assert_equal_s(expected, result.ptr);
- git_buf_free(&result);
+ git_buf_dispose(&result);
git_config_free(cfg);
}
@@ -741,7 +741,7 @@ void test_config_write__preserve_case(void)
cl_git_pass(git_futils_readbuffer(&result, filename));
cl_assert_equal_s(expected, result.ptr);
- git_buf_free(&result);
+ git_buf_dispose(&result);
git_config_free(cfg);
}
diff --git a/tests/core/buffer.c b/tests/core/buffer.c
index c4308cb..b8a76b3 100644
--- a/tests/core/buffer.c
+++ b/tests/core/buffer.c
@@ -28,7 +28,7 @@ void test_core_buffer__0(void)
cl_assert(git_buf_oom(&buf) == 0);
cl_assert_equal_s(test_string_x2, git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
/* test git_buf_printf */
@@ -44,7 +44,7 @@ void test_core_buffer__1(void)
cl_assert(git_buf_oom(&buf) == 0);
cl_assert_equal_s("shoop da 23 woop 42", git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
/* more thorough test of concatenation options */
@@ -57,7 +57,7 @@ void test_core_buffer__2(void)
cl_assert(buf.size == 0);
/* this must be safe to do */
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
cl_assert(buf.size == 0);
cl_assert(buf.asize == 0);
@@ -67,7 +67,7 @@ void test_core_buffer__2(void)
/* cl_assert(buf.asize == 0); -- should not assume what git_buf does */
/* free should set us back to the beginning */
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
cl_assert(buf.size == 0);
cl_assert(buf.asize == 0);
@@ -88,7 +88,7 @@ void test_core_buffer__2(void)
}
cl_assert_equal_s("++++++++++++++++++", git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
/* add data */
git_buf_put(&buf, "xo", 2);
@@ -108,7 +108,7 @@ void test_core_buffer__2(void)
cl_assert_equal_s("xoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxoxo",
git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
/* set to string */
git_buf_sets(&buf, test_string);
@@ -129,7 +129,7 @@ void test_core_buffer__2(void)
git_buf_clear(&buf);
cl_assert_equal_s("", git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
/* test extracting data into buffer */
git_buf_puts(&buf, REP4("0123456789"));
@@ -153,7 +153,7 @@ void test_core_buffer__2(void)
cl_assert_equal_s(REP4(REP16("x")) REP16("x") REP16("x")
REP16("x") "xxxxxxxxxxxxxxx", data);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_buf_copy_cstr(data, sizeof(data), &buf);
cl_assert_equal_s("", data);
@@ -179,7 +179,7 @@ void test_core_buffer__3(void)
cl_assert(git_buf_oom(&buf) == 0);
cl_assert_equal_s(test_4096, git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
/* let's try some producer/consumer tests */
@@ -212,7 +212,7 @@ void test_core_buffer__4(void)
git_buf_consume(&buf, buf.ptr + buf.size);
cl_assert_equal_s("", git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
@@ -235,7 +235,7 @@ check_buf_append(
if (expected_asize > 0)
cl_assert(tgt.asize == expected_asize);
- git_buf_free(&tgt);
+ git_buf_dispose(&tgt);
}
static void
@@ -275,7 +275,7 @@ check_buf_append_abc(
cl_assert(git_buf_oom(&buf) == 0);
cl_assert_equal_s(expected_abcabc, git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
/* more variations on append tests */
@@ -340,8 +340,8 @@ void test_core_buffer__6(void)
cl_assert_equal_s("bar", git_buf_cstr(&a));
cl_assert_equal_s("foo", git_buf_cstr(&b));
- git_buf_free(&a);
- git_buf_free(&b);
+ git_buf_dispose(&a);
+ git_buf_dispose(&b);
}
@@ -367,7 +367,7 @@ void test_core_buffer__7(void)
cl_assert_equal_s(NULL, b);
cl_assert_equal_s("", a.ptr);
- git_buf_free(&a);
+ git_buf_dispose(&a);
b = git__strdup(fun);
git_buf_attach(&a, b, 0);
@@ -376,7 +376,7 @@ void test_core_buffer__7(void)
cl_assert(a.size == strlen(fun));
cl_assert(a.asize == strlen(fun) + 1);
- git_buf_free(&a);
+ git_buf_dispose(&a);
b = git__strdup(fun);
git_buf_attach(&a, b, strlen(fun) + 1);
@@ -385,7 +385,7 @@ void test_core_buffer__7(void)
cl_assert(a.size == strlen(fun));
cl_assert(a.asize == strlen(fun) + 1);
- git_buf_free(&a);
+ git_buf_dispose(&a);
}
@@ -401,7 +401,7 @@ check_joinbuf_2(
git_buf_join(&buf, sep, a, b);
cl_assert(git_buf_oom(&buf) == 0);
cl_assert_equal_s(expected, git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
static void
@@ -418,7 +418,7 @@ check_joinbuf_overlapped(
git_buf_join(&buf, sep, buf.ptr + ofs_a, b);
cl_assert(git_buf_oom(&buf) == 0);
cl_assert_equal_s(expected, git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
static void
@@ -437,7 +437,7 @@ check_joinbuf_n_2(
cl_assert(git_buf_oom(&buf) == 0);
cl_assert_equal_s(expected, git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
static void
@@ -453,7 +453,7 @@ check_joinbuf_n_4(
git_buf_join_n(&buf, sep, 4, a, b, c, d);
cl_assert(git_buf_oom(&buf) == 0);
cl_assert_equal_s(expected, git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
/* test join */
@@ -473,7 +473,7 @@ void test_core_buffer__8(void)
cl_assert(git_buf_oom(&a) == 0);
cl_assert_equal_s("foo/bar/baz", git_buf_cstr(&a));
- git_buf_free(&a);
+ git_buf_dispose(&a);
check_joinbuf_2(NULL, "", "");
check_joinbuf_2(NULL, "a", "a");
@@ -578,7 +578,7 @@ void test_core_buffer__9(void)
}
}
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_core_buffer__10(void)
@@ -595,7 +595,7 @@ void test_core_buffer__10(void)
cl_git_pass(git_buf_join_n(&a, '/', 2, a.ptr, "more"));
cl_assert_equal_s(a.ptr, "test/string/join/test/string/join/more");
- git_buf_free(&a);
+ git_buf_dispose(&a);
}
void test_core_buffer__join3(void)
@@ -627,7 +627,7 @@ void test_core_buffer__join3(void)
cl_git_pass(git_buf_join3(&a, '/', "string/", "", "/join"));
cl_assert_equal_s("string/join", a.ptr);
- git_buf_free(&a);
+ git_buf_dispose(&a);
}
void test_core_buffer__11(void)
@@ -677,7 +677,7 @@ void test_core_buffer__11(void)
cl_git_pass(git_buf_text_common_prefix(&a, &t));
cl_assert_equal_s(a.ptr, "");
- git_buf_free(&a);
+ git_buf_dispose(&a);
}
void test_core_buffer__rfind_variants(void)
@@ -701,7 +701,7 @@ void test_core_buffer__rfind_variants(void)
cl_assert(git_buf_rfind(&a, 'q') == -1);
cl_assert(git_buf_rfind_next(&a, 'q') == -1);
- git_buf_free(&a);
+ git_buf_dispose(&a);
}
void test_core_buffer__puts_escaped(void)
@@ -724,7 +724,7 @@ void test_core_buffer__puts_escaped(void)
cl_git_pass(git_buf_text_puts_escape_regex(&a, "^match\\s*[A-Z]+.*"));
cl_assert_equal_s("\\^match\\\\s\\*\\[A-Z\\]\\+\\.\\*", a.ptr);
- git_buf_free(&a);
+ git_buf_dispose(&a);
}
static void assert_unescape(char *expected, char *to_unescape) {
@@ -735,7 +735,7 @@ static void assert_unescape(char *expected, char *to_unescape) {
cl_assert_equal_s(expected, buf.ptr);
cl_assert_equal_sz(strlen(expected), buf.size);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_core_buffer__unescape(void)
@@ -769,7 +769,7 @@ void test_core_buffer__encode_base64(void)
cl_git_pass(git_buf_encode_base64(&buf, "this!\n", 6));
cl_assert_equal_s("dGhpcyEK", buf.ptr);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_core_buffer__decode_base64(void)
@@ -790,7 +790,7 @@ void test_core_buffer__decode_base64(void)
cl_git_fail(git_buf_decode_base64(&buf, "This is not a valid base64 string!!!", 36));
cl_assert_equal_s("this!\n", buf.ptr);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_core_buffer__encode_base85(void)
@@ -810,7 +810,7 @@ void test_core_buffer__encode_base85(void)
cl_assert_equal_s("bZBXFAZc?TVqtS-AUHK3Wo~0{WMyOk", buf.ptr);
git_buf_clear(&buf);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_core_buffer__decode_base85(void)
@@ -832,7 +832,7 @@ void test_core_buffer__decode_base85(void)
cl_assert_equal_s("this is base 85 encoded", buf.ptr);
git_buf_clear(&buf);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_core_buffer__decode_base85_fails_gracefully(void)
@@ -848,7 +848,7 @@ void test_core_buffer__decode_base85_fails_gracefully(void)
cl_assert_equal_sz(6, buf.size);
cl_assert_equal_s("foobar", buf.ptr);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_core_buffer__classify_with_utf8(void)
@@ -977,7 +977,7 @@ void test_core_buffer__similarity_metric(void)
git_hashsig_free(a);
git_hashsig_free(b);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_futils_rmdir_r("scratch", NULL, GIT_RMDIR_REMOVE_FILES);
}
@@ -1057,7 +1057,7 @@ void test_core_buffer__similarity_metric_whitespace(void)
}
}
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
#include "../filter/crlf.h"
@@ -1150,8 +1150,8 @@ void test_core_buffer__lf_and_crlf_conversions(void)
cl_git_pass(git_buf_text_crlf_to_lf(&tgt, &src));
check_buf("\rcr\r", tgt);
- git_buf_free(&src);
- git_buf_free(&tgt);
+ git_buf_dispose(&src);
+ git_buf_dispose(&tgt);
/* blob correspondence tests */
@@ -1161,8 +1161,8 @@ void test_core_buffer__lf_and_crlf_conversions(void)
git_buf_sets(&src, ALL_CRLF_TEXT_RAW);
cl_git_pass(git_buf_text_crlf_to_lf(&tgt, &src));
check_buf(ALL_CRLF_TEXT_AS_LF, tgt);
- git_buf_free(&src);
- git_buf_free(&tgt);
+ git_buf_dispose(&src);
+ git_buf_dispose(&tgt);
git_buf_sets(&src, ALL_LF_TEXT_RAW);
cl_git_pass(git_buf_text_lf_to_crlf(&tgt, &src));
@@ -1170,8 +1170,8 @@ void test_core_buffer__lf_and_crlf_conversions(void)
git_buf_sets(&src, ALL_LF_TEXT_RAW);
cl_git_pass(git_buf_text_crlf_to_lf(&tgt, &src));
check_buf(ALL_LF_TEXT_AS_LF, tgt);
- git_buf_free(&src);
- git_buf_free(&tgt);
+ git_buf_dispose(&src);
+ git_buf_dispose(&tgt);
git_buf_sets(&src, MORE_CRLF_TEXT_RAW);
cl_git_pass(git_buf_text_lf_to_crlf(&tgt, &src));
@@ -1179,8 +1179,8 @@ void test_core_buffer__lf_and_crlf_conversions(void)
git_buf_sets(&src, MORE_CRLF_TEXT_RAW);
cl_git_pass(git_buf_text_crlf_to_lf(&tgt, &src));
check_buf(MORE_CRLF_TEXT_AS_LF, tgt);
- git_buf_free(&src);
- git_buf_free(&tgt);
+ git_buf_dispose(&src);
+ git_buf_dispose(&tgt);
git_buf_sets(&src, MORE_LF_TEXT_RAW);
cl_git_pass(git_buf_text_lf_to_crlf(&tgt, &src));
@@ -1188,8 +1188,8 @@ void test_core_buffer__lf_and_crlf_conversions(void)
git_buf_sets(&src, MORE_LF_TEXT_RAW);
cl_git_pass(git_buf_text_crlf_to_lf(&tgt, &src));
check_buf(MORE_LF_TEXT_AS_LF, tgt);
- git_buf_free(&src);
- git_buf_free(&tgt);
+ git_buf_dispose(&src);
+ git_buf_dispose(&tgt);
}
void test_core_buffer__dont_grow_borrowed(void)
diff --git a/tests/core/dirent.c b/tests/core/dirent.c
index 2bd6026..a2448b4 100644
--- a/tests/core/dirent.c
+++ b/tests/core/dirent.c
@@ -55,7 +55,7 @@ static void dirent_cleanup__cb(void *_d)
cl_must_pass(p_rmdir(top_dir));
- git_buf_free(&d->path);
+ git_buf_dispose(&d->path);
}
static void check_counts(walk_data *d)
diff --git a/tests/core/env.c b/tests/core/env.c
index 1af0e6e..7e7b327 100644
--- a/tests/core/env.c
+++ b/tests/core/env.c
@@ -162,8 +162,8 @@ void test_core_env__0(void)
(void)p_rmdir(*val);
}
- git_buf_free(&path);
- git_buf_free(&found);
+ git_buf_dispose(&path);
+ git_buf_dispose(&found);
}
@@ -206,7 +206,7 @@ void test_core_env__1(void)
GIT_ENOTFOUND, git_sysdir_find_system_file(&path, "nonexistentfile"));
#endif
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
static void check_global_searchpath(
@@ -245,7 +245,7 @@ static void check_global_searchpath(
cl_assert_equal_i(
GIT_ENOTFOUND, git_sysdir_find_global_file(temp, file));
- git_buf_free(&out);
+ git_buf_dispose(&out);
}
void test_core_env__2(void)
@@ -295,8 +295,8 @@ void test_core_env__2(void)
(void)p_rmdir(*val);
}
- git_buf_free(&path);
- git_buf_free(&found);
+ git_buf_dispose(&path);
+ git_buf_dispose(&found);
}
void test_core_env__substitution(void)
@@ -316,6 +316,6 @@ void test_core_env__substitution(void)
cl_git_pass(git_buf_join(&expected, GIT_PATH_LIST_SEPARATOR, "/tmp/a", "/tmp/b"));
cl_assert_equal_s(expected.ptr, buf.ptr);
- git_buf_free(&expected);
- git_buf_free(&buf);
+ git_buf_dispose(&expected);
+ git_buf_dispose(&buf);
}
diff --git a/tests/core/filebuf.c b/tests/core/filebuf.c
index ef7ac6b..51d8a01 100644
--- a/tests/core/filebuf.c
+++ b/tests/core/filebuf.c
@@ -210,8 +210,8 @@ void test_core_filebuf__symlink_follow_absolute_paths(void)
cl_assert_equal_i(true, git_path_exists("linkdir/target"));
git_filebuf_cleanup(&file);
- git_buf_free(&source);
- git_buf_free(&target);
+ git_buf_dispose(&source);
+ git_buf_dispose(&target);
cl_git_pass(git_futils_rmdir_r("linkdir", NULL, GIT_RMDIR_REMOVE_FILES));
}
diff --git a/tests/core/futils.c b/tests/core/futils.c
index e7f7154..c69c210 100644
--- a/tests/core/futils.c
+++ b/tests/core/futils.c
@@ -33,8 +33,8 @@ void test_core_futils__writebuffer(void)
cl_assert_equal_file(out.ptr, out.size, "futils/test-file");
- git_buf_free(&out);
- git_buf_free(&append);
+ git_buf_dispose(&out);
+ git_buf_dispose(&append);
}
void test_core_futils__write_hidden_file(void)
@@ -61,8 +61,8 @@ void test_core_futils__write_hidden_file(void)
cl_git_pass(git_win32__hidden(&hidden, "futils/test-file"));
cl_assert(hidden);
- git_buf_free(&out);
- git_buf_free(&append);
+ git_buf_dispose(&out);
+ git_buf_dispose(&append);
#endif
}
diff --git a/tests/core/link.c b/tests/core/link.c
index ec85ec4..8cd6b01 100644
--- a/tests/core/link.c
+++ b/tests/core/link.c
@@ -147,7 +147,7 @@ static void do_junction(const char *old, const char *new)
CloseHandle(handle);
LocalFree(reparse_buf);
- git_buf_free(&unparsed_buf);
+ git_buf_dispose(&unparsed_buf);
}
static void do_custom_reparse(const char *path)
@@ -322,7 +322,7 @@ void test_core_link__lstat_symlink(void)
cl_assert(S_ISLNK(st.st_mode));
cl_assert_equal_i(git_buf_len(&target_path), st.st_size);
- git_buf_free(&target_path);
+ git_buf_dispose(&target_path);
}
void test_core_link__lstat_symlink_directory(void)
@@ -345,7 +345,7 @@ void test_core_link__lstat_symlink_directory(void)
cl_assert(S_ISLNK(st.st_mode));
cl_assert_equal_i(git_buf_len(&target_path), st.st_size);
- git_buf_free(&target_path);
+ git_buf_dispose(&target_path);
}
void test_core_link__lstat_dangling_symlink(void)
@@ -397,7 +397,7 @@ void test_core_link__stat_junction(void)
cl_must_pass(p_stat("stat_junction", &st));
cl_assert(S_ISDIR(st.st_mode));
- git_buf_free(&target_path);
+ git_buf_dispose(&target_path);
#endif
}
@@ -417,7 +417,7 @@ void test_core_link__stat_dangling_junction(void)
cl_must_fail(p_stat("stat_nonexistent_junctarget", &st));
cl_must_fail(p_stat("stat_dangling_junction", &st));
- git_buf_free(&target_path);
+ git_buf_dispose(&target_path);
#endif
}
@@ -438,7 +438,7 @@ void test_core_link__lstat_junction(void)
cl_must_pass(p_lstat("lstat_junction", &st));
cl_assert(S_ISLNK(st.st_mode));
- git_buf_free(&target_path);
+ git_buf_dispose(&target_path);
#endif
}
@@ -461,7 +461,7 @@ void test_core_link__lstat_dangling_junction(void)
cl_assert(S_ISLNK(st.st_mode));
cl_assert_equal_i(git_buf_len(&target_path), st.st_size);
- git_buf_free(&target_path);
+ git_buf_dispose(&target_path);
#endif
}
@@ -573,7 +573,7 @@ void test_core_link__readlink_symlink(void)
cl_assert_equal_s(git_buf_cstr(&target_path), buf);
- git_buf_free(&target_path);
+ git_buf_dispose(&target_path);
}
void test_core_link__readlink_dangling(void)
@@ -596,7 +596,7 @@ void test_core_link__readlink_dangling(void)
cl_assert_equal_s(git_buf_cstr(&target_path), buf);
- git_buf_free(&target_path);
+ git_buf_dispose(&target_path);
}
void test_core_link__readlink_multiple(void)
@@ -625,8 +625,8 @@ void test_core_link__readlink_multiple(void)
cl_assert_equal_s(git_buf_cstr(&path2), buf);
- git_buf_free(&path1);
- git_buf_free(&path2);
- git_buf_free(&path3);
- git_buf_free(&target_path);
+ git_buf_dispose(&path1);
+ git_buf_dispose(&path2);
+ git_buf_dispose(&path3);
+ git_buf_dispose(&target_path);
}
diff --git a/tests/core/mkdir.c b/tests/core/mkdir.c
index 96c9723..8e52efb 100644
--- a/tests/core/mkdir.c
+++ b/tests/core/mkdir.c
@@ -49,7 +49,7 @@ void test_core_mkdir__absolute(void)
cl_git_fail(git_futils_mkdir(path.ptr, 0755, 0));
cl_assert(!git_path_isdir(path.ptr));
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
void test_core_mkdir__basic(void)
@@ -256,7 +256,7 @@ void test_core_mkdir__keeps_parent_symlinks(void)
cl_assert(git_path_isdir("d2/other/dir"));
cl_assert(git_path_isdir("d0/other/dir"));
- git_buf_free(&path);
+ git_buf_dispose(&path);
#endif
}
diff --git a/tests/core/path.c b/tests/core/path.c
index fefe2ae..6910fab 100644
--- a/tests/core/path.c
+++ b/tests/core/path.c
@@ -9,7 +9,7 @@ check_dirname(const char *A, const char *B)
cl_assert(git_path_dirname_r(&dir, A) >= 0);
cl_assert_equal_s(B, dir.ptr);
- git_buf_free(&dir);
+ git_buf_dispose(&dir);
cl_assert((dir2 = git_path_dirname(A)) != NULL);
cl_assert_equal_s(B, dir2);
@@ -24,7 +24,7 @@ check_basename(const char *A, const char *B)
cl_assert(git_path_basename_r(&base, A) >= 0);
cl_assert_equal_s(B, base.ptr);
- git_buf_free(&base);
+ git_buf_dispose(&base);
cl_assert((base2 = git_path_basename(A)) != NULL);
cl_assert_equal_s(B, base2);
@@ -48,7 +48,7 @@ check_joinpath(const char *path_a, const char *path_b, const char *expected_path
cl_git_pass(git_buf_joinpath(&joined_path, path_a, path_b));
cl_assert_equal_s(expected_path, joined_path.ptr);
- git_buf_free(&joined_path);
+ git_buf_dispose(&joined_path);
}
static void
@@ -65,7 +65,7 @@ check_joinpath_n(
path_a, path_b, path_c, path_d));
cl_assert_equal_s(expected_path, joined_path.ptr);
- git_buf_free(&joined_path);
+ git_buf_dispose(&joined_path);
}
@@ -204,7 +204,7 @@ check_path_to_dir(
cl_git_pass(git_path_to_dir(&tgt));
cl_assert_equal_s(expected, tgt.ptr);
- git_buf_free(&tgt);
+ git_buf_dispose(&tgt);
}
static void
@@ -275,7 +275,7 @@ void test_core_path__08_self_join(void)
cl_assert_equal_s(path.ptr, "/foo/this is a new string/grow the buffer, grow the buffer, grow the buffer");
cl_assert(asize < path.asize);
- git_buf_free(&path);
+ git_buf_dispose(&path);
cl_git_pass(git_buf_sets(&path, "/foo/bar"));
cl_git_pass(git_buf_joinpath(&path, path.ptr + 4, "baz"));
@@ -286,7 +286,7 @@ void test_core_path__08_self_join(void)
cl_assert_equal_s(path.ptr, "/baz/somethinglongenoughtorealloc");
cl_assert(asize < path.asize);
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
static void check_percent_decoding(const char *expected_result, const char *input)
@@ -296,7 +296,7 @@ static void check_percent_decoding(const char *expected_result, const char *inpu
cl_git_pass(git__percent_decode(&buf, input));
cl_assert_equal_s(expected_result, git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_core_path__09_percent_decode(void)
@@ -325,7 +325,7 @@ static void check_fromurl(const char *expected_result, const char *input, int sh
} else
cl_git_fail(git_path_fromurl(&buf, input));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
#ifdef GIT_WIN32
@@ -436,7 +436,7 @@ void test_core_path__11_walkup(void)
i = info.expect_idx;
}
- git_buf_free(&p);
+ git_buf_dispose(&p);
}
void test_core_path__11a_walkup_cancel(void)
@@ -472,7 +472,7 @@ void test_core_path__11a_walkup_cancel(void)
while (expect[i] != NULL) i++;
}
- git_buf_free(&p);
+ git_buf_dispose(&p);
}
void test_core_path__12_offset_to_path_root(void)
@@ -500,7 +500,7 @@ void test_core_path__13_cannot_prettify_a_non_existing_file(void)
cl_assert_equal_i(GIT_ENOTFOUND, git_path_prettify(&p, NON_EXISTING_FILEPATH, NULL));
cl_assert_equal_i(GIT_ENOTFOUND, git_path_prettify(&p, NON_EXISTING_FILEPATH "/so-do-i", NULL));
- git_buf_free(&p);
+ git_buf_dispose(&p);
}
void test_core_path__14_apply_relative(void)
@@ -561,7 +561,7 @@ void test_core_path__14_apply_relative(void)
cl_git_pass(git_path_apply_relative(&p, "../there"));
cl_assert_equal_s("../../there", p.ptr);
- git_buf_free(&p);
+ git_buf_dispose(&p);
}
static void assert_resolve_relative(
@@ -654,7 +654,7 @@ void test_core_path__15_resolve_relative(void)
assert_resolve_relative(&buf, "/", "//a/b/../..");
#endif
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
#define assert_common_dirlen(i, p, q) \
diff --git a/tests/core/rmdir.c b/tests/core/rmdir.c
index f0b0bfa..0ec5d61 100644
--- a/tests/core/rmdir.c
+++ b/tests/core/rmdir.c
@@ -24,7 +24,7 @@ void test_core_rmdir__initialize(void)
cl_git_pass(git_buf_joinpath(&path, empty_tmp_dir, "/two"));
cl_must_pass(p_mkdir(path.ptr, 0777));
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
/* make sure empty dir can be deleted recusively */
@@ -47,7 +47,7 @@ void test_core_rmdir__fail_to_delete_non_empty_dir(void)
cl_must_pass(p_unlink(file.ptr));
cl_git_pass(git_futils_rmdir_r(empty_tmp_dir, NULL, GIT_RMDIR_EMPTY_HIERARCHY));
- git_buf_free(&file);
+ git_buf_dispose(&file);
}
void test_core_rmdir__can_skip_non_empty_dir(void)
@@ -64,7 +64,7 @@ void test_core_rmdir__can_skip_non_empty_dir(void)
cl_git_pass(git_futils_rmdir_r(empty_tmp_dir, NULL, GIT_RMDIR_REMOVE_FILES));
cl_assert(git_path_exists(empty_tmp_dir) == false);
- git_buf_free(&file);
+ git_buf_dispose(&file);
}
void test_core_rmdir__can_remove_empty_parents(void)
@@ -92,7 +92,7 @@ void test_core_rmdir__can_remove_empty_parents(void)
cl_assert(git_path_exists(empty_tmp_dir) == true);
- git_buf_free(&file);
+ git_buf_dispose(&file);
cl_git_pass(git_futils_rmdir_r(empty_tmp_dir, NULL, GIT_RMDIR_EMPTY_HIERARCHY));
}
diff --git a/tests/core/sortedcache.c b/tests/core/sortedcache.c
index c1869be..35e92ec 100644
--- a/tests/core/sortedcache.c
+++ b/tests/core/sortedcache.c
@@ -266,7 +266,7 @@ static void sortedcache_test_reload(git_sortedcache *sc)
git_sortedcache_wunlock(sc);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_core_sortedcache__on_disk(void)
diff --git a/tests/core/stat.c b/tests/core/stat.c
index ef2e45a..59a1346 100644
--- a/tests/core/stat.c
+++ b/tests/core/stat.c
@@ -110,5 +110,5 @@ void test_core_stat__root(void)
cl_must_pass(p_stat(root.ptr, &st));
cl_assert(S_ISDIR(st.st_mode));
- git_buf_free(&root);
+ git_buf_dispose(&root);
}
diff --git a/tests/core/useragent.c b/tests/core/useragent.c
index 5c09223..c6c5220 100644
--- a/tests/core/useragent.c
+++ b/tests/core/useragent.c
@@ -13,5 +13,5 @@ void test_core_useragent__get(void)
cl_git_pass(git_libgit2_opts(GIT_OPT_GET_USER_AGENT, &buf));
cl_assert_equal_s(custom_name, buf.ptr);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
diff --git a/tests/core/zstream.c b/tests/core/zstream.c
index 961904e..398d90a 100644
--- a/tests/core/zstream.c
+++ b/tests/core/zstream.c
@@ -73,8 +73,8 @@ void test_core_zstream__fails_on_trailing_garbage(void)
cl_git_fail(git_zstream_inflatebuf(&inflated, deflated.ptr, deflated.size));
- git_buf_free(&deflated);
- git_buf_free(&inflated);
+ git_buf_dispose(&deflated);
+ git_buf_dispose(&inflated);
}
void test_core_zstream__buffer(void)
@@ -82,7 +82,7 @@ void test_core_zstream__buffer(void)
git_buf out = GIT_BUF_INIT;
cl_git_pass(git_zstream_deflatebuf(&out, data, strlen(data) + 1));
assert_zlib_equal(data, strlen(data) + 1, out.ptr, out.size);
- git_buf_free(&out);
+ git_buf_dispose(&out);
}
#define BIG_STRING_PART "Big Data IS Big - Long Data IS Long - We need a buffer larger than 1024 x 1024 to make sure we trigger chunked compression - Big Big Data IS Bigger than Big - Long Long Data IS Longer than Long"
@@ -129,15 +129,15 @@ static void compress_and_decompress_input_various_ways(git_buf *input)
cl_assert_equal_sz(out1.size, out2.size);
cl_assert(!memcmp(out1.ptr, out2.ptr, out1.size));
- git_buf_free(&out2);
+ git_buf_dispose(&out2);
}
cl_git_pass(git_zstream_inflatebuf(&inflated, out1.ptr, out1.size));
cl_assert_equal_i(input->size, inflated.size);
cl_assert(memcmp(input->ptr, inflated.ptr, inflated.size) == 0);
- git_buf_free(&out1);
- git_buf_free(&inflated);
+ git_buf_dispose(&out1);
+ git_buf_dispose(&inflated);
git__free(fixed);
}
@@ -164,5 +164,5 @@ void test_core_zstream__big_data(void)
compress_and_decompress_input_various_ways(&in);
}
- git_buf_free(&in);
+ git_buf_dispose(&in);
}
diff --git a/tests/describe/describe.c b/tests/describe/describe.c
index a8c57d8..26ca4ef 100644
--- a/tests/describe/describe.c
+++ b/tests/describe/describe.c
@@ -50,6 +50,6 @@ void test_describe_describe__describe_a_repo_with_no_refs(void)
git_describe_result_free(result);
git_object_free(object);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
cl_git_sandbox_cleanup();
}
diff --git a/tests/describe/describe_helpers.c b/tests/describe/describe_helpers.c
index ad9c945..2e6ad53 100644
--- a/tests/describe/describe_helpers.c
+++ b/tests/describe/describe_helpers.c
@@ -20,7 +20,7 @@ void assert_describe(
git_describe_result_free(result);
git_object_free(object);
- git_buf_free(&label);
+ git_buf_dispose(&label);
}
void assert_describe_workdir(
@@ -38,5 +38,5 @@ void assert_describe_workdir(
cl_must_pass(p_fnmatch(expected_output, git_buf_cstr(&label), 0));
git_describe_result_free(result);
- git_buf_free(&label);
+ git_buf_dispose(&label);
}
diff --git a/tests/diff/binary.c b/tests/diff/binary.c
index 173a599..711fe64 100644
--- a/tests/diff/binary.c
+++ b/tests/diff/binary.c
@@ -57,7 +57,7 @@ void test_patch(
cl_assert_equal_s(expected, actual.ptr);
- git_buf_free(&actual);
+ git_buf_dispose(&actual);
git_patch_free(patch);
git_diff_free(diff);
git_tree_free(tree_one);
@@ -238,7 +238,7 @@ void test_diff_binary__delta(void)
expected);
git_index_free(index);
- git_buf_free(&contents);
+ git_buf_dispose(&contents);
}
void test_diff_binary__delta_append(void)
@@ -298,7 +298,7 @@ void test_diff_binary__empty_for_no_diff(void)
cl_assert_equal_s("", actual.ptr);
- git_buf_free(&actual);
+ git_buf_dispose(&actual);
git_diff_free(diff);
git_commit_free(commit);
git_tree_free(tree);
@@ -346,7 +346,7 @@ void test_diff_binary__index_to_workdir(void)
&opts,
expected);
- git_buf_free(&actual);
+ git_buf_dispose(&actual);
git_patch_free(patch);
git_diff_free(diff);
git_index_free(index);
@@ -402,7 +402,7 @@ void test_diff_binary__print_patch_from_diff(void)
cl_assert_equal_s(expected, actual.ptr);
- git_buf_free(&actual);
+ git_buf_dispose(&actual);
git_diff_free(diff);
git_index_free(index);
}
@@ -540,6 +540,6 @@ void test_diff_binary__blob_to_blob(void)
git__free(diff_data.old_path);
git__free(diff_data.new_path);
- git_buf_free(&diff_data.old_binary_base85);
- git_buf_free(&diff_data.new_binary_base85);
+ git_buf_dispose(&diff_data.old_binary_base85);
+ git_buf_dispose(&diff_data.new_binary_base85);
}
diff --git a/tests/diff/blob.c b/tests/diff/blob.c
index 05cc282..a876a97 100644
--- a/tests/diff/blob.c
+++ b/tests/diff/blob.c
@@ -101,7 +101,7 @@ void test_diff_blob__patch_with_freed_blobs(void)
cl_assert_equal_s(buf.ptr, BLOB_DIFF);
git_patch_free(p);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_diff_blob__can_compare_text_blobs(void)
@@ -1016,7 +1016,7 @@ void test_diff_blob__using_path_and_attributes(void)
git_buf_clear(&buf);
git_patch_free(p);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_blob_free(nonbin);
git_blob_free(bin);
}
diff --git a/tests/diff/diffiter.c b/tests/diff/diffiter.c
index c976e30..432201b 100644
--- a/tests/diff/diffiter.c
+++ b/tests/diff/diffiter.c
@@ -423,7 +423,7 @@ void test_diff_diffiter__iterate_and_generate_patch_text(void)
cl_assert_equal_s(expected_patch_text[d], buf.ptr);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_patch_free(patch);
}
diff --git a/tests/diff/drivers.c b/tests/diff/drivers.c
index 42af38a..cace409 100644
--- a/tests/diff/drivers.c
+++ b/tests/diff/drivers.c
@@ -65,7 +65,7 @@ void test_diff_drivers__patterns(void)
cl_git_pass(git_patch_to_buf(&actual, patch));
cl_assert_equal_s(expected0, actual.ptr);
- git_buf_free(&actual);
+ git_buf_dispose(&actual);
git_patch_free(patch);
git_diff_free(diff);
@@ -80,7 +80,7 @@ void test_diff_drivers__patterns(void)
cl_git_pass(git_patch_to_buf(&actual, patch));
cl_assert_equal_s(expected1, actual.ptr);
- git_buf_free(&actual);
+ git_buf_dispose(&actual);
git_patch_free(patch);
git_diff_free(diff);
@@ -95,7 +95,7 @@ void test_diff_drivers__patterns(void)
cl_git_pass(git_patch_to_buf(&actual, patch));
cl_assert_equal_s(expected0, actual.ptr);
- git_buf_free(&actual);
+ git_buf_dispose(&actual);
git_patch_free(patch);
git_diff_free(diff);
@@ -112,7 +112,7 @@ void test_diff_drivers__patterns(void)
cl_git_pass(git_patch_to_buf(&actual, patch));
cl_assert_equal_s(expected1, actual.ptr);
- git_buf_free(&actual);
+ git_buf_dispose(&actual);
git_patch_free(patch);
git_diff_free(diff);
@@ -133,7 +133,7 @@ void test_diff_drivers__patterns(void)
cl_git_pass(git_patch_to_buf(&actual, patch));
cl_assert_equal_s(expected2, actual.ptr);
- git_buf_free(&actual);
+ git_buf_dispose(&actual);
git_patch_free(patch);
git_diff_free(diff);
@@ -169,7 +169,7 @@ void test_diff_drivers__long_lines(void)
cl_assert_equal_s(expected, actual.ptr);
- git_buf_free(&actual);
+ git_buf_dispose(&actual);
git_patch_free(patch);
git_diff_free(diff);
}
@@ -245,9 +245,9 @@ void test_diff_drivers__builtins(void)
git__free(path);
}
- git_buf_free(&file);
- git_buf_free(&actual);
- git_buf_free(&expected);
+ git_buf_dispose(&file);
+ git_buf_dispose(&actual);
+ git_buf_dispose(&expected);
git_vector_free(&files);
}
diff --git a/tests/diff/format_email.c b/tests/diff/format_email.c
index c3c0410..28f840a 100644
--- a/tests/diff/format_email.c
+++ b/tests/diff/format_email.c
@@ -49,7 +49,7 @@ static void assert_email_match(
git_diff_free(diff);
git_commit_free(commit);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_diff_format_email__simple(void)
@@ -255,7 +255,7 @@ void test_diff_format_email__multiple(void)
git_diff_free(diff);
git_commit_free(commit);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_diff_format_email__exclude_marker(void)
@@ -331,7 +331,7 @@ void test_diff_format_email__invalid_no(void)
git_diff_free(diff);
git_commit_free(commit);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_diff_format_email__mode_change(void)
diff --git a/tests/diff/parse.c b/tests/diff/parse.c
index dc2ceef..bb18196 100644
--- a/tests/diff/parse.c
+++ b/tests/diff/parse.c
@@ -54,7 +54,7 @@ static void test_parse_invalid_diff(const char *invalid_diff)
cl_git_fail_with(GIT_ERROR,
git_diff_from_buffer(&diff, buf.ptr, buf.size));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_diff_parse__exact_rename(void)
@@ -125,7 +125,7 @@ static void test_tree_to_tree_computed_to_parsed(
git_diff_free(computed);
git_diff_free(parsed);
- git_buf_free(&computed_buf);
+ git_buf_dispose(&computed_buf);
cl_git_sandbox_cleanup();
}
@@ -213,7 +213,7 @@ void test_diff_parse__get_patch_from_diff(void)
git_diff_free(computed);
git_diff_free(parsed);
- git_buf_free(&computed_buf);
+ git_buf_dispose(&computed_buf);
cl_git_sandbox_cleanup();
}
@@ -265,7 +265,7 @@ void test_diff_parse__parsing_minimal_patch_succeeds(void)
cl_assert_equal_s(patch, buf.ptr);
git_diff_free(diff);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_diff_parse__patch_roundtrip_succeeds(void)
@@ -285,6 +285,6 @@ void test_diff_parse__patch_roundtrip_succeeds(void)
git_patch_free(patch);
git_diff_free(diff);
- git_buf_free(&patchbuf);
- git_buf_free(&diffbuf);
+ git_buf_dispose(&patchbuf);
+ git_buf_dispose(&diffbuf);
}
diff --git a/tests/diff/patch.c b/tests/diff/patch.c
index 4c83628..bc7976f 100644
--- a/tests/diff/patch.c
+++ b/tests/diff/patch.c
@@ -171,7 +171,7 @@ void test_diff_patch__to_string(void)
cl_assert_equal_sz(31 + 16, git_patch_size(patch, 1, 1, 0));
cl_assert_equal_sz(strlen(expected), git_patch_size(patch, 1, 1, 1));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_patch_free(patch);
git_diff_free(diff);
git_tree_free(another);
@@ -252,7 +252,7 @@ void test_diff_patch__config_options(void)
git_patch_free(patch);
git_diff_free(diff);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_tree_free(one);
git_config_free(cfg);
}
@@ -440,8 +440,8 @@ void test_diff_patch__hunks_have_correct_line_numbers(void)
git_patch_free(patch);
git_diff_free(diff);
- git_buf_free(&actual);
- git_buf_free(&old_content);
+ git_buf_dispose(&actual);
+ git_buf_dispose(&old_content);
git_tree_free(head);
}
@@ -476,7 +476,7 @@ static void check_single_patch_stats(
git_buf buf = GIT_BUF_INIT;
cl_git_pass(git_patch_to_buf(&buf, patch));
cl_assert_equal_s(expected, buf.ptr);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
cl_assert_equal_sz(
strlen(expected), git_patch_size(patch, 1, 1, 1));
@@ -614,7 +614,7 @@ void test_diff_patch__line_counts_with_eofnl(void)
check_single_patch_stats(
g_repo, 1, 1, 1, 6, expected_sizes, expected);
- git_buf_free(&content);
+ git_buf_dispose(&content);
}
void test_diff_patch__can_strip_bad_utf8(void)
@@ -700,5 +700,5 @@ void test_diff_patch__can_strip_bad_utf8(void)
cl_assert_equal_s(expected, buf.ptr);
git_patch_free(patch);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
diff --git a/tests/diff/rename.c b/tests/diff/rename.c
index ddc1d5d..0ba9330 100644
--- a/tests/diff/rename.c
+++ b/tests/diff/rename.c
@@ -603,8 +603,8 @@ void test_diff_rename__working_directory_changes(void)
git_diff_free(diff);
git_tree_free(tree);
- git_buf_free(&content);
- git_buf_free(&old_content);
+ git_buf_dispose(&content);
+ git_buf_dispose(&old_content);
}
void test_diff_rename__patch(void)
@@ -645,7 +645,7 @@ void test_diff_rename__patch(void)
cl_git_pass(git_patch_to_buf(&buf, patch));
cl_assert_equal_s(expected, buf.ptr);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_patch_free(patch);
@@ -707,8 +707,8 @@ void test_diff_rename__file_exchange(void)
git_tree_free(tree);
git_index_free(index);
- git_buf_free(&c1);
- git_buf_free(&c2);
+ git_buf_dispose(&c1);
+ git_buf_dispose(&c2);
}
void test_diff_rename__file_exchange_three(void)
@@ -759,9 +759,9 @@ void test_diff_rename__file_exchange_three(void)
git_tree_free(tree);
git_index_free(index);
- git_buf_free(&c1);
- git_buf_free(&c2);
- git_buf_free(&c3);
+ git_buf_dispose(&c1);
+ git_buf_dispose(&c2);
+ git_buf_dispose(&c3);
}
void test_diff_rename__file_partial_exchange(void)
@@ -812,8 +812,8 @@ void test_diff_rename__file_partial_exchange(void)
git_tree_free(tree);
git_index_free(index);
- git_buf_free(&c1);
- git_buf_free(&c2);
+ git_buf_dispose(&c1);
+ git_buf_dispose(&c2);
}
void test_diff_rename__rename_and_copy_from_same_source(void)
@@ -869,8 +869,8 @@ void test_diff_rename__rename_and_copy_from_same_source(void)
git_tree_free(tree);
git_index_free(index);
- git_buf_free(&c1);
- git_buf_free(&c2);
+ git_buf_dispose(&c1);
+ git_buf_dispose(&c2);
}
void test_diff_rename__from_deleted_to_split(void)
@@ -923,7 +923,7 @@ void test_diff_rename__from_deleted_to_split(void)
git_tree_free(tree);
git_index_free(index);
- git_buf_free(&c1);
+ git_buf_dispose(&c1);
}
struct rename_expected
@@ -1023,8 +1023,8 @@ void test_diff_rename__rejected_match_can_match_others(void)
git_index_free(index);
git_reference_free(head);
git_reference_free(selfsimilar);
- git_buf_free(&one);
- git_buf_free(&two);
+ git_buf_dispose(&one);
+ git_buf_dispose(&two);
}
static void write_similarity_file_two(const char *filename, size_t b_lines)
@@ -1041,7 +1041,7 @@ static void write_similarity_file_two(const char *filename, size_t b_lines)
cl_git_pass(
git_futils_writebuffer(&contents, filename, O_RDWR|O_CREAT, 0777));
- git_buf_free(&contents);
+ git_buf_dispose(&contents);
}
void test_diff_rename__rejected_match_can_match_others_two(void)
@@ -1389,7 +1389,7 @@ void test_diff_rename__can_find_copy_to_split(void)
git_tree_free(tree);
git_index_free(index);
- git_buf_free(&c1);
+ git_buf_dispose(&c1);
}
void test_diff_rename__can_delete_unmodified_deltas(void)
@@ -1437,7 +1437,7 @@ void test_diff_rename__can_delete_unmodified_deltas(void)
git_tree_free(tree);
git_index_free(index);
- git_buf_free(&c1);
+ git_buf_dispose(&c1);
}
void test_diff_rename__matches_config_behavior(void)
@@ -1759,7 +1759,7 @@ void test_diff_rename__identical(void)
cl_assert_equal_s(expected, diff_buf.ptr);
- git_buf_free(&diff_buf);
+ git_buf_dispose(&diff_buf);
git_diff_free(diff);
git_tree_free(old_tree);
git_tree_free(new_tree);
@@ -1910,7 +1910,7 @@ void test_diff_rename__rewrite_and_delete(void)
cl_assert_equal_s(expected, diff_buf.ptr);
- git_buf_free(&diff_buf);
+ git_buf_dispose(&diff_buf);
git_diff_free(diff);
git_tree_free(old_tree);
git_tree_free(new_tree);
@@ -1973,7 +1973,7 @@ void test_diff_rename__delete_and_rename(void)
cl_assert_equal_s(expected, diff_buf.ptr);
- git_buf_free(&diff_buf);
+ git_buf_dispose(&diff_buf);
git_diff_free(diff);
git_tree_free(old_tree);
git_tree_free(new_tree);
diff --git a/tests/diff/stats.c b/tests/diff/stats.c
index 347d0d7..24316f7 100644
--- a/tests/diff/stats.c
+++ b/tests/diff/stats.c
@@ -54,11 +54,11 @@ void test_diff_stats__stat(void)
cl_git_pass(git_diff_stats_to_buf(&buf, _stats, GIT_DIFF_STATS_FULL, 0));
cl_assert(strcmp(git_buf_cstr(&buf), stat) == 0);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
cl_git_pass(git_diff_stats_to_buf(&buf, _stats, GIT_DIFF_STATS_FULL, 80));
cl_assert(strcmp(git_buf_cstr(&buf), stat) == 0);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_diff_stats__multiple_hunks(void)
@@ -78,7 +78,7 @@ void test_diff_stats__multiple_hunks(void)
cl_git_pass(git_diff_stats_to_buf(&buf, _stats, GIT_DIFF_STATS_FULL, 0));
cl_assert_equal_s(stat, git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_diff_stats__numstat(void)
@@ -93,7 +93,7 @@ void test_diff_stats__numstat(void)
cl_git_pass(git_diff_stats_to_buf(&buf, _stats, GIT_DIFF_STATS_NUMBER, 0));
cl_assert_equal_s(stat, git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_diff_stats__shortstat(void)
@@ -111,7 +111,7 @@ void test_diff_stats__shortstat(void)
cl_git_pass(git_diff_stats_to_buf(&buf, _stats, GIT_DIFF_STATS_SHORT, 0));
cl_assert_equal_s(stat, git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_diff_stats__shortstat_noinsertions(void)
@@ -129,7 +129,7 @@ void test_diff_stats__shortstat_noinsertions(void)
cl_git_pass(git_diff_stats_to_buf(&buf, _stats, GIT_DIFF_STATS_SHORT, 0));
cl_assert_equal_s(stat, git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_diff_stats__shortstat_nodeletions(void)
@@ -147,7 +147,7 @@ void test_diff_stats__shortstat_nodeletions(void)
cl_git_pass(git_diff_stats_to_buf(&buf, _stats, GIT_DIFF_STATS_SHORT, 0));
cl_assert_equal_s(stat, git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_diff_stats__rename(void)
@@ -167,7 +167,7 @@ void test_diff_stats__rename(void)
cl_git_pass(git_diff_stats_to_buf(&buf, _stats, GIT_DIFF_STATS_FULL, 0));
cl_assert_equal_s(stat, git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_diff_stats__rename_nochanges(void)
@@ -187,7 +187,7 @@ void test_diff_stats__rename_nochanges(void)
cl_git_pass(git_diff_stats_to_buf(&buf, _stats, GIT_DIFF_STATS_FULL, 0));
cl_assert_equal_s(stat, git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_diff_stats__rename_and_modifiy(void)
@@ -207,7 +207,7 @@ void test_diff_stats__rename_and_modifiy(void)
cl_git_pass(git_diff_stats_to_buf(&buf, _stats, GIT_DIFF_STATS_FULL, 0));
cl_assert_equal_s(stat, git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_diff_stats__rename_no_find(void)
@@ -229,7 +229,7 @@ void test_diff_stats__rename_no_find(void)
cl_git_pass(git_diff_stats_to_buf(&buf, _stats, GIT_DIFF_STATS_FULL, 0));
cl_assert_equal_s(stat, git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_diff_stats__rename_nochanges_no_find(void)
@@ -251,7 +251,7 @@ void test_diff_stats__rename_nochanges_no_find(void)
cl_git_pass(git_diff_stats_to_buf(&buf, _stats, GIT_DIFF_STATS_FULL, 0));
cl_assert_equal_s(stat, git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_diff_stats__rename_and_modify_no_find(void)
@@ -272,7 +272,7 @@ void test_diff_stats__rename_and_modify_no_find(void)
cl_git_pass(git_diff_stats_to_buf(&buf, _stats, GIT_DIFF_STATS_FULL, 0));
cl_assert_equal_s(stat, git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_diff_stats__binary(void)
@@ -292,7 +292,7 @@ void test_diff_stats__binary(void)
cl_git_pass(git_diff_stats_to_buf(&buf, _stats, GIT_DIFF_STATS_FULL, 0));
cl_assert_equal_s(stat, git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_diff_stats__binary_numstat(void)
@@ -306,7 +306,7 @@ void test_diff_stats__binary_numstat(void)
cl_git_pass(git_diff_stats_to_buf(&buf, _stats, GIT_DIFF_STATS_NUMBER, 0));
cl_assert_equal_s(stat, git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_diff_stats__mode_change(void)
@@ -322,5 +322,5 @@ void test_diff_stats__mode_change(void)
cl_git_pass(git_diff_stats_to_buf(&buf, _stats, GIT_DIFF_STATS_FULL | GIT_DIFF_STATS_INCLUDE_SUMMARY, 0));
cl_assert_equal_s(stat, git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
diff --git a/tests/diff/submodules.c b/tests/diff/submodules.c
index eebfef3..8899d3f 100644
--- a/tests/diff/submodules.c
+++ b/tests/diff/submodules.c
@@ -50,7 +50,7 @@ static void check_diff_patches_at_line(
clar__assert_equal(
file, line, "expected diff did not match actual diff", 1,
"%s", expected[d], get_buf_ptr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
cl_assert_at_line(expected[d] && !strcmp(expected[d], "<END>"), file, line);
diff --git a/tests/diff/workdir.c b/tests/diff/workdir.c
index e1bbce8..d827062 100644
--- a/tests/diff/workdir.c
+++ b/tests/diff/workdir.c
@@ -1677,7 +1677,7 @@ void test_diff_workdir__patience_diff(void)
cl_assert_equal_s(expected_patience, buf.ptr);
git_buf_clear(&buf);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_patch_free(patch);
git_diff_free(diff);
}
@@ -1807,7 +1807,7 @@ void test_diff_workdir__can_update_index(void)
git_buf path = GIT_BUF_INIT;
cl_git_pass(git_buf_sets(&path, "status"));
cl_git_pass(git_path_direach(&path, 0, touch_file, NULL));
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
opts.flags |= GIT_DIFF_INCLUDE_IGNORED | GIT_DIFF_INCLUDE_UNTRACKED;
@@ -1959,7 +1959,7 @@ void test_diff_workdir__binary_detection(void)
git_diff_free(diff);
git_index_free(idx);
- git_buf_free(&b);
+ git_buf_dispose(&b);
}
void test_diff_workdir__to_index_conflicted(void) {
@@ -2050,7 +2050,7 @@ void test_diff_workdir__only_writes_index_when_necessary(void)
git_oid_cpy(&second, git_index_checksum(index));
cl_assert(!git_oid_equal(&first, &second));
- git_buf_free(&path);
+ git_buf_dispose(&path);
git_object_free(head_object);
git_reference_free(head);
git_index_free(index);
diff --git a/tests/fetchhead/nonetwork.c b/tests/fetchhead/nonetwork.c
index a639460..6ea48a5 100644
--- a/tests/fetchhead/nonetwork.c
+++ b/tests/fetchhead/nonetwork.c
@@ -94,7 +94,7 @@ void test_fetchhead_nonetwork__write(void)
equals = (strcmp(fetchhead_buf.ptr, FETCH_HEAD_WILDCARD_DATA_LOCAL) == 0);
- git_buf_free(&fetchhead_buf);
+ git_buf_dispose(&fetchhead_buf);
git_vector_foreach(&fetchhead_vector, i, fetchhead_ref) {
git_fetchhead_ref_free(fetchhead_ref);
@@ -427,7 +427,7 @@ void test_fetchhead_nonetwork__create_when_refpecs_given(void)
cl_assert(found_haacked);
git_remote_free(remote);
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
static bool count_refs_called;
@@ -491,5 +491,5 @@ void test_fetchhead_nonetwork__create_with_multiple_refspecs(void)
}
git_remote_free(remote);
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
diff --git a/tests/filter/blob.c b/tests/filter/blob.c
index bb2528d..6e30e20 100644
--- a/tests/filter/blob.c
+++ b/tests/filter/blob.c
@@ -44,7 +44,7 @@ void test_filter_blob__all_crlf(void)
/* we never convert CRLF -> LF on platforms that have LF */
cl_assert_equal_s(ALL_CRLF_TEXT_AS_CRLF, buf.ptr);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_blob_free(blob);
}
@@ -63,19 +63,19 @@ void test_filter_blob__sanitizes(void)
cl_git_pass(git_blob_filtered_content(&buf, blob, "file.bin", 1));
cl_assert_equal_sz(0, buf.size);
cl_assert_equal_s("", buf.ptr);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
memset(&buf, 0, sizeof(git_buf));
cl_git_pass(git_blob_filtered_content(&buf, blob, "file.crlf", 1));
cl_assert_equal_sz(0, buf.size);
cl_assert_equal_s("", buf.ptr);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
memset(&buf, 0, sizeof(git_buf));
cl_git_pass(git_blob_filtered_content(&buf, blob, "file.lf", 1));
cl_assert_equal_sz(0, buf.size);
cl_assert_equal_s("", buf.ptr);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_blob_free(blob);
}
@@ -111,7 +111,7 @@ void test_filter_blob__ident(void)
cl_assert_equal_s(
"Some text\n$Id: 3164f585d548ac68027d22b104f2d8100b2b6845 $\nGoes there\n", buf.ptr);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_blob_free(blob);
}
diff --git a/tests/filter/crlf.c b/tests/filter/crlf.c
index a8ebd94..f67cb62 100644
--- a/tests/filter/crlf.c
+++ b/tests/filter/crlf.c
@@ -41,7 +41,7 @@ void test_filter_crlf__to_worktree(void)
cl_assert_equal_s("Some text\r\nRight here\r\n", out.ptr);
git_filter_list_free(fl);
- git_buf_free(&out);
+ git_buf_dispose(&out);
}
void test_filter_crlf__to_odb(void)
@@ -66,7 +66,7 @@ void test_filter_crlf__to_odb(void)
cl_assert_equal_s("Some text\nRight here\n", out.ptr);
git_filter_list_free(fl);
- git_buf_free(&out);
+ git_buf_dispose(&out);
}
void test_filter_crlf__with_safecrlf(void)
@@ -107,7 +107,7 @@ void test_filter_crlf__with_safecrlf(void)
cl_assert_equal_s(in.ptr, out.ptr);
git_filter_list_free(fl);
- git_buf_free(&out);
+ git_buf_dispose(&out);
}
void test_filter_crlf__with_safecrlf_and_unsafe_allowed(void)
@@ -150,7 +150,7 @@ void test_filter_crlf__with_safecrlf_and_unsafe_allowed(void)
cl_assert_equal_s("Normal\nLF\nonly\nline-endings.\n", out.ptr);
git_filter_list_free(fl);
- git_buf_free(&out);
+ git_buf_dispose(&out);
}
void test_filter_crlf__no_safecrlf(void)
@@ -189,7 +189,7 @@ void test_filter_crlf__no_safecrlf(void)
cl_assert_equal_s("Normal\nLF\nonly\nline-endings.\n", out.ptr);
git_filter_list_free(fl);
- git_buf_free(&out);
+ git_buf_dispose(&out);
}
void test_filter_crlf__safecrlf_warn(void)
@@ -231,5 +231,5 @@ void test_filter_crlf__safecrlf_warn(void)
cl_assert_equal_s(in.ptr, out.ptr);
git_filter_list_free(fl);
- git_buf_free(&out);
+ git_buf_dispose(&out);
}
diff --git a/tests/filter/custom.c b/tests/filter/custom.c
index 799beef..b9e4f73 100644
--- a/tests/filter/custom.c
+++ b/tests/filter/custom.c
@@ -109,7 +109,7 @@ void test_filter_custom__to_odb(void)
0, memcmp(bitflipped_and_reversed_data, out.ptr, out.size));
git_filter_list_free(fl);
- git_buf_free(&out);
+ git_buf_dispose(&out);
}
void test_filter_custom__to_workdir(void)
@@ -130,7 +130,7 @@ void test_filter_custom__to_workdir(void)
0, memcmp(workdir_data, out.ptr, out.size));
git_filter_list_free(fl);
- git_buf_free(&out);
+ git_buf_dispose(&out);
}
void test_filter_custom__can_register_a_custom_filter_in_the_repository(void)
@@ -228,7 +228,7 @@ void test_filter_custom__order_dependency(void)
git_blob_id(blob), "8ca0df630d728c0c72072b6101b301391ef10095"));
git_blob_free(blob);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_filter_custom__filter_registry_failure_cases(void)
@@ -254,5 +254,5 @@ void test_filter_custom__erroneous_filter_fails(void)
cl_git_fail(git_filter_list_apply_to_data(&out, filters, &in));
git_filter_list_free(filters);
- git_buf_free(&out);
+ git_buf_dispose(&out);
}
diff --git a/tests/filter/file.c b/tests/filter/file.c
index 599f4e5..8f8a585 100644
--- a/tests/filter/file.c
+++ b/tests/filter/file.c
@@ -47,7 +47,7 @@ void test_filter_file__apply(void)
cl_git_pass(git_filter_list_apply_to_file(&buf, fl, g_repo, "all-crlf"));
cl_assert_equal_s("crlf\ncrlf\ncrlf\ncrlf\n", buf.ptr);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_filter_list_free(fl);
}
@@ -71,7 +71,7 @@ int buf_writestream_close(git_writestream *s)
void buf_writestream_free(git_writestream *s)
{
struct buf_writestream *stream = (struct buf_writestream *)s;
- git_buf_free(&stream->buf);
+ git_buf_dispose(&stream->buf);
}
void test_filter_file__apply_stream(void)
diff --git a/tests/filter/ident.c b/tests/filter/ident.c
index c54b621..cee0cc2 100644
--- a/tests/filter/ident.c
+++ b/tests/filter/ident.c
@@ -31,7 +31,7 @@ static void add_blob_and_filter(
cl_assert_equal_s(expected, out.ptr);
git_blob_free(blob);
- git_buf_free(&out);
+ git_buf_dispose(&out);
}
void test_filter_ident__to_worktree(void)
diff --git a/tests/filter/stream.c b/tests/filter/stream.c
index 30f5e50..226092c 100644
--- a/tests/filter/stream.c
+++ b/tests/filter/stream.c
@@ -157,7 +157,7 @@ static void writefile(const char *filename, size_t numchunks)
}
p_close(fd);
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
static void test_stream(size_t numchunks)
diff --git a/tests/filter/wildcard.c b/tests/filter/wildcard.c
index 999b336..ffa9531 100644
--- a/tests/filter/wildcard.c
+++ b/tests/filter/wildcard.c
@@ -137,8 +137,8 @@ void test_filter_wildcard__reverse(void)
0, memcmp(reversed, out.ptr, out.size));
git_filter_list_free(fl);
- git_buf_free(&out);
- git_buf_free(&in);
+ git_buf_dispose(&out);
+ git_buf_dispose(&in);
}
void test_filter_wildcard__flip(void)
@@ -158,8 +158,8 @@ void test_filter_wildcard__flip(void)
0, memcmp(flipped, out.ptr, out.size));
git_filter_list_free(fl);
- git_buf_free(&out);
- git_buf_free(&in);
+ git_buf_dispose(&out);
+ git_buf_dispose(&in);
}
void test_filter_wildcard__none(void)
@@ -179,6 +179,6 @@ void test_filter_wildcard__none(void)
0, memcmp(input, out.ptr, out.size));
git_filter_list_free(fl);
- git_buf_free(&out);
- git_buf_free(&in);
+ git_buf_dispose(&out);
+ git_buf_dispose(&in);
}
diff --git a/tests/index/filemodes.c b/tests/index/filemodes.c
index 2693b13..4eadb2c 100644
--- a/tests/index/filemodes.c
+++ b/tests/index/filemodes.c
@@ -47,8 +47,8 @@ static void replace_file_with_mode(
path.ptr, content.ptr, content.size,
O_WRONLY|O_CREAT|O_TRUNC, create_mode);
- git_buf_free(&path);
- git_buf_free(&content);
+ git_buf_dispose(&path);
+ git_buf_dispose(&content);
}
#define add_and_check_mode(I,F,X) add_and_check_mode_(I,F,X,__FILE__,__LINE__)
diff --git a/tests/index/nsec.c b/tests/index/nsec.c
index ea8a267..a20e3ea 100644
--- a/tests/index/nsec.c
+++ b/tests/index/nsec.c
@@ -56,7 +56,7 @@ static bool should_expect_nsecs(void)
p_unlink(nsec_path.ptr);
- git_buf_free(&nsec_path);
+ git_buf_dispose(&nsec_path);
return expect;
}
diff --git a/tests/index/racy.c b/tests/index/racy.c
index 1768f5e..a15f0fc 100644
--- a/tests/index/racy.c
+++ b/tests/index/racy.c
@@ -46,7 +46,7 @@ void test_index_racy__diff(void)
git_index_free(index);
git_diff_free(diff);
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
void test_index_racy__write_index_just_after_file(void)
@@ -95,7 +95,7 @@ void test_index_racy__write_index_just_after_file(void)
cl_git_pass(git_diff_index_to_workdir(&diff, g_repo, index, NULL));
cl_assert_equal_i(1, git_diff_num_deltas(diff));
- git_buf_free(&path);
+ git_buf_dispose(&path);
git_diff_free(diff);
git_index_free(index);
}
@@ -129,7 +129,7 @@ static void setup_race(void)
entry->mtime.seconds = st.st_mtime;
entry->mtime.nanoseconds = st.st_mtime_nsec;
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
void test_index_racy__smudges_index_entry_on_save(void)
@@ -196,7 +196,7 @@ static void setup_uptodate_files(void)
cl_git_pass(git_index_add_frombuffer(index, &new_entry, "hello!\n", 7));
git_index_free(index);
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
void test_index_racy__adding_to_index_is_uptodate(void)
diff --git a/tests/index/tests.c b/tests/index/tests.c
index ea8335b..b993fb2 100644
--- a/tests/index/tests.c
+++ b/tests/index/tests.c
@@ -40,7 +40,7 @@ static void copy_file(const char *src, const char *dst)
cl_git_pass(p_write(dst_fd, source_buf.ptr, source_buf.size));
cleanup:
- git_buf_free(&source_buf);
+ git_buf_dispose(&source_buf);
p_close(dst_fd);
}
@@ -54,14 +54,14 @@ static void files_are_equal(const char *a, const char *b)
cl_assert(0);
if (git_futils_readbuffer(&buf_b, b) < 0) {
- git_buf_free(&buf_a);
+ git_buf_dispose(&buf_a);
cl_assert(0);
}
pass = (buf_a.size == buf_b.size && !memcmp(buf_a.ptr, buf_b.ptr, buf_a.size));
- git_buf_free(&buf_a);
- git_buf_free(&buf_b);
+ git_buf_dispose(&buf_a);
+ git_buf_dispose(&buf_b);
cl_assert(pass);
}
@@ -468,7 +468,7 @@ static void add_invalid_filename(git_repository *repo, const char *fn)
cl_assert(git_index_entrycount(index) == 0);
- git_buf_free(&path);
+ git_buf_dispose(&path);
git_index_free(index);
}
@@ -545,7 +545,7 @@ static void write_invalid_filename(git_repository *repo, const char *fn_orig)
p_unlink(path.ptr);
cl_git_pass(git_index_remove_all(index, NULL, NULL, NULL));
- git_buf_free(&path);
+ git_buf_dispose(&path);
git_index_free(index);
git__free(fn);
}
diff --git a/tests/iterator/index.c b/tests/iterator/index.c
index b609d59..7de0d12 100644
--- a/tests/iterator/index.c
+++ b/tests/iterator/index.c
@@ -284,7 +284,7 @@ void test_iterator_index__case_folding(void)
cl_git_pass(git_buf_joinpath(&path, cl_fixture("icase"), ".gitted/CoNfIg"));
fs_is_ci = git_path_exists(path.ptr);
- git_buf_free(&path);
+ git_buf_dispose(&path);
index_iterator_test(
"icase", NULL, NULL, 0, ARRAY_SIZE(expected_index_cs),
@@ -1007,7 +1007,7 @@ static void create_paths(git_index *index, const char *root, int depth)
}
}
- git_buf_free(&fullpath);
+ git_buf_dispose(&fullpath);
}
void test_iterator_index__pathlist_for_deeply_nested_item(void)
diff --git a/tests/iterator/tree.c b/tests/iterator/tree.c
index 07da583..08df909 100644
--- a/tests/iterator/tree.c
+++ b/tests/iterator/tree.c
@@ -653,7 +653,7 @@ static void build_test_tree(
cl_git_pass(git_treebuilder_write(out, builder));
git_treebuilder_free(builder);
- git_buf_free(&name);
+ git_buf_dispose(&name);
}
void test_iterator_tree__case_conflicts_0(void)
diff --git a/tests/iterator/workdir.c b/tests/iterator/workdir.c
index c38a615..a16acd7 100644
--- a/tests/iterator/workdir.c
+++ b/tests/iterator/workdir.c
@@ -665,7 +665,7 @@ void test_iterator_workdir__filesystem_gunk(void)
*/
expect_iterator_items(i, 15, NULL, 15, NULL);
git_iterator_free(i);
- git_buf_free(&parent);
+ git_buf_dispose(&parent);
}
void test_iterator_workdir__skips_unreadable_dirs(void)
@@ -1041,7 +1041,7 @@ static void create_paths(const char *root, int depth)
}
}
- git_buf_free(&fullpath);
+ git_buf_dispose(&fullpath);
}
void test_iterator_workdir__pathlist_for_deeply_nested_item(void)
diff --git a/tests/merge/driver.c b/tests/merge/driver.c
index c75a007..a3fecec 100644
--- a/tests/merge/driver.c
+++ b/tests/merge/driver.c
@@ -129,7 +129,7 @@ static void set_gitattributes_to(const char *driver)
cl_assert(!git_buf_oom(&line));
cl_git_mkfile(TEST_REPO_PATH "/.gitattributes", line.ptr);
- git_buf_free(&line);
+ git_buf_dispose(&line);
}
static void merge_branch(void)
diff --git a/tests/merge/merge_helpers.c b/tests/merge/merge_helpers.c
index 4b1b7d2..1b68bdc 100644
--- a/tests/merge/merge_helpers.c
+++ b/tests/merge/merge_helpers.c
@@ -43,7 +43,7 @@ int merge_trees_from_branches(
error = git_merge_trees(index, repo, ancestor_tree, our_tree, their_tree, opts);
- git_buf_free(&branch_buf);
+ git_buf_dispose(&branch_buf);
git_tree_free(our_tree);
git_tree_free(their_tree);
git_tree_free(ancestor_tree);
@@ -75,7 +75,7 @@ int merge_commits_from_branches(
error = git_merge_commits(index, repo, our_commit, their_commit, opts);
- git_buf_free(&branch_buf);
+ git_buf_dispose(&branch_buf);
git_commit_free(our_commit);
git_commit_free(their_commit);
@@ -359,7 +359,7 @@ int merge_test_workdir(git_repository *repo, const struct merge_index_entry expe
return 0;
}
- git_buf_free(&wd);
+ git_buf_dispose(&wd);
return 1;
}
diff --git a/tests/merge/trees/trivial.c b/tests/merge/trees/trivial.c
index 2262edd..c7f8d24 100644
--- a/tests/merge/trees/trivial.c
+++ b/tests/merge/trees/trivial.c
@@ -51,7 +51,7 @@ static int merge_trivial(git_index **index, const char *ours, const char *theirs
cl_git_pass(git_merge_trees(index, repo, ancestor_tree, our_tree, their_tree, &opts));
- git_buf_free(&branch_buf);
+ git_buf_dispose(&branch_buf);
git_tree_free(our_tree);
git_tree_free(their_tree);
git_tree_free(ancestor_tree);
diff --git a/tests/merge/workdir/analysis.c b/tests/merge/workdir/analysis.c
index 351cfbd..84885c4 100644
--- a/tests/merge/workdir/analysis.c
+++ b/tests/merge/workdir/analysis.c
@@ -53,7 +53,7 @@ static void analysis_from_branch(
cl_git_pass(git_merge_analysis(merge_analysis, merge_pref, repo, (const git_annotated_commit **)&their_head, 1));
- git_buf_free(&refname);
+ git_buf_dispose(&refname);
git_annotated_commit_free(their_head);
git_reference_free(their_ref);
}
@@ -108,7 +108,7 @@ void test_merge_workdir_analysis__unborn(void)
cl_assert_equal_i(GIT_MERGE_ANALYSIS_FASTFORWARD, (merge_analysis & GIT_MERGE_ANALYSIS_FASTFORWARD));
cl_assert_equal_i(GIT_MERGE_ANALYSIS_UNBORN, (merge_analysis & GIT_MERGE_ANALYSIS_UNBORN));
- git_buf_free(&master);
+ git_buf_dispose(&master);
}
void test_merge_workdir_analysis__fastforward_with_config_noff(void)
diff --git a/tests/merge/workdir/dirty.c b/tests/merge/workdir/dirty.c
index a69919f..66301e1 100644
--- a/tests/merge/workdir/dirty.c
+++ b/tests/merge/workdir/dirty.c
@@ -123,8 +123,8 @@ static void write_files(char *files[])
cl_git_mkfile(path.ptr, content.ptr);
}
- git_buf_free(&path);
- git_buf_free(&content);
+ git_buf_dispose(&path);
+ git_buf_dispose(&content);
}
static void hack_index(char *files[])
@@ -178,7 +178,7 @@ static void hack_index(char *files[])
entry->file_size = (uint32_t)statbuf.st_size;
}
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
static void stage_random_files(char *files[])
@@ -218,7 +218,7 @@ static void stage_content(char *content[])
git_object_free(head_object);
git_reference_free(head);
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
static int merge_dirty_files(char *dirty_files[])
diff --git a/tests/merge/workdir/recursive.c b/tests/merge/workdir/recursive.c
index d47a0c5..e7dc267 100644
--- a/tests/merge/workdir/recursive.c
+++ b/tests/merge/workdir/recursive.c
@@ -46,7 +46,7 @@ void test_merge_workdir_recursive__writes_conflict_with_virtual_base(void)
cl_assert_equal_s(CONFLICTING_RECURSIVE_F1_TO_F2, conflicting_buf.ptr);
git_index_free(index);
- git_buf_free(&conflicting_buf);
+ git_buf_dispose(&conflicting_buf);
}
void test_merge_workdir_recursive__conflicting_merge_base_with_diff3(void)
@@ -80,5 +80,5 @@ void test_merge_workdir_recursive__conflicting_merge_base_with_diff3(void)
cl_assert_equal_s(CONFLICTING_RECURSIVE_H2_TO_H1_WITH_DIFF3, conflicting_buf.ptr);
git_index_free(index);
- git_buf_free(&conflicting_buf);
+ git_buf_dispose(&conflicting_buf);
}
diff --git a/tests/merge/workdir/setup.c b/tests/merge/workdir/setup.c
index 4aebf87..92524e2 100644
--- a/tests/merge/workdir/setup.c
+++ b/tests/merge/workdir/setup.c
@@ -54,8 +54,8 @@ static bool test_file_contents(const char *filename, const char *expected)
cl_git_pass(git_futils_readbuffer(&file_buf, file_path_buf.ptr));
equals = (strcmp(file_buf.ptr, expected) == 0);
- git_buf_free(&file_path_buf);
- git_buf_free(&file_buf);
+ git_buf_dispose(&file_path_buf);
+ git_buf_dispose(&file_buf);
return equals;
}
@@ -68,7 +68,7 @@ static void write_file_contents(const char *filename, const char *output)
filename);
cl_git_rewritefile(file_path_buf.ptr, output);
- git_buf_free(&file_path_buf);
+ git_buf_dispose(&file_path_buf);
}
/* git merge --no-ff octo1 */
@@ -495,10 +495,10 @@ static int create_remote_tracking_branch(const char *branch_name, const char *oi
cl_git_rewritefile(git_buf_cstr(&filename), git_buf_cstr(&data));
done:
- git_buf_free(&remotes_path);
- git_buf_free(&origin_path);
- git_buf_free(&filename);
- git_buf_free(&data);
+ git_buf_dispose(&remotes_path);
+ git_buf_dispose(&origin_path);
+ git_buf_dispose(&filename);
+ git_buf_dispose(&data);
return error;
}
diff --git a/tests/merge/workdir/simple.c b/tests/merge/workdir/simple.c
index 964532e..32b2062 100644
--- a/tests/merge/workdir/simple.c
+++ b/tests/merge/workdir/simple.c
@@ -155,7 +155,7 @@ void test_merge_workdir_simple__automerge(void)
cl_git_pass(git_futils_readbuffer(&automergeable_buf,
TEST_REPO_PATH "/automergeable.txt"));
cl_assert(strcmp(automergeable_buf.ptr, AUTOMERGEABLE_MERGED_FILE) == 0);
- git_buf_free(&automergeable_buf);
+ git_buf_dispose(&automergeable_buf);
cl_assert(merge_test_index(repo_index, merge_index_entries, 8));
cl_assert(merge_test_reuc(repo_index, merge_reuc_entries, 3));
@@ -201,7 +201,7 @@ void test_merge_workdir_simple__automerge_crlf(void)
cl_git_pass(git_futils_readbuffer(&automergeable_buf,
TEST_REPO_PATH "/automergeable.txt"));
cl_assert(strcmp(automergeable_buf.ptr, AUTOMERGEABLE_MERGED_FILE_CRLF) == 0);
- git_buf_free(&automergeable_buf);
+ git_buf_dispose(&automergeable_buf);
cl_assert(merge_test_index(repo_index, merge_index_entries, 8));
cl_assert(merge_test_reuc(repo_index, merge_reuc_entries, 3));
@@ -252,8 +252,8 @@ void test_merge_workdir_simple__mergefile(void)
"\n" \
"Conflicts:\n" \
"\tconflicting.txt\n") == 0);
- git_buf_free(&conflicting_buf);
- git_buf_free(&mergemsg_buf);
+ git_buf_dispose(&conflicting_buf);
+ git_buf_dispose(&mergemsg_buf);
cl_assert(merge_test_index(repo_index, merge_index_entries, 8));
cl_assert(merge_test_reuc(repo_index, merge_reuc_entries, 3));
@@ -289,7 +289,7 @@ void test_merge_workdir_simple__diff3(void)
cl_git_pass(git_futils_readbuffer(&conflicting_buf,
TEST_REPO_PATH "/conflicting.txt"));
cl_assert(strcmp(conflicting_buf.ptr, CONFLICTING_DIFF3_FILE) == 0);
- git_buf_free(&conflicting_buf);
+ git_buf_dispose(&conflicting_buf);
cl_assert(merge_test_index(repo_index, merge_index_entries, 8));
cl_assert(merge_test_reuc(repo_index, merge_reuc_entries, 3));
@@ -324,7 +324,7 @@ void test_merge_workdir_simple__union(void)
cl_git_pass(git_futils_readbuffer(&conflicting_buf,
TEST_REPO_PATH "/conflicting.txt"));
cl_assert(strcmp(conflicting_buf.ptr, CONFLICTING_UNION_FILE) == 0);
- git_buf_free(&conflicting_buf);
+ git_buf_dispose(&conflicting_buf);
cl_assert(merge_test_index(repo_index, merge_index_entries, 6));
cl_assert(merge_test_reuc(repo_index, merge_reuc_entries, 4));
@@ -360,7 +360,7 @@ void test_merge_workdir_simple__gitattributes_union(void)
cl_git_pass(git_futils_readbuffer(&conflicting_buf,
TEST_REPO_PATH "/conflicting.txt"));
cl_assert(strcmp(conflicting_buf.ptr, CONFLICTING_UNION_FILE) == 0);
- git_buf_free(&conflicting_buf);
+ git_buf_dispose(&conflicting_buf);
cl_assert(merge_test_index(repo_index, merge_index_entries, 6));
cl_assert(merge_test_reuc(repo_index, merge_reuc_entries, 4));
@@ -400,7 +400,7 @@ void test_merge_workdir_simple__diff3_from_config(void)
cl_git_pass(git_futils_readbuffer(&conflicting_buf,
TEST_REPO_PATH "/conflicting.txt"));
cl_assert(strcmp(conflicting_buf.ptr, CONFLICTING_DIFF3_FILE) == 0);
- git_buf_free(&conflicting_buf);
+ git_buf_dispose(&conflicting_buf);
cl_assert(merge_test_index(repo_index, merge_index_entries, 8));
cl_assert(merge_test_reuc(repo_index, merge_reuc_entries, 3));
@@ -442,7 +442,7 @@ void test_merge_workdir_simple__merge_overrides_config(void)
cl_git_pass(git_futils_readbuffer(&conflicting_buf,
TEST_REPO_PATH "/conflicting.txt"));
cl_assert(strcmp(conflicting_buf.ptr, CONFLICTING_MERGE_FILE) == 0);
- git_buf_free(&conflicting_buf);
+ git_buf_dispose(&conflicting_buf);
cl_assert(merge_test_index(repo_index, merge_index_entries, 8));
cl_assert(merge_test_reuc(repo_index, merge_reuc_entries, 3));
diff --git a/tests/merge/workdir/trivial.c b/tests/merge/workdir/trivial.c
index 4ddaf23..85cce49 100644
--- a/tests/merge/workdir/trivial.c
+++ b/tests/merge/workdir/trivial.c
@@ -49,7 +49,7 @@ static int merge_trivial(const char *ours, const char *theirs)
cl_git_pass(git_merge(repo, (const git_annotated_commit **)their_heads, 1, NULL, NULL));
- git_buf_free(&branch_buf);
+ git_buf_dispose(&branch_buf);
git_reference_free(our_ref);
git_reference_free(their_ref);
git_annotated_commit_free(their_heads[0]);
diff --git a/tests/network/refspecs.c b/tests/network/refspecs.c
index c47f197..051802b 100644
--- a/tests/network/refspecs.c
+++ b/tests/network/refspecs.c
@@ -97,7 +97,7 @@ static void assert_valid_transform(const char *refspec, const char *name, const
cl_git_pass(git_refspec_transform(&buf, &spec, name));
cl_assert_equal_s(result, buf.ptr);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_refspec__free(&spec);
}
@@ -119,7 +119,7 @@ static void assert_invalid_transform(const char *refspec, const char *name)
git_refspec__parse(&spec, refspec, true);
cl_git_fail(git_refspec_transform(&buf, &spec, name));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_refspec__free(&spec);
}
@@ -137,7 +137,7 @@ static void assert_invalid_rtransform(const char *refspec, const char *name)
git_refspec__parse(&spec, refspec, true);
cl_git_fail(git_refspec_rtransform(&buf, &spec, name));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_refspec__free(&spec);
}
diff --git a/tests/network/remote/defaultbranch.c b/tests/network/remote/defaultbranch.c
index 9ab0d40..b0417f7 100644
--- a/tests/network/remote/defaultbranch.c
+++ b/tests/network/remote/defaultbranch.c
@@ -29,7 +29,7 @@ static void assert_default_branch(const char *should)
cl_git_pass(git_remote_connect(g_remote, GIT_DIRECTION_FETCH, NULL, NULL, NULL));
cl_git_pass(git_remote_default_branch(&name, g_remote));
cl_assert_equal_s(should, name.ptr);
- git_buf_free(&name);
+ git_buf_dispose(&name);
}
void test_network_remote_defaultbranch__master(void)
diff --git a/tests/network/remote/local.c b/tests/network/remote/local.c
index 76872e5..99b91c5 100644
--- a/tests/network/remote/local.c
+++ b/tests/network/remote/local.c
@@ -25,7 +25,7 @@ void test_network_remote_local__initialize(void)
void test_network_remote_local__cleanup(void)
{
- git_buf_free(&file_path_buf);
+ git_buf_dispose(&file_path_buf);
git_remote_free(remote);
remote = NULL;
diff --git a/tests/network/remote/remotes.c b/tests/network/remote/remotes.c
index 9c7e6b2..8bbc5c7 100644
--- a/tests/network/remote/remotes.c
+++ b/tests/network/remote/remotes.c
@@ -189,7 +189,7 @@ void test_network_remote_remotes__transform(void)
cl_git_pass(git_refspec_transform(&ref, _refspec, "refs/heads/master"));
cl_assert_equal_s(ref.ptr, "refs/remotes/test/master");
- git_buf_free(&ref);
+ git_buf_dispose(&ref);
}
void test_network_remote_remotes__transform_destination_to_source(void)
@@ -198,7 +198,7 @@ void test_network_remote_remotes__transform_destination_to_source(void)
cl_git_pass(git_refspec_rtransform(&ref, _refspec, "refs/remotes/test/master"));
cl_assert_equal_s(ref.ptr, "refs/heads/master");
- git_buf_free(&ref);
+ git_buf_dispose(&ref);
}
void test_network_remote_remotes__missing_refspecs(void)
diff --git a/tests/notes/notes.c b/tests/notes/notes.c
index 9626f53..f245766 100644
--- a/tests/notes/notes.c
+++ b/tests/notes/notes.c
@@ -287,7 +287,7 @@ void test_notes_notes__inserting_a_note_without_passing_a_namespace_uses_the_def
assert_note_equal(note, "hello world\n", ¬e_oid);
assert_note_equal(default_namespace_note, "hello world\n", ¬e_oid);
- git_buf_free(&default_ref);
+ git_buf_dispose(&default_ref);
git_note_free(note);
git_note_free(default_namespace_note);
}
diff --git a/tests/notes/notesref.c b/tests/notes/notesref.c
index 4159ddc..3bcb05f 100644
--- a/tests/notes/notesref.c
+++ b/tests/notes/notesref.c
@@ -64,5 +64,5 @@ void test_notes_notesref__config_corenotesref(void)
cl_git_pass(git_note_default_ref(&default_ref, _repo));
cl_assert_equal_s(GIT_NOTES_DEFAULT_REF, default_ref.ptr);
- git_buf_free(&default_ref);
+ git_buf_dispose(&default_ref);
}
diff --git a/tests/object/blob/filter.c b/tests/object/blob/filter.c
index 0aaaee6..002177c 100644
--- a/tests/object/blob/filter.c
+++ b/tests/object/blob/filter.c
@@ -103,7 +103,7 @@ void test_object_blob_filter__stats(void)
git_blob_free(blob);
}
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_object_blob_filter__to_odb(void)
@@ -139,12 +139,12 @@ void test_object_blob_filter__to_odb(void)
cl_assert_equal_sz(g_crlf_filtered[i].size, zeroed.size);
cl_assert_equal_i(
0, memcmp(zeroed.ptr, g_crlf_filtered[i].ptr, zeroed.size));
- git_buf_free(&zeroed);
+ git_buf_dispose(&zeroed);
git_blob_free(blob);
}
git_filter_list_free(fl);
- git_buf_free(&out);
+ git_buf_dispose(&out);
git_config_free(cfg);
}
diff --git a/tests/object/blob/fromstream.c b/tests/object/blob/fromstream.c
index d23149b..34b9f58 100644
--- a/tests/object/blob/fromstream.c
+++ b/tests/object/blob/fromstream.c
@@ -56,7 +56,7 @@ static void write_attributes(git_repository *repo)
cl_git_pass(git_futils_mkpath2file(git_buf_cstr(&buf), 0777));
cl_git_rewritefile(git_buf_cstr(&buf), GITATTR);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
static void assert_named_chunked_blob(const char *expected_sha, const char *fake_name)
diff --git a/tests/object/blob/write.c b/tests/object/blob/write.c
index 203bc67..4cf5a66 100644
--- a/tests/object/blob/write.c
+++ b/tests/object/blob/write.c
@@ -48,7 +48,7 @@ void test_object_blob_write__can_create_a_blob_in_a_standard_repo_from_a_absolut
assert_blob_creation(ELSEWHERE "/test.txt", git_buf_cstr(&full_path), &git_blob_create_fromdisk);
- git_buf_free(&full_path);
+ git_buf_dispose(&full_path);
cl_must_pass(git_futils_rmdir_r(ELSEWHERE, NULL, GIT_RMDIR_REMOVE_FILES));
}
@@ -64,6 +64,6 @@ void test_object_blob_write__can_create_a_blob_in_a_bare_repo_from_a_absolute_fi
assert_blob_creation(ELSEWHERE "/test.txt", git_buf_cstr(&full_path), &git_blob_create_fromdisk);
- git_buf_free(&full_path);
+ git_buf_dispose(&full_path);
cl_must_pass(git_futils_rmdir_r(ELSEWHERE, NULL, GIT_RMDIR_REMOVE_FILES));
}
diff --git a/tests/object/commit/commitstagedfile.c b/tests/object/commit/commitstagedfile.c
index 5b48519..63ecfee 100644
--- a/tests/object/commit/commitstagedfile.c
+++ b/tests/object/commit/commitstagedfile.c
@@ -127,7 +127,7 @@ void test_object_commit_commitstagedfile__generate_predictable_object_ids(void)
cl_assert(git_oid_cmp(&expected_commit_oid, &commit_oid) == 0);
- git_buf_free(&buffer);
+ git_buf_dispose(&buffer);
git_signature_free(signature);
git_tree_free(tree);
git_index_free(index);
diff --git a/tests/object/lookup.c b/tests/object/lookup.c
index 544f32b..536c415 100644
--- a/tests/object/lookup.c
+++ b/tests/object/lookup.c
@@ -88,8 +88,8 @@ void test_object_lookup__lookup_corrupt_object_returns_error(void)
cl_git_pass(git_object_lookup(&object, g_repo, &oid, GIT_OBJ_COMMIT));
git_object_free(object);
- git_buf_free(&path);
- git_buf_free(&contents);
+ git_buf_dispose(&path);
+ git_buf_dispose(&contents);
}
void test_object_lookup__lookup_object_with_wrong_hash_returns_error(void)
@@ -117,6 +117,6 @@ void test_object_lookup__lookup_object_with_wrong_hash_returns_error(void)
cl_git_pass(git_libgit2_opts(GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION, 1));
git_object_free(object);
- git_buf_free(&oldpath);
- git_buf_free(&newpath);
+ git_buf_dispose(&oldpath);
+ git_buf_dispose(&newpath);
}
diff --git a/tests/object/message.c b/tests/object/message.c
index 40d8e72..519ce5f 100644
--- a/tests/object/message.c
+++ b/tests/object/message.c
@@ -9,7 +9,7 @@ static void assert_message_prettifying(char *expected_output, char *input, int s
git_message_prettify(&prettified_message, input, strip_comments, '#');
cl_assert_equal_s(expected_output, git_buf_cstr(&prettified_message));
- git_buf_free(&prettified_message);
+ git_buf_dispose(&prettified_message);
}
#define t40 "A quick brown fox jumps over the lazy do"
@@ -177,23 +177,23 @@ void test_object_message__message_prettify(void)
memset(&buffer, 0, sizeof(buffer));
cl_git_pass(git_message_prettify(&buffer, "", 0, '#'));
cl_assert_equal_s(buffer.ptr, "");
- git_buf_free(&buffer);
+ git_buf_dispose(&buffer);
cl_git_pass(git_message_prettify(&buffer, "", 1, '#'));
cl_assert_equal_s(buffer.ptr, "");
- git_buf_free(&buffer);
+ git_buf_dispose(&buffer);
cl_git_pass(git_message_prettify(&buffer, "Short", 0, '#'));
cl_assert_equal_s("Short\n", buffer.ptr);
- git_buf_free(&buffer);
+ git_buf_dispose(&buffer);
cl_git_pass(git_message_prettify(&buffer, "Short", 1, '#'));
cl_assert_equal_s("Short\n", buffer.ptr);
- git_buf_free(&buffer);
+ git_buf_dispose(&buffer);
cl_git_pass(git_message_prettify(&buffer, "This is longer\nAnd multiline\n# with some comments still in\n", 0, '#'));
cl_assert_equal_s(buffer.ptr, "This is longer\nAnd multiline\n# with some comments still in\n");
- git_buf_free(&buffer);
+ git_buf_dispose(&buffer);
cl_git_pass(git_message_prettify(&buffer, "This is longer\nAnd multiline\n# with some comments still in\n", 1, '#'));
cl_assert_equal_s(buffer.ptr, "This is longer\nAnd multiline\n");
- git_buf_free(&buffer);
+ git_buf_dispose(&buffer);
}
diff --git a/tests/object/shortid.c b/tests/object/shortid.c
index d854cb7..5c5990a 100644
--- a/tests/object/shortid.c
+++ b/tests/object/shortid.c
@@ -47,5 +47,5 @@ void test_object_shortid__select(void)
cl_assert_equal_s("dea509d0b", shorty.ptr);
git_object_free(obj);
- git_buf_free(&shorty);
+ git_buf_dispose(&shorty);
}
diff --git a/tests/object/tree/write.c b/tests/object/tree/write.c
index a1ee03d..8df6938 100644
--- a/tests/object/tree/write.c
+++ b/tests/object/tree/write.c
@@ -399,7 +399,7 @@ void test_object_tree_write__cruel_paths(void)
cl_git_pass(git_tree_entry_bypath(&te, tree, b.ptr));
cl_assert_equal_s(the_paths[j], git_tree_entry_name(te));
git_tree_entry_free(te);
- git_buf_free(&b);
+ git_buf_dispose(&b);
}
}
diff --git a/tests/odb/alternates.c b/tests/odb/alternates.c
index b5c0e79..f65a44b 100644
--- a/tests/odb/alternates.c
+++ b/tests/odb/alternates.c
@@ -13,8 +13,8 @@ void test_odb_alternates__cleanup(void)
{
size_t i;
- git_buf_free(&destpath);
- git_buf_free(&filepath);
+ git_buf_dispose(&destpath);
+ git_buf_dispose(&filepath);
for (i = 0; i < ARRAY_SIZE(paths); i++)
cl_fixture_cleanup(paths[i]);
diff --git a/tests/odb/foreach.c b/tests/odb/foreach.c
index 42d7064..5db66ba 100644
--- a/tests/odb/foreach.c
+++ b/tests/odb/foreach.c
@@ -114,7 +114,7 @@ void test_odb_foreach__files_in_objects_dir(void)
cl_git_pass(git_buf_printf(&buf, "%s/objects/somefile", git_repository_path(repo)));
cl_git_mkfile(buf.ptr, "");
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
cl_git_pass(git_repository_odb(&odb, repo));
cl_git_pass(git_odb_foreach(odb, foreach_cb, &nobj));
diff --git a/tests/odb/freshen.c b/tests/odb/freshen.c
index 9d3cf51..6354126 100644
--- a/tests/odb/freshen.c
+++ b/tests/odb/freshen.c
@@ -31,7 +31,7 @@ static void set_time_wayback(struct stat *out, const char *fn)
cl_must_pass(p_utimes(git_buf_cstr(&fullpath), old));
cl_must_pass(p_lstat(git_buf_cstr(&fullpath), out));
- git_buf_free(&fullpath);
+ git_buf_dispose(&fullpath);
}
#define LOOSE_STR "my new file\n"
diff --git a/tests/odb/largefiles.c b/tests/odb/largefiles.c
index a5b982e..9fd99e5 100644
--- a/tests/odb/largefiles.c
+++ b/tests/odb/largefiles.c
@@ -36,7 +36,7 @@ static void writefile(git_oid *oid)
cl_git_pass(git_odb_stream_finalize_write(oid, stream));
git_odb_stream_free(stream);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_odb_largefiles__write_from_memory(void)
diff --git a/tests/online/clone.c b/tests/online/clone.c
index 4310614..de66238 100644
--- a/tests/online/clone.c
+++ b/tests/online/clone.c
@@ -170,7 +170,7 @@ void test_online_clone__can_checkout_a_cloned_repo(void)
cl_assert_equal_i(true, fetch_progress_cb_was_called);
git_reference_free(head);
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
static int remote_mirror_cb(git_remote **out, git_repository *repo,
@@ -734,7 +734,7 @@ void test_online_clone__proxy_credentials_request(void)
cl_git_pass(git_clone(&g_repo, "http://github.com/libgit2/TestGitRepository", "./foo", &g_options));
cl_assert(called_proxy_creds);
- git_buf_free(&url);
+ git_buf_dispose(&url);
}
void test_online_clone__proxy_credentials_in_url(void)
@@ -752,7 +752,7 @@ void test_online_clone__proxy_credentials_in_url(void)
cl_git_pass(git_clone(&g_repo, "http://github.com/libgit2/TestGitRepository", "./foo", &g_options));
cl_assert(called_proxy_creds == 0);
- git_buf_free(&url);
+ git_buf_dispose(&url);
}
void test_online_clone__proxy_credentials_in_environment(void)
@@ -775,5 +775,5 @@ void test_online_clone__proxy_credentials_in_environment(void)
cl_git_pass(git_clone(&g_repo, "http://github.com/libgit2/TestGitRepository", "./foo", &g_options));
- git_buf_free(&url);
+ git_buf_dispose(&url);
}
diff --git a/tests/online/fetchhead.c b/tests/online/fetchhead.c
index c1ac06d..ae72dde 100644
--- a/tests/online/fetchhead.c
+++ b/tests/online/fetchhead.c
@@ -72,7 +72,7 @@ static void fetchhead_test_fetch(const char *fetchspec, const char *expected_fet
equals = (strcmp(fetchhead_buf.ptr, expected_fetchhead) == 0);
- git_buf_free(&fetchhead_buf);
+ git_buf_dispose(&fetchhead_buf);
cl_assert(equals);
}
diff --git a/tests/online/push.c b/tests/online/push.c
index f72b4f8..000e481 100644
--- a/tests/online/push.c
+++ b/tests/online/push.c
@@ -149,7 +149,7 @@ static void do_verify_push_status(record_callbacks_data *data, const push_status
cl_fail(git_buf_cstr(&msg));
- git_buf_free(&msg);
+ git_buf_dispose(&msg);
}
git_vector_foreach(actual, i, iter)
@@ -263,8 +263,8 @@ failed:
git__free(actual_ref);
git_vector_free(&actual_refs);
- git_buf_free(&msg);
- git_buf_free(&ref_name);
+ git_buf_dispose(&msg);
+ git_buf_dispose(&ref_name);
}
static void verify_update_tips_callback(git_remote *remote, expected_ref expected_refs[], size_t expected_refs_len)
@@ -309,8 +309,8 @@ failed:
if (failed)
cl_fail(git_buf_cstr(&msg));
- git_buf_free(&ref_name);
- git_buf_free(&msg);
+ git_buf_dispose(&ref_name);
+ git_buf_dispose(&msg);
}
void test_online_push__initialize(void)
diff --git a/tests/online/push_util.c b/tests/online/push_util.c
index eafec2f..fe9af2c 100644
--- a/tests/online/push_util.c
+++ b/tests/online/push_util.c
@@ -137,5 +137,5 @@ failed:
cl_fail(git_buf_cstr(&msg));
- git_buf_free(&msg);
+ git_buf_dispose(&msg);
}
diff --git a/tests/pack/indexer.c b/tests/pack/indexer.c
index f3c2204..4533998 100644
--- a/tests/pack/indexer.c
+++ b/tests/pack/indexer.c
@@ -249,7 +249,7 @@ void test_pack_indexer__no_tmp_files(void)
/* Precondition: there are no temporary files. */
cl_git_pass(git_buf_sets(&path, clar_sandbox_path()));
cl_git_pass(find_tmp_file_recurs(&first_tmp_file, &path));
- git_buf_free(&path);
+ git_buf_dispose(&path);
cl_assert(git_buf_len(&first_tmp_file) == 0);
cl_git_pass(git_indexer_new(&idx, ".", 0, NULL, NULL, NULL));
@@ -257,7 +257,7 @@ void test_pack_indexer__no_tmp_files(void)
cl_git_pass(git_buf_sets(&path, clar_sandbox_path()));
cl_git_pass(find_tmp_file_recurs(&first_tmp_file, &path));
- git_buf_free(&path);
+ git_buf_dispose(&path);
cl_assert(git_buf_len(&first_tmp_file) == 0);
- git_buf_free(&first_tmp_file);
+ git_buf_dispose(&first_tmp_file);
}
diff --git a/tests/pack/packbuilder.c b/tests/pack/packbuilder.c
index 13ee073..932cb38 100644
--- a/tests/pack/packbuilder.c
+++ b/tests/pack/packbuilder.c
@@ -128,8 +128,8 @@ void test_pack_packbuilder__create_pack(void)
cl_git_pass(git_hash_final(&hash, &ctx));
git_hash_ctx_cleanup(&ctx);
- git_buf_free(&path);
- git_buf_free(&buf);
+ git_buf_dispose(&path);
+ git_buf_dispose(&buf);
git_oid_fmt(hex, &hash);
diff --git a/tests/patch/print.c b/tests/patch/print.c
index 62e50b9..4703c1d 100644
--- a/tests/patch/print.c
+++ b/tests/patch/print.c
@@ -20,7 +20,7 @@ void patch_print_from_patchfile(const char *data, size_t len)
cl_assert_equal_s(data, buf.ptr);
git_patch_free(patch);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_patch_print__change_middle(void)
diff --git a/tests/path/core.c b/tests/path/core.c
index 0ab41ea..bbcded0 100644
--- a/tests/path/core.c
+++ b/tests/path/core.c
@@ -11,7 +11,7 @@ static void test_make_relative(
git_buf_puts(&buf, path);
cl_assert_equal_i(expected_status, git_path_make_relative(&buf, parent));
cl_assert_equal_s(expected_path, buf.ptr);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_path_core__make_relative(void)
@@ -319,7 +319,7 @@ static void test_join_unrooted(
cl_assert_equal_s(expected_result, result.ptr);
cl_assert_equal_i(expected_rootlen, root_at);
- git_buf_free(&result);
+ git_buf_dispose(&result);
}
void test_path_core__join_unrooted(void)
@@ -350,5 +350,5 @@ void test_path_core__join_unrooted(void)
/* Trailing slash in the base is ignored */
test_join_unrooted("c:/foo/bar/foobar", 6, "c:/foo/bar/foobar", "c:/foo/");
- git_buf_free(&out);
+ git_buf_dispose(&out);
}
diff --git a/tests/rebase/submodule.c b/tests/rebase/submodule.c
index 8ae78ce..7e27d7c 100644
--- a/tests/rebase/submodule.c
+++ b/tests/rebase/submodule.c
@@ -81,7 +81,7 @@ void test_rebase_submodule__init_untracked(void)
fp = fopen(git_buf_cstr(&untracked_path), "w");
fprintf(fp, "An untracked file in a submodule should not block a rebase\n");
fclose(fp);
- git_buf_free(&untracked_path);
+ git_buf_dispose(&untracked_path);
cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, NULL));
diff --git a/tests/refs/branches/create.c b/tests/refs/branches/create.c
index a4db574..70ffad8 100644
--- a/tests/refs/branches/create.c
+++ b/tests/refs/branches/create.c
@@ -132,7 +132,7 @@ static void assert_branch_matches_name(
git_oid_cmp(git_reference_target(ref), git_commit_id(target)));
git_reference_free(ref);
- git_buf_free(&b);
+ git_buf_dispose(&b);
}
void test_refs_branches_create__can_create_branch_with_unicode(void)
diff --git a/tests/refs/branches/remote.c b/tests/refs/branches/remote.c
index 4752671..ac428ab 100644
--- a/tests/refs/branches/remote.c
+++ b/tests/refs/branches/remote.c
@@ -26,7 +26,7 @@ void test_refs_branches_remote__can_get_remote_for_branch(void)
cl_git_pass(git_branch_remote_name(&remotename, g_repo, remote_tracking_branch_name));
cl_assert_equal_s("test", remotename.ptr);
- git_buf_free(&remotename);
+ git_buf_dispose(&remotename);
}
void test_refs_branches_remote__no_matching_remote_returns_error(void)
diff --git a/tests/refs/branches/upstream.c b/tests/refs/branches/upstream.c
index 82f5665..6024b1d 100644
--- a/tests/refs/branches/upstream.c
+++ b/tests/refs/branches/upstream.c
@@ -68,7 +68,7 @@ void test_refs_branches_upstream__upstream_remote(void)
cl_git_pass(git_branch_upstream_remote(&buf, repo, "refs/heads/master"));
cl_assert_equal_s("test", buf.ptr);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
}
void test_refs_branches_upstream__upstream_remote_empty_value(void)
diff --git a/tests/refs/branches/upstreamname.c b/tests/refs/branches/upstreamname.c
index d30002e..2eb6397 100644
--- a/tests/refs/branches/upstreamname.c
+++ b/tests/refs/branches/upstreamname.c
@@ -13,7 +13,7 @@ void test_refs_branches_upstreamname__initialize(void)
void test_refs_branches_upstreamname__cleanup(void)
{
- git_buf_free(&upstream_name);
+ git_buf_dispose(&upstream_name);
git_repository_free(repo);
repo = NULL;
diff --git a/tests/refs/delete.c b/tests/refs/delete.c
index a1b9e25..8cad316 100644
--- a/tests/refs/delete.c
+++ b/tests/refs/delete.c
@@ -52,7 +52,7 @@ void test_refs_delete__packed_loose(void)
cl_assert(!git_path_exists(temp_path.ptr));
git_reference_free(another_looked_up_ref);
- git_buf_free(&temp_path);
+ git_buf_dispose(&temp_path);
}
void test_refs_delete__packed_only(void)
diff --git a/tests/refs/pack.c b/tests/refs/pack.c
index bda86f6..92312e2 100644
--- a/tests/refs/pack.c
+++ b/tests/refs/pack.c
@@ -37,7 +37,7 @@ void test_refs_pack__empty(void)
cl_git_pass(git_buf_join_n(&temp_path, '/', 3, git_repository_path(g_repo), GIT_REFS_HEADS_DIR, "empty_dir"));
cl_git_pass(git_futils_mkdir_r(temp_path.ptr, GIT_REFS_DIR_MODE));
- git_buf_free(&temp_path);
+ git_buf_dispose(&temp_path);
packall();
}
@@ -75,7 +75,7 @@ void test_refs_pack__loose(void)
cl_assert(!git_path_exists(temp_path.ptr));
git_reference_free(reference);
- git_buf_free(&temp_path);
+ git_buf_dispose(&temp_path);
}
void test_refs_pack__symbolic(void)
diff --git a/tests/refs/read.c b/tests/refs/read.c
index cb42a56..c00b016 100644
--- a/tests/refs/read.c
+++ b/tests/refs/read.c
@@ -45,7 +45,7 @@ void test_refs_read__loose_tag(void)
/* Ensure the name of the tag matches the name of the reference */
cl_git_pass(git_buf_joinpath(&ref_name_from_tag_name, GIT_REFS_TAGS_DIR, git_tag_name((git_tag *)object)));
cl_assert_equal_s(ref_name_from_tag_name.ptr, loose_tag_ref_name);
- git_buf_free(&ref_name_from_tag_name);
+ git_buf_dispose(&ref_name_from_tag_name);
git_object_free(object);
diff --git a/tests/refs/ref_helpers.c b/tests/refs/ref_helpers.c
index 7676e65..42b4921 100644
--- a/tests/refs/ref_helpers.c
+++ b/tests/refs/ref_helpers.c
@@ -19,7 +19,7 @@ int reference_is_packed(git_reference *ref)
packed = !git_path_isfile(ref_path.ptr);
- git_buf_free(&ref_path);
+ git_buf_dispose(&ref_path);
return packed;
}
diff --git a/tests/refs/reflog/messages.c b/tests/refs/reflog/messages.c
index a7a7766..3868e77 100644
--- a/tests/refs/reflog/messages.c
+++ b/tests/refs/reflog/messages.c
@@ -355,7 +355,7 @@ void test_refs_reflog_messages__creating_branches_default_messages(void)
g_email, "branch: Created from e90810b8df3");
git_annotated_commit_free(annotated);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_commit_free(target);
git_reference_free(branch1);
git_reference_free(branch2);
diff --git a/tests/refs/reflog/reflog.c b/tests/refs/reflog/reflog.c
index bbcdbf9..a448463 100644
--- a/tests/refs/reflog/reflog.c
+++ b/tests/refs/reflog/reflog.c
@@ -120,8 +120,8 @@ void test_refs_reflog_reflog__renaming_the_reference_moves_the_reflog(void)
cl_assert_equal_i(true, git_path_isfile(git_buf_cstr(&moved_log_path)));
git_reference_free(new_master);
- git_buf_free(&moved_log_path);
- git_buf_free(&master_log_path);
+ git_buf_dispose(&moved_log_path);
+ git_buf_dispose(&master_log_path);
}
void test_refs_reflog_reflog__deleting_the_reference_deletes_the_reflog(void)
@@ -139,7 +139,7 @@ void test_refs_reflog_reflog__deleting_the_reference_deletes_the_reflog(void)
git_reference_free(master);
cl_assert_equal_i(false, git_path_isfile(git_buf_cstr(&master_log_path)));
- git_buf_free(&master_log_path);
+ git_buf_dispose(&master_log_path);
}
void test_refs_reflog_reflog__removes_empty_reflog_dir(void)
@@ -165,7 +165,7 @@ void test_refs_reflog_reflog__removes_empty_reflog_dir(void)
cl_git_pass(git_reference_create(&ref, g_repo, "refs/heads/new-dir", &id, 0, NULL));
git_reference_free(ref);
- git_buf_free(&log_path);
+ git_buf_dispose(&log_path);
}
void test_refs_reflog_reflog__fails_gracefully_on_nonempty_reflog_dir(void)
@@ -192,7 +192,7 @@ void test_refs_reflog_reflog__fails_gracefully_on_nonempty_reflog_dir(void)
cl_git_fail_with(GIT_EDIRECTORY, git_reference_create(&ref, g_repo, "refs/heads/new-dir", &id, 0, NULL));
git_reference_free(ref);
- git_buf_free(&log_path);
+ git_buf_dispose(&log_path);
}
static void assert_has_reflog(bool expected_result, const char *name)
@@ -221,7 +221,7 @@ void test_refs_reflog_reflog__reading_the_reflog_from_a_reference_with_no_log_re
cl_assert_equal_i(0, (int)git_reflog_entrycount(reflog));
git_reflog_free(reflog);
- git_buf_free(&subtrees_log_path);
+ git_buf_dispose(&subtrees_log_path);
}
void test_refs_reflog_reflog__reading_a_reflog_with_invalid_format_returns_error(void)
@@ -263,8 +263,8 @@ void test_refs_reflog_reflog__reading_a_reflog_with_invalid_format_returns_error
cl_assert_equal_s("unable to parse OID - contains invalid characters", error->message);
git_reference_free(ref);
- git_buf_free(&logpath);
- git_buf_free(&logcontents);
+ git_buf_dispose(&logpath);
+ git_buf_dispose(&logcontents);
}
void test_refs_reflog_reflog__cannot_write_a_moved_reflog(void)
@@ -285,8 +285,8 @@ void test_refs_reflog_reflog__cannot_write_a_moved_reflog(void)
git_reflog_free(reflog);
git_reference_free(new_master);
- git_buf_free(&moved_log_path);
- git_buf_free(&master_log_path);
+ git_buf_dispose(&moved_log_path);
+ git_buf_dispose(&master_log_path);
}
void test_refs_reflog_reflog__renaming_with_an_invalid_name_returns_EINVALIDSPEC(void)
diff --git a/tests/refs/reflog/reflog_helpers.c b/tests/refs/reflog/reflog_helpers.c
index 5e36736..6eba8ec 100644
--- a/tests/refs/reflog/reflog_helpers.c
+++ b/tests/refs/reflog/reflog_helpers.c
@@ -94,7 +94,7 @@ void cl_reflog_check_entry_(git_repository *repo, const char *reflog, size_t idx
if (git_buf_len(&result) != 0)
clar__fail(file, line, "Reflog entry mismatch", git_buf_cstr(&result), 1);
- git_buf_free(&result);
+ git_buf_dispose(&result);
git_reflog_free(log);
}
@@ -113,6 +113,6 @@ void reflog_print(git_repository *repo, const char *reflog_name)
}
fprintf(stderr, "%s", git_buf_cstr(&out));
- git_buf_free(&out);
+ git_buf_dispose(&out);
git_reflog_free(reflog);
}
diff --git a/tests/refs/rename.c b/tests/refs/rename.c
index 3e0be31..e3e5148 100644
--- a/tests/refs/rename.c
+++ b/tests/refs/rename.c
@@ -71,7 +71,7 @@ void test_refs_rename__loose(void)
git_reference_free(new_ref);
git_reference_free(another_looked_up_ref);
- git_buf_free(&temp_path);
+ git_buf_dispose(&temp_path);
}
void test_refs_rename__packed(void)
@@ -113,7 +113,7 @@ void test_refs_rename__packed(void)
git_reference_free(new_ref);
git_reference_free(another_looked_up_ref);
- git_buf_free(&temp_path);
+ git_buf_dispose(&temp_path);
}
void test_refs_rename__packed_doesnt_pack_others(void)
@@ -155,7 +155,7 @@ void test_refs_rename__packed_doesnt_pack_others(void)
git_reference_free(renamed_ref);
git_reference_free(another_looked_up_ref);
- git_buf_free(&temp_path);
+ git_buf_dispose(&temp_path);
}
void test_refs_rename__name_collision(void)
diff --git a/tests/refs/revparse.c b/tests/refs/revparse.c
index 459188c..3c4ed9a 100644
--- a/tests/refs/revparse.c
+++ b/tests/refs/revparse.c
@@ -338,7 +338,7 @@ static void create_fake_stash_reference_and_reflog(git_repository *repo)
cl_assert_equal_i(true, git_path_isfile(git_buf_cstr(&log_path)));
- git_buf_free(&log_path);
+ git_buf_dispose(&log_path);
git_reference_free(new_master);
}
diff --git a/tests/repo/config.c b/tests/repo/config.c
index 93dedd5..b92d842 100644
--- a/tests/repo/config.c
+++ b/tests/repo/config.c
@@ -21,7 +21,7 @@ void test_repo_config__cleanup(void)
{
cl_sandbox_set_search_path_defaults();
- git_buf_free(&path);
+ git_buf_dispose(&path);
cl_git_pass(
git_futils_rmdir_r("alternate", NULL, GIT_RMDIR_REMOVE_FILES));
@@ -70,7 +70,7 @@ void test_repo_config__can_open_missing_global_with_separators(void)
cl_git_pass(git_libgit2_opts(
GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_XDG, path.ptr));
- git_buf_free(&path);
+ git_buf_dispose(&path);
cl_git_pass(git_repository_open(&repo, "empty_standard_repo"));
cl_git_pass(git_repository_config(&config, repo));
diff --git a/tests/repo/discover.c b/tests/repo/discover.c
index eadd055..b13c97b 100644
--- a/tests/repo/discover.c
+++ b/tests/repo/discover.c
@@ -37,8 +37,8 @@ static void ensure_repository_discover(const char *start_path,
cl_assert_equal_s(found_path.ptr, resolved.ptr);
- git_buf_free(&resolved);
- git_buf_free(&found_path);
+ git_buf_dispose(&resolved);
+ git_buf_dispose(&found_path);
}
static void write_file(const char *path, const char *content)
@@ -71,7 +71,7 @@ static void append_ceiling_dir(git_buf *ceiling_dirs, const char *path)
git_buf_puts(ceiling_dirs, pretty_path.ptr);
- git_buf_free(&pretty_path);
+ git_buf_dispose(&pretty_path);
cl_assert(git_buf_oom(ceiling_dirs) == 0);
}
@@ -114,8 +114,8 @@ void test_repo_discover__initialize(void)
void test_repo_discover__cleanup(void)
{
- git_buf_free(&discovered);
- git_buf_free(&ceiling_dirs);
+ git_buf_dispose(&discovered);
+ git_buf_dispose(&ceiling_dirs);
cl_git_pass(git_futils_rmdir_r(TEMP_REPO_FOLDER, NULL, GIT_RMDIR_REMOVE_FILES));
}
diff --git a/tests/repo/env.c b/tests/repo/env.c
index 6404f88..8e2e5f8 100644
--- a/tests/repo/env.c
+++ b/tests/repo/env.c
@@ -45,7 +45,7 @@ static int GIT_FORMAT_PRINTF(2, 3) cl_setenv_printf(const char *name, const char
va_end(args);
ret = cl_setenv(name, git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
return ret;
}
@@ -85,7 +85,7 @@ static void env_cd_(
cl_must_pass(p_chdir(path));
passfail_(NULL, file, line);
cl_must_pass(p_chdir(git_buf_cstr(&cwd_buf)));
- git_buf_free(&cwd_buf);
+ git_buf_dispose(&cwd_buf);
}
#define env_cd_pass(path) env_cd_((path), env_pass_, __FILE__, __LINE__)
#define env_cd_fail(path) env_cd_((path), env_fail_, __FILE__, __LINE__)
@@ -271,7 +271,7 @@ void test_repo_env__open(void)
cl_fixture_cleanup("testrepo.git");
cl_fixture_cleanup("attr");
- git_buf_free(&repo_dir_buf);
+ git_buf_dispose(&repo_dir_buf);
clear_git_env();
}
diff --git a/tests/repo/hashfile.c b/tests/repo/hashfile.c
index ae8e122..3c27aaf 100644
--- a/tests/repo/hashfile.c
+++ b/tests/repo/hashfile.c
@@ -35,7 +35,7 @@ void test_repo_hashfile__simple(void)
cl_git_fail(git_odb_hashfile(&a, full.ptr, GIT_OBJ_ANY));
cl_git_fail(git_repository_hashfile(&b, _repo, full.ptr, GIT_OBJ_OFS_DELTA, NULL));
- git_buf_free(&full);
+ git_buf_dispose(&full);
}
void test_repo_hashfile__filtered(void)
diff --git a/tests/repo/init.c b/tests/repo/init.c
index 0f969eb..2ac09e4 100644
--- a/tests/repo/init.c
+++ b/tests/repo/init.c
@@ -33,11 +33,11 @@ void test_repo_init__cleanup(void)
{
git_libgit2_opts(GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_GLOBAL,
_global_path.ptr);
- git_buf_free(&_global_path);
+ git_buf_dispose(&_global_path);
if (_tmp_path.size > 0 && git_path_isdir(_tmp_path.ptr))
git_futils_rmdir_r(_tmp_path.ptr, NULL, GIT_RMDIR_REMOVE_FILES);
- git_buf_free(&_tmp_path);
+ git_buf_dispose(&_tmp_path);
}
static void cleanup_repository(void *path)
@@ -131,8 +131,8 @@ void test_repo_init__bare_repo_escaping_current_workdir(void)
cl_git_pass(chdir(git_buf_cstr(&path_current_workdir)));
- git_buf_free(&path_current_workdir);
- git_buf_free(&path_repository);
+ git_buf_dispose(&path_current_workdir);
+ git_buf_dispose(&path_repository);
cleanup_repository("a");
}
@@ -193,7 +193,7 @@ void test_repo_init__additional_templates(void)
cl_assert(git_path_isdir(git_buf_cstr(&path)));
/* won't confirm specific contents of hooks dir since it may vary */
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
static void assert_config_entry_on_init_bytype(
@@ -423,7 +423,7 @@ void test_repo_init__relative_gitdir(void)
cl_git_pass(git_futils_readbuffer(&dot_git_content, "root/b/c_wd/.git"));
cl_assert_equal_s("gitdir: ../my_repository/", dot_git_content.ptr);
- git_buf_free(&dot_git_content);
+ git_buf_dispose(&dot_git_content);
cleanup_repository("root");
}
@@ -444,7 +444,7 @@ void test_repo_init__relative_gitdir_2(void)
/* make the directory first, then it should succeed */
cl_git_pass(git_repository_init_ext(&_repo, "root/b/my_repository", &opts));
- git_buf_free(&full_path);
+ git_buf_dispose(&full_path);
cl_assert(!git__suffixcmp(git_repository_workdir(_repo), "root/b/c_wd/"));
cl_assert(!git__suffixcmp(git_repository_path(_repo), "root/b/my_repository/"));
@@ -460,7 +460,7 @@ void test_repo_init__relative_gitdir_2(void)
cl_git_pass(git_futils_readbuffer(&dot_git_content, "root/b/c_wd/.git"));
cl_assert_equal_s("gitdir: ../my_repository/", dot_git_content.ptr);
- git_buf_free(&dot_git_content);
+ git_buf_dispose(&dot_git_content);
cleanup_repository("root");
}
@@ -497,8 +497,8 @@ static void assert_hooks_match(
cl_assert_equal_i_fmt(expected_mode, st.st_mode, "%07o");
}
- git_buf_free(&expected);
- git_buf_free(&actual);
+ git_buf_dispose(&expected);
+ git_buf_dispose(&actual);
}
static void assert_mode_seems_okay(
@@ -510,7 +510,7 @@ static void assert_mode_seems_okay(
cl_git_pass(git_buf_joinpath(&full, base, path));
cl_git_pass(git_path_lstat(full.ptr, &st));
- git_buf_free(&full);
+ git_buf_dispose(&full);
if (!core_filemode) {
CLEAR_FOR_CORE_FILEMODE(expect_mode);
@@ -552,11 +552,11 @@ static const char *template_sandbox(const char *name)
/* create a file starting with a dot */
cl_git_pass(git_buf_joinpath(&dotfile_path, hooks_path.ptr, ".dotfile"));
cl_git_mkfile(dotfile_path.ptr, "something\n");
- git_buf_free(&dotfile_path);
+ git_buf_dispose(&dotfile_path);
- git_buf_free(&dotfile_path);
- git_buf_free(&link_path);
- git_buf_free(&hooks_path);
+ git_buf_dispose(&dotfile_path);
+ git_buf_dispose(&link_path);
+ git_buf_dispose(&hooks_path);
return path;
}
@@ -581,8 +581,8 @@ static void configure_templatedir(const char *template_path)
cl_git_mkfile(config_path.ptr, config_data.ptr);
- git_buf_free(&config_path);
- git_buf_free(&config_data);
+ git_buf_dispose(&config_path);
+ git_buf_dispose(&config_data);
}
static void validate_templates(git_repository *repo, const char *template_path)
@@ -617,10 +617,10 @@ static void validate_templates(git_repository *repo, const char *template_path)
template_path, git_repository_path(repo),
"hooks/.dotfile", filemode);
- git_buf_free(&expected);
- git_buf_free(&actual);
- git_buf_free(&repo_description);
- git_buf_free(&template_description);
+ git_buf_dispose(&expected);
+ git_buf_dispose(&actual);
+ git_buf_dispose(&repo_description);
+ git_buf_dispose(&template_description);
}
void test_repo_init__external_templates_specified_in_options(void)
@@ -666,7 +666,7 @@ void test_repo_init__external_templates_specified_in_config(void)
validate_templates(_repo, "template");
cl_fixture_cleanup("template");
- git_buf_free(&template_path);
+ git_buf_dispose(&template_path);
}
void test_repo_init__external_templates_with_leading_dot(void)
@@ -693,7 +693,7 @@ void test_repo_init__external_templates_with_leading_dot(void)
validate_templates(_repo, ".template_with_leading_dot");
cl_fixture_cleanup(".template_with_leading_dot");
- git_buf_free(&template_path);
+ git_buf_dispose(&template_path);
}
void test_repo_init__extended_with_template_and_shared_mode(void)
@@ -833,6 +833,6 @@ void test_repo_init__at_filesystem_root(void)
cl_assert(git_path_isdir(root.ptr));
cl_git_pass(git_futils_rmdir_r(root.ptr, NULL, GIT_RMDIR_REMOVE_FILES));
- git_buf_free(&root);
+ git_buf_dispose(&root);
git_repository_free(repo);
}
diff --git a/tests/repo/message.c b/tests/repo/message.c
index 8757459..14577c8 100644
--- a/tests/repo/message.c
+++ b/tests/repo/message.c
@@ -31,9 +31,9 @@ void test_repo_message__message(void)
cl_git_pass(git_repository_message(&actual, _repo));
cl_assert_equal_s(expected, git_buf_cstr(&actual));
- git_buf_free(&actual);
+ git_buf_dispose(&actual);
cl_git_pass(p_unlink(git_buf_cstr(&path)));
cl_assert_equal_i(GIT_ENOTFOUND, git_repository_message(&actual, _repo));
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
diff --git a/tests/repo/open.c b/tests/repo/open.c
index ab36dd5..06ec71b 100644
--- a/tests/repo/open.c
+++ b/tests/repo/open.c
@@ -95,7 +95,7 @@ static void make_gitlink_dir(const char *dir, const char *linktext)
cl_git_pass(git_futils_mkdir(dir, 0777, GIT_MKDIR_VERIFY_DIR));
cl_git_pass(git_buf_joinpath(&path, dir, ".git"));
cl_git_rewritefile(path.ptr, linktext);
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
void test_repo_open__gitlinked(void)
@@ -166,9 +166,9 @@ void test_repo_open__from_git_new_workdir(void)
}
}
- git_buf_free(&link_tgt);
- git_buf_free(&link);
- git_buf_free(&body);
+ git_buf_dispose(&link_tgt);
+ git_buf_dispose(&link);
+ git_buf_dispose(&body);
cl_git_pass(git_repository_open(&repo2, "alternate"));
@@ -215,7 +215,7 @@ void test_repo_open__failures(void)
GIT_REPOSITORY_OPEN_NO_SEARCH | GIT_REPOSITORY_OPEN_NO_DOTGIT,
NULL));
- git_buf_free(&ceiling);
+ git_buf_dispose(&ceiling);
}
void test_repo_open__bad_gitlinks(void)
@@ -308,7 +308,7 @@ void test_repo_open__win32_path(void)
cl_assert(git__suffixcmp(git_repository_workdir(repo2), repo_wd) == 0);
git_repository_free(repo2);
- git_buf_free(&winpath);
+ git_buf_dispose(&winpath);
#endif
}
@@ -342,7 +342,7 @@ void test_repo_open__no_config(void)
cl_git_pass(git_libgit2_opts(
GIT_OPT_SET_SEARCH_PATH, GIT_CONFIG_LEVEL_XDG, path.ptr));
- git_buf_free(&path);
+ git_buf_dispose(&path);
cl_git_pass(git_repository_open(&repo, "empty_standard_repo"));
cl_git_pass(git_repository_config(&config, repo));
diff --git a/tests/repo/repo_helpers.c b/tests/repo/repo_helpers.c
index 61f6968..4dc5bfc 100644
--- a/tests/repo/repo_helpers.c
+++ b/tests/repo/repo_helpers.c
@@ -18,5 +18,5 @@ void delete_head(git_repository* repo)
cl_git_pass(git_buf_joinpath(&head_path, git_repository_path(repo), GIT_HEAD_FILE));
cl_git_pass(p_unlink(git_buf_cstr(&head_path)));
- git_buf_free(&head_path);
+ git_buf_dispose(&head_path);
}
diff --git a/tests/repo/reservedname.c b/tests/repo/reservedname.c
index 2a5b382..8e024bc 100644
--- a/tests/repo/reservedname.c
+++ b/tests/repo/reservedname.c
@@ -128,5 +128,5 @@ void test_repo_reservedname__submodule_pointer_during_create(void)
cl_git_pass(git_submodule_update(sm, 1, &update_options));
git_submodule_free(sm);
- git_buf_free(&url);
+ git_buf_dispose(&url);
}
diff --git a/tests/repo/setters.c b/tests/repo/setters.c
index 5a83fdb..ea6ef12 100644
--- a/tests/repo/setters.c
+++ b/tests/repo/setters.c
@@ -56,13 +56,13 @@ void test_repo_setters__setting_a_workdir_creates_a_gitlink(void)
cl_git_pass(git_futils_readbuffer(&content, "./new_workdir/.git"));
cl_assert(git__prefixcmp(git_buf_cstr(&content), "gitdir: ") == 0);
cl_assert(git__suffixcmp(git_buf_cstr(&content), "testrepo.git/") == 0);
- git_buf_free(&content);
+ git_buf_dispose(&content);
cl_git_pass(git_repository_config(&cfg, repo));
cl_git_pass(git_config_get_string_buf(&buf, cfg, "core.worktree"));
cl_assert(git__suffixcmp(git_buf_cstr(&buf), "new_workdir/") == 0);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_config_free(cfg);
}
diff --git a/tests/repo/state.c b/tests/repo/state.c
index 7f20eeb..fb89497 100644
--- a/tests/repo/state.c
+++ b/tests/repo/state.c
@@ -15,7 +15,7 @@ void test_repo_state__initialize(void)
void test_repo_state__cleanup(void)
{
cl_git_sandbox_cleanup();
- git_buf_free(&_path);
+ git_buf_dispose(&_path);
}
static void setup_simple_state(const char *filename)
diff --git a/tests/reset/hard.c b/tests/reset/hard.c
index 69ef41e..c63640e 100644
--- a/tests/reset/hard.c
+++ b/tests/reset/hard.c
@@ -83,8 +83,8 @@ void test_reset_hard__resetting_reverts_modified_files(void)
}
}
- git_buf_free(&content);
- git_buf_free(&path);
+ git_buf_dispose(&content);
+ git_buf_dispose(&path);
}
void test_reset_hard__cannot_reset_in_a_bare_repository(void)
@@ -192,10 +192,10 @@ void test_reset_hard__cleans_up_merge(void)
cl_assert(git_path_exists(git_buf_cstr(&orig_head_path)));
cl_git_pass(p_unlink(git_buf_cstr(&orig_head_path)));
- git_buf_free(&merge_head_path);
- git_buf_free(&merge_msg_path);
- git_buf_free(&merge_mode_path);
- git_buf_free(&orig_head_path);
+ git_buf_dispose(&merge_head_path);
+ git_buf_dispose(&merge_msg_path);
+ git_buf_dispose(&merge_mode_path);
+ git_buf_dispose(&orig_head_path);
}
void test_reset_hard__reflog_is_correct(void)
@@ -223,7 +223,7 @@ void test_reset_hard__reflog_is_correct(void)
reflog_check(repo, "HEAD", 4, NULL, git_buf_cstr(&buf));
reflog_check(repo, "refs/heads/master", 4, NULL, git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
/* Moved branch, expect revspec in message */
exp_msg = "reset: moving to HEAD~^{commit}";
diff --git a/tests/reset/mixed.c b/tests/reset/mixed.c
index 97eac74..9928c68 100644
--- a/tests/reset/mixed.c
+++ b/tests/reset/mixed.c
@@ -73,7 +73,7 @@ void test_reset_mixed__reflog_is_correct(void)
cl_git_pass(git_reset(repo, target, GIT_RESET_MIXED, NULL));
reflog_check(repo, "HEAD", 10, NULL, git_buf_cstr(&buf));
reflog_check(repo, "refs/heads/master", 10, NULL, git_buf_cstr(&buf));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
/* Moved branch, expect revspec in message */
exp_msg = "reset: moving to HEAD~^{commit}";
diff --git a/tests/reset/soft.c b/tests/reset/soft.c
index 506deca..0ad47be 100644
--- a/tests/reset/soft.c
+++ b/tests/reset/soft.c
@@ -127,7 +127,7 @@ void test_reset_soft__fails_when_merging(void)
cl_assert_equal_i(GIT_EUNMERGED, git_reset(repo, target, GIT_RESET_SOFT, NULL));
cl_git_pass(p_unlink(git_buf_cstr(&merge_head_path)));
- git_buf_free(&merge_head_path);
+ git_buf_dispose(&merge_head_path);
}
void test_reset_soft__fails_when_index_contains_conflicts_independently_of_MERGE_HEAD_file_existence(void)
@@ -142,7 +142,7 @@ void test_reset_soft__fails_when_index_contains_conflicts_independently_of_MERGE
cl_git_pass(git_buf_joinpath(&merge_head_path, git_repository_path(repo), "MERGE_HEAD"));
cl_git_pass(p_unlink(git_buf_cstr(&merge_head_path)));
- git_buf_free(&merge_head_path);
+ git_buf_dispose(&merge_head_path);
cl_git_pass(git_repository_index(&index, repo));
cl_assert_equal_i(true, git_index_has_conflicts(index));
diff --git a/tests/revert/workdir.c b/tests/revert/workdir.c
index 802819c..8604735 100644
--- a/tests/revert/workdir.c
+++ b/tests/revert/workdir.c
@@ -126,8 +126,8 @@ void test_revert_workdir__conflicts(void)
git_commit_free(commit);
git_commit_free(head);
git_reference_free(head_ref);
- git_buf_free(&mergemsg_buf);
- git_buf_free(&conflicting_buf);
+ git_buf_dispose(&mergemsg_buf);
+ git_buf_dispose(&conflicting_buf);
}
/* git reset --hard 39467716290f6df775a91cdb9a4eb39295018145
@@ -350,7 +350,7 @@ void test_revert_workdir__again_after_edit_two(void)
git_commit_free(revert_commit);
git_commit_free(head_commit);
git_config_free(config);
- git_buf_free(&diff_buf);
+ git_buf_dispose(&diff_buf);
}
/* git reset --hard 72333f47d4e83616630ff3b0ffe4c0faebcc3c45
diff --git a/tests/stash/apply.c b/tests/stash/apply.c
index f26b73b..986eba0 100644
--- a/tests/stash/apply.c
+++ b/tests/stash/apply.c
@@ -85,7 +85,7 @@ void test_stash_apply__with_default(void)
cl_git_pass(git_futils_readbuffer(&where, "stash/where"));
cl_assert_equal_s("....\n", where.ptr);
- git_buf_free(&where);
+ git_buf_dispose(&where);
}
void test_stash_apply__with_existing_file(void)
@@ -132,7 +132,7 @@ void test_stash_apply__with_reinstate_index(void)
cl_git_pass(git_futils_readbuffer(&where, "stash/where"));
cl_assert_equal_s("....\n", where.ptr);
- git_buf_free(&where);
+ git_buf_dispose(&where);
}
void test_stash_apply__conflict_index_with_default(void)
diff --git a/tests/status/ignore.c b/tests/status/ignore.c
index 824475e..c986a6b 100644
--- a/tests/status/ignore.c
+++ b/tests/status/ignore.c
@@ -601,7 +601,7 @@ void test_status_ignore__filenames_with_special_prefixes_do_not_interfere_with_s
cl_assert(st.status == GIT_STATUS_WT_NEW);
cl_git_sandbox_cleanup();
- git_buf_free(&file);
+ git_buf_dispose(&file);
}
}
diff --git a/tests/status/renames.c b/tests/status/renames.c
index ae32d2e..4459952 100644
--- a/tests/status/renames.c
+++ b/tests/status/renames.c
@@ -35,8 +35,8 @@ static void _rename_helper(
if (extra)
cl_git_append2file(newpath.ptr, extra);
- git_buf_free(&oldpath);
- git_buf_free(&newpath);
+ git_buf_dispose(&oldpath);
+ git_buf_dispose(&newpath);
}
#define rename_file(R,O,N) _rename_helper((R), (O), (N), NULL)
diff --git a/tests/status/worktree.c b/tests/status/worktree.c
index c6b18c1..bb9f8ec 100644
--- a/tests/status/worktree.c
+++ b/tests/status/worktree.c
@@ -127,7 +127,7 @@ void test_status_worktree__purged_worktree(void)
/* first purge the contents of the worktree */
cl_git_pass(git_buf_sets(&workdir, git_repository_workdir(repo)));
cl_git_pass(git_path_direach(&workdir, 0, remove_file_cb, NULL));
- git_buf_free(&workdir);
+ git_buf_dispose(&workdir);
/* now get status */
memset(&counts, 0x0, sizeof(status_entry_counts));
@@ -378,7 +378,7 @@ void test_status_worktree__issue_592(void)
cl_git_pass(git_status_foreach(repo, cb_status__check_592, "l.txt"));
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
void test_status_worktree__issue_592_2(void)
@@ -393,7 +393,7 @@ void test_status_worktree__issue_592_2(void)
cl_git_pass(git_status_foreach(repo, cb_status__check_592, "c/a.txt"));
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
void test_status_worktree__issue_592_3(void)
@@ -409,7 +409,7 @@ void test_status_worktree__issue_592_3(void)
cl_git_pass(git_status_foreach(repo, cb_status__check_592, "c/a.txt"));
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
void test_status_worktree__issue_592_4(void)
@@ -424,7 +424,7 @@ void test_status_worktree__issue_592_4(void)
cl_git_pass(git_status_foreach(repo, cb_status__check_592, "t/b.txt"));
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
void test_status_worktree__issue_592_5(void)
@@ -440,7 +440,7 @@ void test_status_worktree__issue_592_5(void)
cl_git_pass(git_status_foreach(repo, cb_status__check_592, NULL));
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
void test_status_worktree__issue_592_ignores_0(void)
@@ -782,8 +782,8 @@ static void assert_ignore_case(
cl_assert_equal_i(expected_camel_cased_file_status, status);
git_repository_free(repo2);
- git_buf_free(&lower_case_path);
- git_buf_free(&camel_case_path);
+ git_buf_dispose(&lower_case_path);
+ git_buf_dispose(&camel_case_path);
}
void test_status_worktree__file_status_honors_core_ignorecase_true(void)
diff --git a/tests/stress/diff.c b/tests/stress/diff.c
index a3ba4fa..2ea0d40 100644
--- a/tests/stress/diff.c
+++ b/tests/stress/diff.c
@@ -108,7 +108,7 @@ void test_stress_diff__rename_big_files(void)
cl_git_pass(git_index_add_bypath(index, tmp + strlen("renames/")));
}
- git_buf_free(&b);
+ git_buf_dispose(&b);
git_index_free(index);
test_with_many(100);
@@ -133,7 +133,7 @@ void test_stress_diff__rename_many_files(void)
b.ptr[8] = '\n';
cl_git_mkfile(tmp, b.ptr);
}
- git_buf_free(&b);
+ git_buf_dispose(&b);
for (i = 0; i < 2500; i += 1) {
p_snprintf(tmp, sizeof(tmp), "renames/newfile%03d", i);
diff --git a/tests/submodule/add.c b/tests/submodule/add.c
index ebb9d62..d588677 100644
--- a/tests/submodule/add.c
+++ b/tests/submodule/add.c
@@ -22,7 +22,7 @@ static void assert_submodule_url(const char* name, const char *url)
cl_git_pass(git_buf_printf(&key, "submodule.%s.url", name));
assert_config_entry_value(g_repo, git_buf_cstr(&key), url);
- git_buf_free(&key);
+ git_buf_dispose(&key);
}
void test_submodule_add__url_absolute(void)
@@ -62,7 +62,7 @@ void test_submodule_add__url_absolute(void)
cl_assert_equal_s("gitdir: ../.git/modules/sm_libgit2/", dot_git_content.ptr);
git_repository_free(repo);
- git_buf_free(&dot_git_content);
+ git_buf_dispose(&dot_git_content);
/* add a submodule not using a gitlink */
@@ -163,7 +163,7 @@ void test_submodule_add__path_exists_in_index(void)
cl_git_fail_with(git_submodule_add_setup(&sm, g_repo, "./", "subdirectory", 1), GIT_EEXISTS);
git_submodule_free(sm);
- git_buf_free(&filename);
+ git_buf_dispose(&filename);
}
void test_submodule_add__file_exists_in_index(void)
@@ -181,5 +181,5 @@ void test_submodule_add__file_exists_in_index(void)
cl_git_fail_with(git_submodule_add_setup(&sm, g_repo, "./", "subdirectory", 1), GIT_EEXISTS);
git_submodule_free(sm);
- git_buf_free(&name);
+ git_buf_dispose(&name);
}
diff --git a/tests/submodule/escape.c b/tests/submodule/escape.c
index f5c3cd4..c368742 100644
--- a/tests/submodule/escape.c
+++ b/tests/submodule/escape.c
@@ -43,7 +43,7 @@ void test_submodule_escape__from_gitdir(void)
"[submodule \"" EVIL_SM_NAME "\"]\n"
" path = testrepo\n"
" url = ../testrepo.git\n");
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
/* Find it all the different ways we know about it */
foundit = 0;
@@ -77,7 +77,7 @@ void test_submodule_escape__from_gitdir_windows(void)
"[submodule \"" EVIL_SM_NAME_WINDOWS "\"]\n"
" path = testrepo\n"
" url = ../testrepo.git\n");
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
/* Find it all the different ways we know about it */
foundit = 0;
diff --git a/tests/submodule/init.c b/tests/submodule/init.c
index 9e0cf57..b84adf5 100644
--- a/tests/submodule/init.c
+++ b/tests/submodule/init.c
@@ -39,7 +39,7 @@ void test_submodule_init__absolute_url(void)
cl_git_pass(git_config_get_string(&config_url, cfg, "submodule.testrepo.url"));
cl_assert_equal_s(absolute_url.ptr, config_url);
- git_buf_free(&absolute_url);
+ git_buf_dispose(&absolute_url);
git_config_free(cfg);
git_submodule_free(sm);
}
@@ -69,7 +69,7 @@ void test_submodule_init__relative_url(void)
cl_git_pass(git_config_get_string(&config_url, cfg, "submodule.testrepo.url"));
cl_assert_equal_s(absolute_url.ptr, config_url);
- git_buf_free(&absolute_url);
+ git_buf_dispose(&absolute_url);
git_config_free(cfg);
git_submodule_free(sm);
}
@@ -107,7 +107,7 @@ void test_submodule_init__relative_url_detached_head(void)
cl_git_pass(git_config_get_string(&config_url, cfg, "submodule.testrepo.url"));
cl_assert_equal_s(absolute_url.ptr, config_url);
- git_buf_free(&absolute_url);
+ git_buf_dispose(&absolute_url);
git_config_free(cfg);
git_object_free(head_commit);
git_reference_free(head_ref);
diff --git a/tests/submodule/lookup.c b/tests/submodule/lookup.c
index f73ca26..8bab1b9 100644
--- a/tests/submodule/lookup.c
+++ b/tests/submodule/lookup.c
@@ -195,7 +195,7 @@ void test_submodule_lookup__backslashes(void)
cl_git_pass(git_submodule_resolve_url(&buf, g_repo, backslashed_path));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_submodule_free(sm);
git_repository_free(subrepo);
}
@@ -227,7 +227,7 @@ static void add_submodule_with_commit(const char *name)
cl_git_pass(git_buf_joinpath(&p, git_repository_workdir(smrepo), "file"));
cl_git_mkfile(p.ptr, "new file");
- git_buf_free(&p);
+ git_buf_dispose(&p);
cl_git_pass(git_index_add_bypath(idx, "file"));
cl_git_pass(git_index_write(idx));
@@ -293,7 +293,7 @@ void test_submodule_lookup__just_added(void)
baseline_tests();
cl_git_rewritefile("submod2/.gitmodules", snap2.ptr);
- git_buf_free(&snap2);
+ git_buf_dispose(&snap2);
refute_submodule_exists(g_repo, "mismatch_name", GIT_ENOTFOUND);
refute_submodule_exists(g_repo, "mismatch_path", GIT_ENOTFOUND);
@@ -304,7 +304,7 @@ void test_submodule_lookup__just_added(void)
baseline_tests();
cl_git_rewritefile("submod2/.gitmodules", snap1.ptr);
- git_buf_free(&snap1);
+ git_buf_dispose(&snap1);
refute_submodule_exists(g_repo, "mismatch_name", GIT_ENOTFOUND);
refute_submodule_exists(g_repo, "mismatch_path", GIT_ENOTFOUND);
diff --git a/tests/submodule/nosubs.c b/tests/submodule/nosubs.c
index 8a73dc1..ca2d1d6 100644
--- a/tests/submodule/nosubs.c
+++ b/tests/submodule/nosubs.c
@@ -85,7 +85,7 @@ void test_submodule_nosubs__add_and_delete(void)
cl_git_pass(git_futils_readbuffer(&buf, "status/.gitmodules"));
cl_assert(strstr(buf.ptr, "[submodule \"submodules/libgit2\"]") != NULL);
cl_assert(strstr(buf.ptr, "path = submodules/libgit2") != NULL);
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
/* lookup */
diff --git a/tests/submodule/open.c b/tests/submodule/open.c
index 0ef01ec..a8a5dcc 100644
--- a/tests/submodule/open.c
+++ b/tests/submodule/open.c
@@ -48,8 +48,8 @@ static void assert_sm_valid(git_repository *parent, git_repository *child, const
cl_git_pass(git_path_prettify_dir(&actual, actual.ptr, NULL));
cl_assert_equal_s(expected.ptr, actual.ptr);
- git_buf_free(&expected);
- git_buf_free(&actual);
+ git_buf_dispose(&expected);
+ git_buf_dispose(&actual);
}
void test_submodule_open__opening_via_lookup_succeeds(void)
@@ -67,7 +67,7 @@ void test_submodule_open__direct_open_succeeds(void)
cl_git_pass(git_repository_open(&g_child, path.ptr));
assert_sm_valid(g_parent, g_child, "sm_unchanged");
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
void test_submodule_open__direct_open_succeeds_for_broken_sm_with_gitdir(void)
@@ -86,5 +86,5 @@ void test_submodule_open__direct_open_succeeds_for_broken_sm_with_gitdir(void)
cl_git_pass(git_repository_open(&g_child, path.ptr));
assert_sm_valid(g_parent, g_child, "sm_unchanged");
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
diff --git a/tests/submodule/repository_init.c b/tests/submodule/repository_init.c
index 9be1e0b..7dd97ba 100644
--- a/tests/submodule/repository_init.c
+++ b/tests/submodule/repository_init.c
@@ -34,5 +34,5 @@ void test_submodule_repository_init__basic(void)
git_submodule_free(sm);
git_repository_free(repo);
- git_buf_free(&dot_git_content);
+ git_buf_dispose(&dot_git_content);
}
diff --git a/tests/submodule/status.c b/tests/submodule/status.c
index 10f385c..41fc173 100644
--- a/tests/submodule/status.c
+++ b/tests/submodule/status.c
@@ -34,7 +34,7 @@ static void rm_submodule(const char *name)
git_buf path = GIT_BUF_INIT;
cl_git_pass(git_buf_joinpath(&path, git_repository_workdir(g_repo), name));
cl_git_pass(git_futils_rmdir_r(path.ptr, NULL, GIT_RMDIR_REMOVE_FILES));
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
static void add_submodule_to_index(const char *name)
diff --git a/tests/submodule/submodule_helpers.c b/tests/submodule/submodule_helpers.c
index cd541ea..4bb0648 100644
--- a/tests/submodule/submodule_helpers.c
+++ b/tests/submodule/submodule_helpers.c
@@ -79,9 +79,9 @@ void rewrite_gitmodules(const char *workdir)
cl_must_pass(p_unlink(in_f.ptr));
- git_buf_free(&in_f);
- git_buf_free(&out_f);
- git_buf_free(&path);
+ git_buf_dispose(&in_f);
+ git_buf_dispose(&out_f);
+ git_buf_dispose(&path);
}
static void cleanup_fixture_submodules(void *payload)
diff --git a/tests/win32/longpath.c b/tests/win32/longpath.c
index 5a36875..f5a9534 100644
--- a/tests/win32/longpath.c
+++ b/tests/win32/longpath.c
@@ -28,7 +28,7 @@ void test_win32_longpath__initialize(void)
void test_win32_longpath__cleanup(void)
{
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
#ifdef GIT_WIN32
diff --git a/tests/worktree/merge.c b/tests/worktree/merge.c
index 36cc2a6..4b74382 100644
--- a/tests/worktree/merge.c
+++ b/tests/worktree/merge.c
@@ -76,7 +76,7 @@ void test_worktree_merge__merge_setup(void)
cl_assert(git_path_exists(path.ptr));
}
- git_buf_free(&path);
+ git_buf_dispose(&path);
git_reference_free(ours_ref);
git_reference_free(theirs_ref);
git_annotated_commit_free(ours);
@@ -115,7 +115,7 @@ void test_worktree_merge__merge_conflict(void)
cl_git_pass(git_futils_readbuffer(&buf, path.ptr));
cl_assert_equal_s(buf.ptr, CONFLICT_BRANCH_FILE_TXT);
- git_buf_free(&path);
- git_buf_free(&buf);
+ git_buf_dispose(&path);
+ git_buf_dispose(&buf);
}
diff --git a/tests/worktree/open.c b/tests/worktree/open.c
index 74b9007..8ea43b2 100644
--- a/tests/worktree/open.c
+++ b/tests/worktree/open.c
@@ -32,7 +32,7 @@ static void assert_worktree_valid(git_repository *wt, const char *parentdir, con
cl_git_pass(git_path_to_dir(&path));
cl_assert_equal_s(wt->gitdir, path.ptr);
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
void test_worktree_open__initialize(void)
@@ -82,7 +82,7 @@ void test_worktree_open__repository_through_gitdir(void)
cl_git_pass(git_repository_open(&wt, gitdir_path.ptr));
assert_worktree_valid(wt, COMMON_REPO, WORKTREE_REPO);
- git_buf_free(&gitdir_path);
+ git_buf_dispose(&gitdir_path);
git_repository_free(wt);
}
@@ -97,7 +97,7 @@ void test_worktree_open__open_discovered_worktree(void)
cl_assert_equal_s(git_repository_workdir(fixture.worktree),
git_repository_workdir(repo));
- git_buf_free(&path);
+ git_buf_dispose(&path);
git_repository_free(repo);
}
diff --git a/tests/worktree/refs.c b/tests/worktree/refs.c
index ea36e80..e62149d 100644
--- a/tests/worktree/refs.c
+++ b/tests/worktree/refs.c
@@ -191,5 +191,5 @@ void test_worktree_refs__creating_refs_uses_commondir(void)
git_reference_free(branch);
git_reference_free(head);
git_commit_free(commit);
- git_buf_free(&refpath);
+ git_buf_dispose(&refpath);
}
diff --git a/tests/worktree/submodule.c b/tests/worktree/submodule.c
index 2943852..2e62c03 100644
--- a/tests/worktree/submodule.c
+++ b/tests/worktree/submodule.c
@@ -55,7 +55,7 @@ void test_worktree_submodule__open_discovered_submodule_worktree(void)
cl_assert_equal_s(git_repository_workdir(child.worktree),
git_repository_workdir(repo));
- git_buf_free(&path);
+ git_buf_dispose(&path);
git_repository_free(repo);
}
@@ -86,7 +86,7 @@ void test_worktree_submodule__resolve_relative_url(void)
git_worktree_free(wt);
git_repository_free(repo);
- git_buf_free(&wt_path);
- git_buf_free(&sm_relative_path);
- git_buf_free(&wt_relative_path);
+ git_buf_dispose(&wt_path);
+ git_buf_dispose(&sm_relative_path);
+ git_buf_dispose(&wt_relative_path);
}
diff --git a/tests/worktree/worktree.c b/tests/worktree/worktree.c
index cbdd084..83be097 100644
--- a/tests/worktree/worktree.c
+++ b/tests/worktree/worktree.c
@@ -70,7 +70,7 @@ void test_worktree_worktree__list_with_invalid_worktree_dirs(void)
}
}
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
void test_worktree_worktree__list_in_worktree_repo(void)
@@ -123,7 +123,7 @@ void test_worktree_worktree__lookup(void)
cl_assert_equal_s(wt->commondir_path, fixture.repo->gitdir);
cl_assert_equal_s(wt->commondir_path, fixture.repo->commondir);
- git_buf_free(&gitdir_path);
+ git_buf_dispose(&gitdir_path);
git_worktree_free(wt);
}
@@ -165,8 +165,8 @@ void test_worktree_worktree__open_invalid_commondir(void)
cl_git_pass(git_worktree_lookup(&wt, fixture.repo, "testrepo-worktree"));
cl_git_fail(git_repository_open_from_worktree(&repo, wt));
- git_buf_free(&buf);
- git_buf_free(&path);
+ git_buf_dispose(&buf);
+ git_buf_dispose(&path);
git_worktree_free(wt);
}
@@ -185,8 +185,8 @@ void test_worktree_worktree__open_invalid_gitdir(void)
cl_git_pass(git_worktree_lookup(&wt, fixture.repo, "testrepo-worktree"));
cl_git_fail(git_repository_open_from_worktree(&repo, wt));
- git_buf_free(&buf);
- git_buf_free(&path);
+ git_buf_dispose(&buf);
+ git_buf_dispose(&path);
git_worktree_free(wt);
}
@@ -203,7 +203,7 @@ void test_worktree_worktree__open_invalid_parent(void)
cl_git_pass(git_worktree_lookup(&wt, fixture.repo, "testrepo-worktree"));
cl_git_fail(git_repository_open_from_worktree(&repo, wt));
- git_buf_free(&buf);
+ git_buf_dispose(&buf);
git_worktree_free(wt);
}
@@ -222,7 +222,7 @@ void test_worktree_worktree__init(void)
cl_assert(git__suffixcmp(git_repository_workdir(repo), "worktree-new/") == 0);
cl_git_pass(git_branch_lookup(&branch, repo, "worktree-new", GIT_BRANCH_LOCAL));
- git_buf_free(&path);
+ git_buf_dispose(&path);
git_worktree_free(wt);
git_reference_free(branch);
git_repository_free(repo);
@@ -267,7 +267,7 @@ void test_worktree_worktree__add_locked(void)
cl_assert(git__suffixcmp(git_repository_workdir(repo), "worktree-locked/") == 0);
cl_git_pass(git_branch_lookup(&branch, repo, "worktree-locked", GIT_BRANCH_LOCAL));
- git_buf_free(&path);
+ git_buf_dispose(&path);
git_worktree_free(wt);
git_reference_free(branch);
git_repository_free(repo);
@@ -287,7 +287,7 @@ void test_worktree_worktree__init_existing_branch(void)
cl_git_pass(git_buf_joinpath(&path, fixture.repo->workdir, "../worktree-new"));
cl_git_fail(git_worktree_add(&wt, fixture.repo, "worktree-new", path.ptr, NULL));
- git_buf_free(&path);
+ git_buf_dispose(&path);
git_commit_free(commit);
git_reference_free(head);
git_reference_free(branch);
@@ -314,7 +314,7 @@ void test_worktree_worktree__add_with_explicit_branch(void)
cl_git_pass(git_repository_head(&wthead, wtrepo));
cl_assert_equal_s(git_reference_name(wthead), "refs/heads/worktree-with-ref");
- git_buf_free(&path);
+ git_buf_dispose(&path);
git_commit_free(commit);
git_reference_free(head);
git_reference_free(branch);
@@ -335,7 +335,7 @@ void test_worktree_worktree__init_existing_worktree(void)
cl_git_pass(git_worktree_lookup(&wt, fixture.repo, "testrepo-worktree"));
cl_assert_equal_s(wt->gitlink_path, fixture.worktree->gitlink);
- git_buf_free(&path);
+ git_buf_dispose(&path);
git_worktree_free(wt);
}
@@ -364,7 +364,7 @@ void test_worktree_worktree__init_existing_path(void)
cl_assert(!git_path_exists(path.ptr));
}
- git_buf_free(&path);
+ git_buf_dispose(&path);
}
void test_worktree_worktree__init_submodule(void)
@@ -390,7 +390,7 @@ void test_worktree_worktree__init_submodule(void)
cl_git_pass(git_buf_joinpath(&path, sm->gitdir, "worktrees/repo-worktree/"));
cl_assert_equal_s(path.ptr, wt->gitdir);
- git_buf_free(&path);
+ git_buf_dispose(&path);
git_worktree_free(worktree);
git_repository_free(sm);
git_repository_free(wt);
@@ -424,8 +424,8 @@ void test_worktree_worktree__path(void)
cl_git_pass(git_buf_joinpath(&expected_path, clar_sandbox_path(), "testrepo-worktree"));
cl_git_pass(git_worktree_lookup(&wt, fixture.repo, "testrepo-worktree"));
cl_assert_equal_s(git_worktree_path(wt), expected_path.ptr);
-
- git_buf_free(&expected_path);
+
+ git_buf_dispose(&expected_path);
git_worktree_free(wt);
}
@@ -482,7 +482,7 @@ void test_worktree_worktree__lock_with_reason(void)
cl_assert_equal_s(reason.ptr, "because");
cl_assert(wt->locked);
- git_buf_free(&reason);
+ git_buf_dispose(&reason);
git_worktree_free(wt);
}
@@ -499,7 +499,7 @@ void test_worktree_worktree__lock_without_reason(void)
cl_assert_equal_i(reason.size, 0);
cl_assert(wt->locked);
- git_buf_free(&reason);
+ git_buf_dispose(&reason);
git_worktree_free(wt);
}