type-git 0.7.0 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1153,6 +1153,103 @@ function parseBooleanCallback(parser, value, previous, source = "modern", binary
1153
1153
  return Object.hasOwn(profile.names, name) ? { valid: true, value: profile.names[name] } : { valid: false };
1154
1154
  }
1155
1155
 
1156
+ // src/constraints/log-line-range.ts
1157
+ var WHITE = " \n\v\f\r";
1158
+ var LONG_MAX = 9223372036854775807n;
1159
+ function strtol(text, start) {
1160
+ let index = start;
1161
+ while (index < text.length && WHITE.includes(text[index])) {
1162
+ index++;
1163
+ }
1164
+ let negative = false;
1165
+ if (text[index] === "+" || text[index] === "-") {
1166
+ negative = text[index] === "-";
1167
+ index++;
1168
+ }
1169
+ const digits = index;
1170
+ let nonzero = false;
1171
+ while (index < text.length && text[index] >= "0" && text[index] <= "9") {
1172
+ nonzero ||= text[index] !== "0";
1173
+ index++;
1174
+ }
1175
+ if (index === digits) {
1176
+ return void 0;
1177
+ }
1178
+ const saturated = !negative && BigInt(text.slice(digits, index)) >= LONG_MAX;
1179
+ return { end: index, positive: nonzero && !negative, saturated };
1180
+ }
1181
+ function scanLocation(text, start, first) {
1182
+ if (strtol(text, start)) {
1183
+ return strtol(text, start).end;
1184
+ }
1185
+ let spec = start;
1186
+ if (first && text[spec] === "^") {
1187
+ spec++;
1188
+ }
1189
+ if (text[spec] !== "/") {
1190
+ return spec;
1191
+ }
1192
+ let term = spec + 1;
1193
+ while (term < text.length && text[term] !== "/") {
1194
+ if (text[term] === "\\") {
1195
+ term++;
1196
+ if (term >= text.length) {
1197
+ return void 0;
1198
+ }
1199
+ }
1200
+ term++;
1201
+ }
1202
+ return text[term] === "/" ? term + 1 : spec;
1203
+ }
1204
+ function skipRange(text) {
1205
+ if (text[0] === ":" || text[0] === "^" && text[1] === ":") {
1206
+ const colon = text[0] === "^" ? 1 : 0;
1207
+ let term = colon + 1;
1208
+ while (term < text.length && text[term] !== ":") {
1209
+ if (text[term] === "\\" && term + 1 < text.length) {
1210
+ term++;
1211
+ }
1212
+ term++;
1213
+ }
1214
+ return term === colon + 1 ? null : term;
1215
+ }
1216
+ const first = scanLocation(text, 0, true);
1217
+ if (first === void 0 || text[first] !== ",") {
1218
+ return first;
1219
+ }
1220
+ return scanLocation(text, first + 1, false);
1221
+ }
1222
+ function validNumbers(range) {
1223
+ if (range.startsWith(":") || range.startsWith("^:")) {
1224
+ return true;
1225
+ }
1226
+ const first = strtol(range, 0);
1227
+ if (first && !first.positive) {
1228
+ return false;
1229
+ }
1230
+ const comma = first ? first.end : _nullishCoalesce(scanLocation(range, 0, true), () => ( range.length));
1231
+ if (range[comma] !== ",") {
1232
+ return true;
1233
+ }
1234
+ const second = range.slice(comma + 1);
1235
+ if ((second.startsWith("+") || second.startsWith("-")) && !_optionalChain([first, 'optionalAccess', _27 => _27.saturated])) {
1236
+ const length = strtol(second, 1);
1237
+ return !length || /[1-9]/.test(second.slice(1, length.end));
1238
+ }
1239
+ const end = strtol(second, 0);
1240
+ return !end || end.positive;
1241
+ }
1242
+ function validLogLineRange(value) {
1243
+ if (typeof value !== "string") {
1244
+ return false;
1245
+ }
1246
+ const name = skipRange(value);
1247
+ if (name === null || name === void 0 || value[name] !== ":" || name + 1 >= value.length) {
1248
+ return false;
1249
+ }
1250
+ return validNumbers(value.slice(0, name));
1251
+ }
1252
+
1156
1253
  // src/constraints/string-callbacks.generated.ts
1157
1254
  var STRING_CALLBACKS = {
1158
1255
  "anonymize-map": {
@@ -1265,6 +1362,38 @@ var STRING_CALLBACKS = {
1265
1362
  allowBare: true,
1266
1363
  exact: ["changes", "lines", "files", "noncumulative", "cumulative"],
1267
1364
  source: "Git 2.25.1/2.55.0 diff.c:parse_dirstat_params/parse_dirstat_opt/diff_opt_dirstat; whole empty text/bare defaults accepted, nonempty comma fields must be exact words or ASCII digit-first decimal with at most one dot (trailing dot accepted). No trimming or range clamp. Invalid fields accumulate errors and cannot be repaired by later words; native fatal128. Keep raw argv and native cutoff arithmetic/rendering."
1365
+ },
1366
+ "commit-fixup": {
1367
+ kind: "alpha-prefix",
1368
+ separator: ":",
1369
+ allowed: ["amend", "reword"],
1370
+ source: "builtin/commit.c:parse_and_validate_options; a nonempty run of ASCII letters (git-compat-util/sane-ctype isalpha, which ignores the locale) directly followed by ':' names a suboption, which must be amend or reword; any other value is a commit name"
1371
+ },
1372
+ "rebase-apply-context": {
1373
+ kind: "character-set",
1374
+ characters: "0123456789",
1375
+ source: "Git 2.55.0 builtin/rebase.c:cmd_rebase; every character after -C must be a decimal digit, and an empty value is accepted."
1376
+ },
1377
+ "rebase-whitespace": {
1378
+ kind: "choice",
1379
+ exact: ["nowarn", "warn", "error", "error-all", "fix", "strip"],
1380
+ prefixes: [],
1381
+ allowEmpty: true,
1382
+ source: "Git 2.55.0 builtin/rebase.c:cmd_rebase; --whitespace=fix and strip are matched first, then any nonempty value other than warn, nowarn, error and error-all is refused. An empty value passes cmd_rebase; git apply refuses it only when there are patches to apply."
1383
+ },
1384
+ "rebase-trailer": {
1385
+ kind: "text",
1386
+ blank: "",
1387
+ forbiddenFirst: "=",
1388
+ forbidden: "",
1389
+ source: "Git 2.55.0 trailer.c:validate_trailer_args/find_separator; an empty trailer and one whose first character is '=' are always refused. Other separators come from trailer.separators (default ':') and remain native."
1390
+ },
1391
+ "rebase-exec": {
1392
+ kind: "text",
1393
+ blank: " \r\f\v",
1394
+ forbiddenFirst: "",
1395
+ forbidden: "\n",
1396
+ source: "Git 2.55.0 builtin/rebase.c:check_exec_cmd; a command must not contain a newline and must not consist only of spaces, tabs, carriage returns, form feeds and vertical tabs."
1268
1397
  }
1269
1398
  };
1270
1399
 
@@ -1335,7 +1464,7 @@ function parseStringCallback(parser, value) {
1335
1464
  invalid = true;
1336
1465
  }
1337
1466
  }
1338
- return { valid: !invalid && !(ordinary && exclusive), value };
1467
+ return { valid: !(invalid || ordinary && exclusive), value };
1339
1468
  }
1340
1469
  if (profile.kind === "character-set") {
1341
1470
  return {
@@ -1368,9 +1497,21 @@ function parseStringCallback(parser, value) {
1368
1497
  if (profile.kind === "byte-character") {
1369
1498
  return { valid: value === "" || value.length === 1 && value.charCodeAt(0) < 128, value };
1370
1499
  }
1500
+ if (profile.kind === "alpha-prefix") {
1501
+ const name = _optionalChain([/^[A-Za-z]+/, 'access', _28 => _28.exec, 'call', _29 => _29(value), 'optionalAccess', _30 => _30[0]]);
1502
+ const named = name !== void 0 && value[name.length] === profile.separator;
1503
+ return { valid: !named || profile.allowed.includes(name), value };
1504
+ }
1371
1505
  if (profile.kind === "choice") {
1372
1506
  return {
1373
- valid: profile.exact.includes(value) || profile.prefixes.some((prefix) => value.startsWith(prefix)),
1507
+ valid: profile.exact.includes(value) || profile.prefixes.some((prefix) => value.startsWith(prefix)) || value === "" && "allowEmpty" in profile && profile.allowEmpty === true,
1508
+ value
1509
+ };
1510
+ }
1511
+ if (profile.kind === "text") {
1512
+ const first = value[0];
1513
+ return {
1514
+ valid: [...value].some((character) => !profile.blank.includes(character)) && !(first !== void 0 && profile.forbiddenFirst.includes(first)) && ![...value].some((character) => profile.forbidden.includes(character)),
1374
1515
  value
1375
1516
  };
1376
1517
  }
@@ -1412,6 +1553,315 @@ function nativeSizeTBits(architecture) {
1412
1553
  return ["ia32", "arm", "mips", "mipsel", "ppc", "s390"].includes(architecture) ? 32 : 64;
1413
1554
  }
1414
1555
 
1556
+ // src/constraints/commit-ident.ts
1557
+ var GIT_SPACE = /[ \t\n\r]+$/;
1558
+ function crud(code) {
1559
+ return code <= 32 || code === 44 || code === 58 || code === 59 || code === 60 || code === 62 || code === 34 || code === 92 || code === 39;
1560
+ }
1561
+ function validCommitAuthor(value) {
1562
+ if (typeof value !== "string") {
1563
+ return false;
1564
+ }
1565
+ if (!value.includes(">")) {
1566
+ return true;
1567
+ }
1568
+ const open = value.indexOf("<");
1569
+ if (open < 0 || value.indexOf(">", open + 1) < 0) {
1570
+ return false;
1571
+ }
1572
+ const name = value.slice(0, open).replace(GIT_SPACE, "");
1573
+ return [...name].some((character) => !crud(character.charCodeAt(0)));
1574
+ }
1575
+ var DIGIT = /[0-9]/;
1576
+ var ASCII_WORDS = /[A-Za-z]+/g;
1577
+ var MONTHS = [
1578
+ "january",
1579
+ "february",
1580
+ "march",
1581
+ "april",
1582
+ "may",
1583
+ "june",
1584
+ "july",
1585
+ "august",
1586
+ "september",
1587
+ "october",
1588
+ "november",
1589
+ "december"
1590
+ ];
1591
+ var NUMBERS = /* @__PURE__ */ new Set([
1592
+ "one",
1593
+ "two",
1594
+ "three",
1595
+ "four",
1596
+ "five",
1597
+ "six",
1598
+ "seven",
1599
+ "eight",
1600
+ "nine",
1601
+ "ten",
1602
+ "last"
1603
+ ]);
1604
+ var WORDS = /* @__PURE__ */ new Set([
1605
+ ...NUMBERS,
1606
+ "yesterday",
1607
+ "noon",
1608
+ "midnight",
1609
+ "tea",
1610
+ "pm",
1611
+ "am",
1612
+ "now",
1613
+ "today"
1614
+ ]);
1615
+ function validCommitDate(value) {
1616
+ if (typeof value !== "string") {
1617
+ return false;
1618
+ }
1619
+ if (DIGIT.test(value)) {
1620
+ return true;
1621
+ }
1622
+ const words = (_nullishCoalesce(value.match(ASCII_WORDS), () => ( []))).map((word) => word.toLowerCase());
1623
+ const touches = (lower) => WORDS.has(lower) || lower.length >= 3 && MONTHS.some((month) => month.startsWith(lower));
1624
+ const never = words.lastIndexOf("never");
1625
+ return never < 0 ? words.some(touches) : words.slice(never + 1).some(touches);
1626
+ }
1627
+
1628
+ // src/constraints/refname.ts
1629
+ function forbiddenRefnameByte(code) {
1630
+ return code < 32 || code === 32 || code === 127 || code === 42 || code === 58 || code === 63 || code === 91 || code === 92 || code === 94 || code === 126;
1631
+ }
1632
+ function validRefnameFormat(refname, allowOnelevel = false, pattern = false) {
1633
+ if (refname === "@" || refname.includes("\0")) {
1634
+ return false;
1635
+ }
1636
+ let allowStar = pattern;
1637
+ const components = refname.split("/");
1638
+ if (components.length < 2 && !allowOnelevel) {
1639
+ return false;
1640
+ }
1641
+ for (const component of components) {
1642
+ if (component === "" || component.startsWith(".") || component.endsWith(".lock") || component.includes("..") || component.includes("@{")) {
1643
+ return false;
1644
+ }
1645
+ for (let index = 0; index < component.length; index += 1) {
1646
+ const code = component.charCodeAt(index);
1647
+ if (code === 42 && allowStar) {
1648
+ allowStar = false;
1649
+ } else if (forbiddenRefnameByte(code)) {
1650
+ return false;
1651
+ }
1652
+ }
1653
+ }
1654
+ return !refname.endsWith(".");
1655
+ }
1656
+ var NTH_PRIOR = /^@\{-[ \t\n\v\f\r]*\+?0*[1-9][0-9]*\}/;
1657
+ var BRANCH_MARK = /@\{(?:upstream|u|push)\}/gi;
1658
+ function branchNameSyntax(name) {
1659
+ if (name.startsWith("-")) {
1660
+ return false;
1661
+ }
1662
+ if (name.includes("@{")) {
1663
+ let end = _nullishCoalesce(_optionalChain([NTH_PRIOR, 'access', _31 => _31.exec, 'call', _32 => _32(name), 'optionalAccess', _33 => _33[0], 'access', _34 => _34.length]), () => ( 0));
1664
+ for (const mark of name.matchAll(BRANCH_MARK)) {
1665
+ end = Math.max(end, mark.index + mark[0].length);
1666
+ }
1667
+ if (end > 0) {
1668
+ return !name.includes(":") && validRefnameFormat(`refs/heads/x${name.slice(end)}`) ? "repository" : false;
1669
+ }
1670
+ }
1671
+ return name !== "HEAD" && validRefnameFormat(`refs/heads/${name}`);
1672
+ }
1673
+ function validNewBranchName(value) {
1674
+ return typeof value === "string" && branchNameSyntax(value) !== false;
1675
+ }
1676
+
1677
+ // src/constraints/push-refspecs.ts
1678
+ var FULL_OBJECT_NAME = /^(?:[0-9a-f]{40}|[0-9a-f]{64})$/i;
1679
+ function validRefspec(refspec, fetch) {
1680
+ let lhs = refspec;
1681
+ let negative = false;
1682
+ if (lhs.startsWith("+")) {
1683
+ lhs = lhs.slice(1);
1684
+ } else if (lhs.startsWith("^")) {
1685
+ negative = true;
1686
+ lhs = lhs.slice(1);
1687
+ }
1688
+ const colon = lhs.lastIndexOf(":");
1689
+ if (negative && colon >= 0) {
1690
+ return false;
1691
+ }
1692
+ if (!fetch && lhs === ":") {
1693
+ return true;
1694
+ }
1695
+ const dst = colon >= 0 ? lhs.slice(colon + 1) : void 0;
1696
+ const left = colon >= 0 ? lhs.slice(0, colon) : lhs;
1697
+ let glob = dst !== void 0 && dst.includes("*");
1698
+ if (left.includes("*")) {
1699
+ if (dst !== void 0 && !glob || dst === void 0 && !negative && fetch) {
1700
+ return false;
1701
+ }
1702
+ glob = true;
1703
+ } else if (glob) {
1704
+ return false;
1705
+ }
1706
+ const src = left === "@" ? "HEAD" : left;
1707
+ const valid = (name) => validRefnameFormat(name, true, glob);
1708
+ if (negative) {
1709
+ return src !== "" && (FULL_OBJECT_NAME.test(src) || valid(src));
1710
+ }
1711
+ if (fetch) {
1712
+ return (src === "" || valid(src)) && (dst === void 0 || dst === "" || valid(dst));
1713
+ }
1714
+ if (src !== "" && glob && !valid(src)) {
1715
+ return false;
1716
+ }
1717
+ if (dst === void 0) {
1718
+ return valid(src);
1719
+ }
1720
+ return dst !== "" && valid(dst);
1721
+ }
1722
+ function validRefspecWords(value, skip, mode) {
1723
+ const words = typeof value === "string" ? [value] : value;
1724
+ if (!Array.isArray(words)) {
1725
+ return false;
1726
+ }
1727
+ for (let index = skip; index < words.length; index++) {
1728
+ const word = words[index];
1729
+ if (word === "tag") {
1730
+ index++;
1731
+ if (index >= words.length) {
1732
+ return false;
1733
+ }
1734
+ const tag = words[index];
1735
+ if (typeof tag !== "string") {
1736
+ continue;
1737
+ }
1738
+ const refspec = mode === "fetch" ? `refs/tags/${tag}:refs/tags/${tag}` : `${mode === "delete" ? ":" : ""}refs/tags/${tag}`;
1739
+ if (!validRefspec(refspec, mode === "fetch")) {
1740
+ return false;
1741
+ }
1742
+ } else if (mode === "delete") {
1743
+ if (typeof word !== "string" || word === "" || word.includes(":") || !validRefspec(`:${word}`, false)) {
1744
+ return false;
1745
+ }
1746
+ } else if (typeof word === "string" && !validRefspec(word, mode === "fetch")) {
1747
+ return false;
1748
+ }
1749
+ }
1750
+ return true;
1751
+ }
1752
+ function validPushOptionText(value) {
1753
+ const items = typeof value === "string" ? [value] : value;
1754
+ return Array.isArray(items) && items.every((item) => typeof item !== "string" || !item.includes("\n"));
1755
+ }
1756
+ function validRemoteName(value) {
1757
+ return typeof value === "string" && validRefnameFormat(`refs/remotes/${value}/test`);
1758
+ }
1759
+ function parsePushRefspecs(parser, value) {
1760
+ switch (parser) {
1761
+ case "refspec-operands":
1762
+ return validRefspecWords(value, 1, "push");
1763
+ case "push-delete-operands":
1764
+ return validRefspecWords(value, 1, "delete");
1765
+ case "refspec-words":
1766
+ return validRefspecWords(value, 0, "push");
1767
+ case "push-delete-refspecs":
1768
+ return validRefspecWords(value, 0, "delete");
1769
+ case "fetch-refspec-operands":
1770
+ return validRefspecWords(value, 1, "fetch");
1771
+ case "fetch-refspec-words":
1772
+ return validRefspecWords(value, 0, "fetch");
1773
+ case "push-option-text":
1774
+ return validPushOptionText(value);
1775
+ case "remote-name":
1776
+ return validRemoteName(value);
1777
+ }
1778
+ }
1779
+ var PARSERS = [
1780
+ "refspec-operands",
1781
+ "push-delete-operands",
1782
+ "refspec-words",
1783
+ "push-delete-refspecs",
1784
+ "fetch-refspec-operands",
1785
+ "fetch-refspec-words",
1786
+ "push-option-text",
1787
+ "remote-name"
1788
+ ];
1789
+ function isPushRefspecParser(parser) {
1790
+ return typeof parser === "string" && PARSERS.includes(parser);
1791
+ }
1792
+
1793
+ // src/constraints/config-parameters.ts
1794
+ var KEY_CHARACTER = /^[A-Za-z0-9-]$/;
1795
+ var ALPHA = /^[A-Za-z]$/;
1796
+ function canonicalConfigKey(key) {
1797
+ const lastDot = key.lastIndexOf(".");
1798
+ if (lastDot <= 0 || lastDot === key.length - 1) {
1799
+ return void 0;
1800
+ }
1801
+ const firstDot = key.indexOf(".");
1802
+ let canonical = "";
1803
+ for (const [index, character] of key.split("").entries()) {
1804
+ if (index < firstDot || index > lastDot) {
1805
+ if (!KEY_CHARACTER.test(character) || index === lastDot + 1 && !ALPHA.test(character)) {
1806
+ return void 0;
1807
+ }
1808
+ canonical += character.toLowerCase();
1809
+ } else if (character === "\n") {
1810
+ return void 0;
1811
+ } else {
1812
+ canonical += character;
1813
+ }
1814
+ }
1815
+ return canonical;
1816
+ }
1817
+ function splitParameter(parameter) {
1818
+ const equals = parameter.indexOf("=");
1819
+ return equals < 0 ? [parameter, void 0] : [parameter.slice(0, equals), parameter.slice(equals + 1)];
1820
+ }
1821
+ var asList = (value) => typeof value === "string" ? [value] : Array.isArray(value) ? value : void 0;
1822
+ function validCloneConfigParameters(value) {
1823
+ const parameters = asList(value);
1824
+ return _nullishCoalesce(_optionalChain([parameters, 'optionalAccess', _35 => _35.every, 'call', _36 => _36((parameter) => {
1825
+ if (typeof parameter !== "string") {
1826
+ return false;
1827
+ }
1828
+ const [key, text] = splitParameter(parameter);
1829
+ const canonical = key === "" ? void 0 : canonicalConfigKey(key);
1830
+ if (canonical === void 0) {
1831
+ return false;
1832
+ }
1833
+ if (canonical === "clone.defaultremotename") {
1834
+ return text !== void 0;
1835
+ }
1836
+ if (canonical === "clone.rejectshallow" || canonical === "clone.filtersubmodules") {
1837
+ return text === void 0 || gitBoolean(text) !== void 0;
1838
+ }
1839
+ return true;
1840
+ })]), () => ( false));
1841
+ }
1842
+ function validCloneConfigRemoteName(value) {
1843
+ const parameters = asList(value);
1844
+ if (parameters === void 0) {
1845
+ return false;
1846
+ }
1847
+ let name;
1848
+ for (const parameter of parameters) {
1849
+ if (typeof parameter === "string") {
1850
+ const [key, text] = splitParameter(parameter);
1851
+ if (canonicalConfigKey(key) === "clone.defaultremotename" && text !== void 0) {
1852
+ name = text;
1853
+ }
1854
+ }
1855
+ }
1856
+ return name === void 0 || validRemoteName(name);
1857
+ }
1858
+ function parseConfigParameters(parser, value) {
1859
+ return parser === "clone-config-parameters" ? validCloneConfigParameters(value) : validCloneConfigRemoteName(value);
1860
+ }
1861
+ function isConfigParameterParser(parser) {
1862
+ return parser === "clone-config-parameters" || parser === "clone-config-remote-name";
1863
+ }
1864
+
1415
1865
  // src/constraints/git-timestamp.ts
1416
1866
  var TIMESTAMP_CALLBACK_PROBE = DECIMAL_CALLBACK_PROBES["revision-age"];
1417
1867
  var DECIMAL_TIMESTAMP = /^[ \t\r\n\v\f]*([+-]?)(\d+)$/;
@@ -1579,17 +2029,395 @@ function objectFilterCombineEmptyComponents(result) {
1579
2029
  if (result.exitCode === 129 && (result.stdout + result.stderr).includes("usage:") && !/error:|fatal:/.test(result.stderr)) {
1580
2030
  return true;
1581
2031
  }
1582
- return void 0;
2032
+ return void 0;
2033
+ }
2034
+ var OBJECT_FILTER_CHAR_PROBE = ["clone", "--filter=combine:sparse:oid=\xE9", "-h"];
2035
+ function objectFilterUnsignedChar(result) {
2036
+ if (result.exitCode === 128 && result.stderr.includes("must escape char in sub-filter-spec")) {
2037
+ return false;
2038
+ }
2039
+ if (result.exitCode === 129 && (result.stdout + result.stderr).includes("usage:") && !/error:|fatal:/.test(result.stderr)) {
2040
+ return true;
2041
+ }
2042
+ return void 0;
2043
+ }
2044
+
2045
+ // src/constraints/ref-format.ts
2046
+ var LIBC_SPACE = "[ \\t\\n\\v\\f\\r]*";
2047
+ var STRTOL_I = new RegExp(`^${LIBC_SPACE}([+-]?[0-9]+)$`);
2048
+ var STRTOUL_UI = new RegExp(`^${LIBC_SPACE}\\+?([0-9]+)$`);
2049
+ var STRTOL_PREFIX = new RegExp(`^${LIBC_SPACE}([+-]?[0-9]+)`);
2050
+ var GIT_SPACE2 = /[ \t\n\r]/;
2051
+ var PLACEHOLDER_END = /[,)]/;
2052
+ var HEX_COLOR = /^#(?:[0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/;
2053
+ var INT_MIN = -2147483648n;
2054
+ var INT_MAX = 2147483647n;
2055
+ var UINT_MAX = 4294967295n;
2056
+ function strtolI(text) {
2057
+ const match = STRTOL_I.exec(text);
2058
+ if (!match) {
2059
+ return false;
2060
+ }
2061
+ const value = BigInt(match[1]);
2062
+ return value >= INT_MIN && value <= INT_MAX;
2063
+ }
2064
+ function strtoulUiValue(text) {
2065
+ if (text.includes("-")) {
2066
+ return void 0;
2067
+ }
2068
+ const match = STRTOUL_UI.exec(text);
2069
+ if (!match) {
2070
+ return void 0;
2071
+ }
2072
+ const value = BigInt(match[1]);
2073
+ return value <= UINT_MAX ? value : void 0;
2074
+ }
2075
+ function strtoulUi(text) {
2076
+ return strtoulUiValue(text) !== void 0;
2077
+ }
2078
+ function matchWord(word, name) {
2079
+ return word.length === name.length && asciiLower(word) === name;
2080
+ }
2081
+ var ANSI_COLORS = ["black", "red", "green", "yellow", "blue", "magenta", "cyan", "white"];
2082
+ var ATTRIBUTES = ["bold", "dim", "italic", "ul", "blink", "reverse", "strike"];
2083
+ function parseColor(word) {
2084
+ if (matchWord(word, "normal") || HEX_COLOR.test(word) || matchWord(word, "default")) {
2085
+ return true;
2086
+ }
2087
+ const name = asciiLower(word.slice(0, 6)) === "bright" ? word.slice(6) : word;
2088
+ if (ANSI_COLORS.some((color) => matchWord(name, color))) {
2089
+ return true;
2090
+ }
2091
+ const match = STRTOL_PREFIX.exec(word);
2092
+ if (!match || match[0].length !== word.length) {
2093
+ return false;
2094
+ }
2095
+ const value = BigInt(match[1]);
2096
+ return value >= -1n && value < 256n;
2097
+ }
2098
+ function parseAttribute(word) {
2099
+ let name = word;
2100
+ if (name.startsWith("no")) {
2101
+ name = name.slice(2);
2102
+ if (name.startsWith("-")) {
2103
+ name = name.slice(1);
2104
+ }
2105
+ }
2106
+ return ATTRIBUTES.includes(name);
2107
+ }
2108
+ function validGitColor(value) {
2109
+ let foreground = false;
2110
+ let background = false;
2111
+ for (const word of value.split(GIT_SPACE2)) {
2112
+ if (word === "" || matchWord(word, "reset")) {
2113
+ continue;
2114
+ }
2115
+ if (parseColor(word)) {
2116
+ if (!foreground) {
2117
+ foreground = true;
2118
+ } else if (!background) {
2119
+ background = true;
2120
+ } else {
2121
+ return false;
2122
+ }
2123
+ continue;
2124
+ }
2125
+ if (!parseAttribute(word)) {
2126
+ return false;
2127
+ }
2128
+ }
2129
+ return true;
2130
+ }
2131
+ var anyArg = () => true;
2132
+ var noArg = (arg) => arg === void 0;
2133
+ var requiredArg = (arg) => arg !== void 0;
2134
+ var oneOf = (...choices) => (arg) => arg === void 0 || choices.includes(arg);
2135
+ var refnameArg = (arg) => {
2136
+ if (arg === void 0 || arg === "short") {
2137
+ return true;
2138
+ }
2139
+ for (const prefix of ["lstrip=", "strip=", "rstrip="]) {
2140
+ if (arg.startsWith(prefix)) {
2141
+ return strtolI(arg.slice(prefix.length));
2142
+ }
2143
+ }
2144
+ return false;
2145
+ };
2146
+ var remoteRefArg = (arg) => arg === void 0 || arg.split(",").every(
2147
+ (item) => ["track", "trackshort", "nobracket", "remotename", "remoteref"].includes(item) || refnameArg(arg)
2148
+ );
2149
+ var oidArg = (arg) => {
2150
+ if (arg === void 0 || arg === "short") {
2151
+ return true;
2152
+ }
2153
+ if (!arg.startsWith("short=")) {
2154
+ return false;
2155
+ }
2156
+ const value = strtoulUiValue(arg.slice("short=".length));
2157
+ return value !== void 0 && value !== 0n;
2158
+ };
2159
+ var emailArg = (arg) => {
2160
+ if (arg === void 0) {
2161
+ return true;
2162
+ }
2163
+ let rest = arg;
2164
+ for (; ; ) {
2165
+ const option = ["trim", "localpart", "mailmap"].find((name) => rest.startsWith(name));
2166
+ if (option === void 0) {
2167
+ return false;
2168
+ }
2169
+ rest = rest.slice(option.length);
2170
+ if (rest === "") {
2171
+ return true;
2172
+ }
2173
+ if (!rest.startsWith(",")) {
2174
+ return false;
2175
+ }
2176
+ rest = rest.slice(1);
2177
+ }
2178
+ };
2179
+ function matchAtomArgValue(text, candidate) {
2180
+ if (!text.startsWith(candidate)) {
2181
+ return void 0;
2182
+ }
2183
+ const after = text.slice(candidate.length);
2184
+ if (after.startsWith("=")) {
2185
+ const comma = after.indexOf(",");
2186
+ const value = comma < 0 ? after.slice(1) : after.slice(1, comma);
2187
+ return { value, rest: comma < 0 ? "" : after.slice(comma + 1) };
2188
+ }
2189
+ if (after !== "" && !after.startsWith(",")) {
2190
+ return void 0;
2191
+ }
2192
+ return { value: void 0, rest: after.slice(1) };
2193
+ }
2194
+ var describeArg = (arg) => {
2195
+ let rest = _nullishCoalesce(arg, () => ( ""));
2196
+ while (rest !== "") {
2197
+ const tags = matchAtomArgValue(rest, "tags");
2198
+ if (tags) {
2199
+ rest = tags.rest;
2200
+ if (tags.value === void 0 || gitBoolean(tags.value) !== void 0) {
2201
+ continue;
2202
+ }
2203
+ }
2204
+ const abbrev = matchAtomArgValue(rest, "abbrev");
2205
+ if (abbrev) {
2206
+ const value = _nullishCoalesce(abbrev.value, () => ( ""));
2207
+ const match = STRTOL_PREFIX.exec(value);
2208
+ if (!match || match[0].length !== value.length || BigInt(match[1]) < 0n) {
2209
+ return false;
2210
+ }
2211
+ rest = abbrev.rest;
2212
+ continue;
2213
+ }
2214
+ const pattern = _nullishCoalesce(matchAtomArgValue(rest, "match"), () => ( matchAtomArgValue(rest, "exclude")));
2215
+ if (!_optionalChain([pattern, 'optionalAccess', _37 => _37.value])) {
2216
+ return false;
2217
+ }
2218
+ rest = pattern.rest;
2219
+ }
2220
+ return true;
2221
+ };
2222
+ function matchPlaceholder(text, candidate) {
2223
+ if (!text.startsWith(candidate)) {
2224
+ return void 0;
2225
+ }
2226
+ let after = text.slice(candidate.length);
2227
+ let value;
2228
+ if (after.startsWith("=")) {
2229
+ const end = after.slice(1).search(PLACEHOLDER_END);
2230
+ value = after.slice(1, end + 1);
2231
+ after = after.slice(end + 1);
2232
+ } else if (!(after.startsWith(",") || after.startsWith(")"))) {
2233
+ return void 0;
2234
+ }
2235
+ return { value, rest: after.startsWith(",") ? after.slice(1) : after };
2236
+ }
2237
+ function trailersOptions(arg) {
2238
+ let rest = `${arg})`;
2239
+ while (!rest.startsWith(")")) {
2240
+ const key = matchPlaceholder(rest, "key");
2241
+ if (key) {
2242
+ if (key.value === void 0) {
2243
+ return false;
2244
+ }
2245
+ rest = key.rest;
2246
+ continue;
2247
+ }
2248
+ const separator = _nullishCoalesce(matchPlaceholder(rest, "separator"), () => ( matchPlaceholder(rest, "key_value_separator")));
2249
+ if (separator) {
2250
+ rest = separator.rest;
2251
+ continue;
2252
+ }
2253
+ let matched = false;
2254
+ for (const name of ["only", "unfold", "keyonly", "valueonly"]) {
2255
+ const flag = matchPlaceholder(rest, name);
2256
+ if (!flag) {
2257
+ continue;
2258
+ }
2259
+ rest = flag.rest;
2260
+ if (flag.value === void 0 || gitBoolean(flag.value) !== void 0) {
2261
+ matched = true;
2262
+ break;
2263
+ }
2264
+ }
2265
+ if (!matched) {
2266
+ return false;
2267
+ }
2268
+ }
2269
+ return true;
2270
+ }
2271
+ var trailersArg = (arg) => arg === void 0 || trailersOptions(arg);
2272
+ var contentsArg = (arg) => {
2273
+ if (arg === void 0 || ["body", "size", "signature", "subject", "trailers"].includes(arg)) {
2274
+ return true;
2275
+ }
2276
+ if (arg.startsWith("trailers:")) {
2277
+ return trailersOptions(arg.slice("trailers:".length));
2278
+ }
2279
+ if (arg.startsWith("lines=")) {
2280
+ return strtoulUi(arg.slice("lines=".length));
2281
+ }
2282
+ return false;
2283
+ };
2284
+ var ALIGN_POSITIONS = ["right", "middle", "left"];
2285
+ var alignArg = (arg) => {
2286
+ if (arg === void 0) {
2287
+ return false;
2288
+ }
2289
+ let width = UINT_MAX;
2290
+ for (const item of arg.split(",")) {
2291
+ if (item.startsWith("position=")) {
2292
+ if (!ALIGN_POSITIONS.includes(item.slice("position=".length))) {
2293
+ return false;
2294
+ }
2295
+ } else if (item.startsWith("width=")) {
2296
+ const value = strtoulUiValue(item.slice("width=".length));
2297
+ if (value === void 0) {
2298
+ return false;
2299
+ }
2300
+ width = value;
2301
+ } else {
2302
+ const value = strtoulUiValue(item);
2303
+ if (value !== void 0) {
2304
+ width = value;
2305
+ } else if (!ALIGN_POSITIONS.includes(item)) {
2306
+ return false;
2307
+ }
2308
+ }
2309
+ }
2310
+ return width !== UINT_MAX;
2311
+ };
2312
+ var colorArg = (arg) => arg !== void 0 && validGitColor(arg);
2313
+ var ifArg = (arg) => arg === void 0 || arg.startsWith("equals=") || arg.startsWith("notequals=");
2314
+ var nameArg = oneOf("mailmap");
2315
+ var ATOMS = /* @__PURE__ */ new Map([
2316
+ ["refname", refnameArg],
2317
+ ["objecttype", noArg],
2318
+ ["objectsize", oneOf("disk")],
2319
+ ["objectname", oidArg],
2320
+ ["deltabase", noArg],
2321
+ ["tree", oidArg],
2322
+ ["parent", oidArg],
2323
+ ["numparent", anyArg],
2324
+ ["object", anyArg],
2325
+ ["type", anyArg],
2326
+ ["tag", anyArg],
2327
+ ["author", anyArg],
2328
+ ["authorname", nameArg],
2329
+ ["authoremail", emailArg],
2330
+ ["authordate", anyArg],
2331
+ ["committer", anyArg],
2332
+ ["committername", nameArg],
2333
+ ["committeremail", emailArg],
2334
+ ["committerdate", anyArg],
2335
+ ["tagger", anyArg],
2336
+ ["taggername", nameArg],
2337
+ ["taggeremail", emailArg],
2338
+ ["taggerdate", anyArg],
2339
+ ["creator", anyArg],
2340
+ ["creatordate", anyArg],
2341
+ ["describe", describeArg],
2342
+ ["subject", oneOf("sanitize")],
2343
+ ["body", noArg],
2344
+ ["trailers", trailersArg],
2345
+ ["contents", contentsArg],
2346
+ [
2347
+ "signature",
2348
+ oneOf("signer", "grade", "key", "fingerprint", "primarykeyfingerprint", "trustlevel")
2349
+ ],
2350
+ ["raw", oneOf("size")],
2351
+ ["upstream", remoteRefArg],
2352
+ ["push", remoteRefArg],
2353
+ ["symref", refnameArg],
2354
+ ["flag", anyArg],
2355
+ ["HEAD", noArg],
2356
+ ["color", colorArg],
2357
+ ["worktreepath", anyArg],
2358
+ ["align", alignArg],
2359
+ ["end", anyArg],
2360
+ ["if", ifArg],
2361
+ ["then", anyArg],
2362
+ ["else", anyArg],
2363
+ ["rest", noArg],
2364
+ // The committish is looked up in the repository, which Git decides.
2365
+ ["ahead-behind", requiredArg],
2366
+ ["is-base", requiredArg]
2367
+ ]);
2368
+ function parseAtom(atom) {
2369
+ const start = atom.startsWith("*") ? 1 : 0;
2370
+ if (atom.length <= start) {
2371
+ return void 0;
2372
+ }
2373
+ const colon = atom.indexOf(":", start);
2374
+ const name = atom.slice(start, colon < 0 ? void 0 : colon);
2375
+ const parser = ATOMS.get(name);
2376
+ const arg = colon < 0 || colon === atom.length - 1 ? void 0 : atom.slice(colon + 1);
2377
+ return _optionalChain([parser, 'optionalCall', _38 => _38(arg)]) ? name : void 0;
2378
+ }
2379
+ function validRefFormat(value) {
2380
+ if (typeof value !== "string") {
2381
+ return false;
2382
+ }
2383
+ let index = 0;
2384
+ while (index < value.length) {
2385
+ if (value[index] !== "%") {
2386
+ index += 1;
2387
+ continue;
2388
+ }
2389
+ if (value[index + 1] === "%") {
2390
+ index += 2;
2391
+ continue;
2392
+ }
2393
+ if (value[index + 1] !== "(") {
2394
+ index += 1;
2395
+ continue;
2396
+ }
2397
+ const end = value.indexOf(")", index);
2398
+ if (end < 0) {
2399
+ return false;
2400
+ }
2401
+ const name = parseAtom(value.slice(index + 2, end));
2402
+ if (name === void 0 || name === "rest") {
2403
+ return false;
2404
+ }
2405
+ index = end + 1;
2406
+ }
2407
+ return true;
1583
2408
  }
1584
- var OBJECT_FILTER_CHAR_PROBE = ["clone", "--filter=combine:sparse:oid=\xE9", "-h"];
1585
- function objectFilterUnsignedChar(result) {
1586
- if (result.exitCode === 128 && result.stderr.includes("must escape char in sub-filter-spec")) {
2409
+ function validRefSortKey(value) {
2410
+ if (typeof value !== "string") {
1587
2411
  return false;
1588
2412
  }
1589
- if (result.exitCode === 129 && (result.stdout + result.stderr).includes("usage:") && !/error:|fatal:/.test(result.stderr)) {
1590
- return true;
2413
+ let key = value.startsWith("-") ? value.slice(1) : value;
2414
+ for (const prefix of ["version:", "v:"]) {
2415
+ if (key.startsWith(prefix)) {
2416
+ key = key.slice(prefix.length);
2417
+ break;
2418
+ }
1591
2419
  }
1592
- return void 0;
2420
+ return parseAtom(key) !== void 0;
1593
2421
  }
1594
2422
 
1595
2423
  // src/constraints/git-scalars.ts
@@ -1650,7 +2478,7 @@ function parseGitScalar(parser, value, previous, cLongBits = nativeCLongBits(_pr
1650
2478
  return parseGitTimestamp(value, {
1651
2479
  ...parser,
1652
2480
  longBits: cLongBits,
1653
- conversion: parser.nativeCallback === "revision-age" && _optionalChain([decimalCallbacks, 'optionalAccess', _27 => _27["revision-age"]]) === "legacy" ? "atoi" : parser.conversion
2481
+ conversion: parser.nativeCallback === "revision-age" && _optionalChain([decimalCallbacks, 'optionalAccess', _39 => _39["revision-age"]]) === "legacy" ? "atoi" : parser.conversion
1654
2482
  });
1655
2483
  }
1656
2484
  if (typeof parser === "object" && parser.kind === "decimal") {
@@ -1698,6 +2526,12 @@ function parseGitScalar(parser, value, previous, cLongBits = nativeCLongBits(_pr
1698
2526
  const parsed = pythonInteger(value);
1699
2527
  return { valid: parsed !== void 0, value: parsed };
1700
2528
  }
2529
+ if (isPushRefspecParser(parser)) {
2530
+ return { valid: parsePushRefspecs(parser, value), value };
2531
+ }
2532
+ if (isConfigParameterParser(parser)) {
2533
+ return { valid: parseConfigParameters(parser, value), value };
2534
+ }
1701
2535
  if (parser === "depth-initial") {
1702
2536
  return { valid: validInitialDepth(value, depthAtoiBits), value };
1703
2537
  }
@@ -1715,9 +2549,37 @@ function parseGitScalar(parser, value, previous, cLongBits = nativeCLongBits(_pr
1715
2549
  value
1716
2550
  };
1717
2551
  }
2552
+ if (parser === "branch-name") {
2553
+ return { valid: value === void 0 || validNewBranchName(value), value };
2554
+ }
2555
+ if (parser === "ref-format") {
2556
+ return { valid: value === void 0 || validRefFormat(value), value };
2557
+ }
2558
+ if (parser === "ref-sort-key") {
2559
+ return { valid: validRefSortKey(value), value };
2560
+ }
2561
+ if (parser === "refname-onelevel") {
2562
+ return {
2563
+ valid: value === void 0 || typeof value === "string" && validRefnameFormat(value, true),
2564
+ value
2565
+ };
2566
+ }
2567
+ if (parser === "commit-author") {
2568
+ return { valid: value === void 0 || validCommitAuthor(value), value };
2569
+ }
2570
+ if (parser === "commit-date") {
2571
+ const valid = value === void 0 || (value instanceof Date ? !Number.isNaN(value.getTime()) : validCommitDate(value));
2572
+ return { valid, value };
2573
+ }
1718
2574
  if (parser === "blame-line-range") {
1719
2575
  return { valid: validBlameLineRange(value), value };
1720
2576
  }
2577
+ if (parser === "log-line-range") {
2578
+ return { valid: validLogLineRange(value), value };
2579
+ }
2580
+ if (parser === "track-start-point") {
2581
+ return { valid: validTrackStartPoint(value), value };
2582
+ }
1721
2583
  if (isStringCallback(parser)) {
1722
2584
  return parseStringCallback(parser, value);
1723
2585
  }
@@ -1786,6 +2648,17 @@ function parseGitScalar(parser, value, previous, cLongBits = nativeCLongBits(_pr
1786
2648
  const boolean = gitBoolean(value);
1787
2649
  return boolean === void 0 ? { valid: false } : { valid: true, value: boolean };
1788
2650
  }
2651
+ function validTrackStartPoint(value) {
2652
+ if (typeof value !== "string") {
2653
+ return false;
2654
+ }
2655
+ let rest = value.startsWith("refs/") ? value.slice(5) : value;
2656
+ if (rest.startsWith("remotes/")) {
2657
+ rest = rest.slice(8);
2658
+ }
2659
+ const slash = rest.indexOf("/");
2660
+ return slash >= 0 && slash + 1 < rest.length && branchNameSyntax(rest.slice(slash + 1)) !== false;
2661
+ }
1789
2662
 
1790
2663
  // src/constraints/numeric-callbacks.generated.ts
1791
2664
  var NUMERIC_CALLBACK_PARSERS = {
@@ -2486,6 +3359,23 @@ var COMMAND_CONSTRAINTS = {
2486
3359
  reason: "Explicit submodule filtering requires a filter and recursive submodule initialization.",
2487
3360
  source: git("builtin/clone.c")
2488
3361
  },
3362
+ {
3363
+ id: "clone.recursive-references",
3364
+ kind: "forbid",
3365
+ when: [active("recurseSubmodules"), active("reference"), active("referenceIfAble")],
3366
+ origin: "git",
3367
+ reason: "Recursive clones cannot use both reference and referenceIfAble.",
3368
+ source: git("builtin/clone.c")
3369
+ },
3370
+ {
3371
+ id: "clone.origin-name",
3372
+ kind: "scalar",
3373
+ key: "origin",
3374
+ parser: "remote-name",
3375
+ origin: "git",
3376
+ reason: "The remote name must form a valid fetch refspec refs/heads/test:refs/remotes/<name>/test.",
3377
+ source: git("builtin/clone.c")
3378
+ },
2489
3379
  {
2490
3380
  id: "clone.depth",
2491
3381
  kind: "integer",
@@ -2580,6 +3470,38 @@ var COMMAND_CONSTRAINTS = {
2580
3470
  origin: "type-git",
2581
3471
  reason: "Structured paths use NUL delimiters to preserve all filenames.",
2582
3472
  source: contract
3473
+ },
3474
+ {
3475
+ id: "status.ignored-untracked",
3476
+ kind: "forbid",
3477
+ when: [
3478
+ { key: "ignored", test: "equals", value: "matching" },
3479
+ { key: "untracked", test: "equals", value: "no" }
3480
+ ],
3481
+ origin: "git",
3482
+ reason: "Matching ignored files requires showing untracked files.",
3483
+ source: git("builtin/commit.c")
3484
+ },
3485
+ {
3486
+ id: "status.findRenames",
3487
+ kind: "integer",
3488
+ key: "findRenames",
3489
+ min: 1,
3490
+ allowBoolean: true,
3491
+ origin: "type-git",
3492
+ reason: "A rename threshold is a whole percentage.",
3493
+ source: contract
3494
+ },
3495
+ {
3496
+ id: "status.findRenames-range",
3497
+ kind: "range",
3498
+ key: "findRenames",
3499
+ min: 1,
3500
+ max: 100,
3501
+ origin: "type-git",
3502
+ // Git turns a zero score into its 50% default, so 0 would not mean 0%.
3503
+ reason: "A rename threshold is a percentage from 1 to 100.",
3504
+ source: contract
2583
3505
  }
2584
3506
  ],
2585
3507
  log: [
@@ -2686,6 +3608,24 @@ var COMMAND_CONSTRAINTS = {
2686
3608
  reason: "Git rejects these simultaneous modes or operands.",
2687
3609
  source: git("builtin/fetch.c")
2688
3610
  },
3611
+ {
3612
+ id: "fetch.refspec-remote",
3613
+ kind: "requires",
3614
+ when: { key: "refspec", test: "nonempty" },
3615
+ required: [{ key: "remote", test: "nonempty" }],
3616
+ origin: "git",
3617
+ reason: "Git reads the first positional word as the repository, so refspecs need an explicit remote.",
3618
+ source: git("builtin/fetch.c")
3619
+ },
3620
+ {
3621
+ id: "fetch.tag-shorthand",
3622
+ kind: "scalar",
3623
+ key: "refspec",
3624
+ parser: "fetch-refspec-words",
3625
+ origin: "git",
3626
+ reason: "Refspec words must parse as refspecs, and a word 'tag' must be followed by a tag name that forms one.",
3627
+ source: git("builtin/fetch.c")
3628
+ },
2689
3629
  {
2690
3630
  id: "fetch.unsupported",
2691
3631
  kind: "unsupported",
@@ -2821,6 +3761,44 @@ var COMMAND_CONSTRAINTS = {
2821
3761
  origin: "git",
2822
3762
  reason: "Deletion requires explicit refs.",
2823
3763
  source: git("builtin/push.c")
3764
+ },
3765
+ {
3766
+ id: "push.refspec-remote",
3767
+ kind: "requires",
3768
+ when: { key: "refspec", test: "nonempty" },
3769
+ required: [{ key: "remote", test: "nonempty" }],
3770
+ origin: "git",
3771
+ reason: "Git reads the first positional word as the repository, so refspecs need an explicit remote.",
3772
+ source: git("builtin/push.c")
3773
+ },
3774
+ {
3775
+ id: "push.tag-shorthand",
3776
+ kind: "scalar",
3777
+ key: "refspec",
3778
+ parser: "refspec-words",
3779
+ guard: [{ key: "deleteRefs", test: "inactive" }],
3780
+ origin: "git",
3781
+ reason: "Refspec words must parse as refspecs, and a word 'tag' must be followed by a tag name that forms one.",
3782
+ source: git("builtin/push.c")
3783
+ },
3784
+ {
3785
+ id: "push.delete-names",
3786
+ kind: "scalar",
3787
+ key: "refspec",
3788
+ parser: "push-delete-refspecs",
3789
+ guard: [active("deleteRefs")],
3790
+ origin: "git",
3791
+ reason: "Deletion accepts only nonempty plain ref names without a colon that are valid ref names.",
3792
+ source: git("builtin/push.c")
3793
+ },
3794
+ {
3795
+ id: "push.option-newline",
3796
+ kind: "scalar",
3797
+ key: "pushOption",
3798
+ parser: "push-option-text",
3799
+ origin: "git",
3800
+ reason: "Push options must not contain newline characters.",
3801
+ source: git("builtin/push.c")
2824
3802
  }
2825
3803
  ],
2826
3804
  add: [
@@ -3046,8 +4024,8 @@ var COMMAND_CONSTRAINTS = {
3046
4024
  present("ff"),
3047
4025
  active("squash"),
3048
4026
  active("noCommit"),
3049
- active("strategy"),
3050
- active("strategyOption"),
4027
+ { key: "strategy", test: "nonempty" },
4028
+ { key: "strategyOption", test: "nonempty" },
3051
4029
  active("noVerify"),
3052
4030
  active("noDiffstat"),
3053
4031
  active("stat"),
@@ -3078,8 +4056,8 @@ var COMMAND_CONSTRAINTS = {
3078
4056
  present("ff"),
3079
4057
  active("squash"),
3080
4058
  active("noCommit"),
3081
- active("strategy"),
3082
- active("strategyOption"),
4059
+ { key: "strategy", test: "nonempty" },
4060
+ { key: "strategyOption", test: "nonempty" },
3083
4061
  active("noVerify"),
3084
4062
  active("noDiffstat"),
3085
4063
  active("stat"),
@@ -3110,8 +4088,8 @@ var COMMAND_CONSTRAINTS = {
3110
4088
  present("ff"),
3111
4089
  active("squash"),
3112
4090
  active("noCommit"),
3113
- active("strategy"),
3114
- active("strategyOption"),
4091
+ { key: "strategy", test: "nonempty" },
4092
+ { key: "strategyOption", test: "nonempty" },
3115
4093
  active("noVerify"),
3116
4094
  active("noDiffstat"),
3117
4095
  active("stat"),
@@ -3151,6 +4129,42 @@ var COMMAND_CONSTRAINTS = {
3151
4129
  }
3152
4130
  ],
3153
4131
  pull: [
4132
+ {
4133
+ id: "pull.branch-remote",
4134
+ kind: "requires",
4135
+ when: { key: "branch", test: "nonempty" },
4136
+ required: [{ key: "remote", test: "nonempty" }],
4137
+ origin: "git",
4138
+ reason: "Git reads the first positional word as the repository, so a branch needs an explicit remote.",
4139
+ source: git("builtin/pull.c")
4140
+ },
4141
+ {
4142
+ id: "pull.all-remote",
4143
+ kind: "forbid",
4144
+ when: [active("all"), { key: "remote", test: "nonempty" }],
4145
+ origin: "git",
4146
+ reason: "Fetching from all remotes cannot name a repository.",
4147
+ source: git("builtin/fetch.c")
4148
+ },
4149
+ {
4150
+ id: "pull.tag-shorthand",
4151
+ kind: "scalar",
4152
+ key: "branch",
4153
+ parser: "fetch-refspec-words",
4154
+ origin: "git",
4155
+ reason: "Refspec words must parse as refspecs, and a word 'tag' must be followed by a tag name that forms one.",
4156
+ source: git("builtin/fetch.c")
4157
+ },
4158
+ {
4159
+ id: "pull.cleanup",
4160
+ kind: "value",
4161
+ key: "cleanup",
4162
+ guard: [{ key: "cleanup", test: "nonempty" }],
4163
+ allowed: ["default", "verbatim", "whitespace", "strip", "scissors"],
4164
+ origin: "git",
4165
+ reason: "Pull validates the final cleanup value before fetching.",
4166
+ source: git("builtin/pull.c")
4167
+ },
3154
4168
  {
3155
4169
  id: "pull.depth-unshallow",
3156
4170
  kind: "exclusive",
@@ -3245,6 +4259,47 @@ var COMMAND_CONSTRAINTS = {
3245
4259
  origin: "git",
3246
4260
  reason: "Git rejects these simultaneous modes or operands.",
3247
4261
  source: git("builtin/checkout.c")
4262
+ },
4263
+ {
4264
+ id: "switch.discard-conflict",
4265
+ kind: "exclusive",
4266
+ keys: ["discard", "conflict"],
4267
+ origin: "git",
4268
+ reason: "A conflict style implies --merge, which Git rejects with --discard-changes.",
4269
+ source: git("builtin/checkout.c")
4270
+ },
4271
+ {
4272
+ id: "switch.force-conflict",
4273
+ kind: "exclusive",
4274
+ keys: ["force", "conflict"],
4275
+ origin: "git",
4276
+ reason: "A conflict style implies --merge, which Git rejects with --force.",
4277
+ source: git("builtin/checkout.c")
4278
+ },
4279
+ {
4280
+ id: "switch.detach-track",
4281
+ kind: "exclusive",
4282
+ keys: ["detach", "track"],
4283
+ origin: "git",
4284
+ reason: "Git rejects tracking with --detach.",
4285
+ source: git("builtin/checkout.c")
4286
+ },
4287
+ {
4288
+ id: "switch.orphan-track",
4289
+ kind: "exclusive",
4290
+ keys: ["orphan", "track"],
4291
+ origin: "git",
4292
+ reason: "Git rejects tracking with --orphan.",
4293
+ source: git("builtin/checkout.c")
4294
+ },
4295
+ {
4296
+ id: "switch.startPoint",
4297
+ kind: "requiresAny",
4298
+ when: { key: "startPoint", test: "nonempty" },
4299
+ choices: [active("create"), active("forceCreate")],
4300
+ origin: "git",
4301
+ reason: "A start point is a second operand, which Git accepts only with -c or -C; --orphan takes no start point. An empty startPoint is not emitted.",
4302
+ source: git("builtin/checkout.c")
3248
4303
  }
3249
4304
  ],
3250
4305
  cherryPick: [
@@ -3290,11 +4345,11 @@ var COMMAND_CONSTRAINTS = {
3290
4345
  active("noCommit"),
3291
4346
  active("signoff"),
3292
4347
  active("mainline"),
3293
- active("strategy"),
3294
- active("strategyOption"),
4348
+ { key: "strategy", test: "nonempty" },
4349
+ { key: "strategyOption", test: "nonempty" },
3295
4350
  active("appendCommitName"),
3296
4351
  active("ff"),
3297
- active("empty"),
4352
+ { key: "empty", test: "nonempty" },
3298
4353
  present("rerereAutoupdate")
3299
4354
  ],
3300
4355
  origin: "git",
@@ -3309,11 +4364,11 @@ var COMMAND_CONSTRAINTS = {
3309
4364
  active("noCommit"),
3310
4365
  active("signoff"),
3311
4366
  active("mainline"),
3312
- active("strategy"),
3313
- active("strategyOption"),
4367
+ { key: "strategy", test: "nonempty" },
4368
+ { key: "strategyOption", test: "nonempty" },
3314
4369
  active("appendCommitName"),
3315
4370
  active("ff"),
3316
- active("empty"),
4371
+ { key: "empty", test: "nonempty" },
3317
4372
  present("rerereAutoupdate")
3318
4373
  ],
3319
4374
  origin: "git",
@@ -3328,11 +4383,11 @@ var COMMAND_CONSTRAINTS = {
3328
4383
  active("noCommit"),
3329
4384
  active("signoff"),
3330
4385
  active("mainline"),
3331
- active("strategy"),
3332
- active("strategyOption"),
4386
+ { key: "strategy", test: "nonempty" },
4387
+ { key: "strategyOption", test: "nonempty" },
3333
4388
  active("appendCommitName"),
3334
4389
  active("ff"),
3335
- active("empty"),
4390
+ { key: "empty", test: "nonempty" },
3336
4391
  present("rerereAutoupdate")
3337
4392
  ],
3338
4393
  origin: "git",
@@ -3415,8 +4470,8 @@ var COMMAND_CONSTRAINTS = {
3415
4470
  active("noCommit"),
3416
4471
  active("signoff"),
3417
4472
  active("mainline"),
3418
- active("strategy"),
3419
- active("strategyOption"),
4473
+ { key: "strategy", test: "nonempty" },
4474
+ { key: "strategyOption", test: "nonempty" },
3420
4475
  present("rerereAutoupdate")
3421
4476
  ],
3422
4477
  origin: "git",
@@ -3431,8 +4486,8 @@ var COMMAND_CONSTRAINTS = {
3431
4486
  active("noCommit"),
3432
4487
  active("signoff"),
3433
4488
  active("mainline"),
3434
- active("strategy"),
3435
- active("strategyOption"),
4489
+ { key: "strategy", test: "nonempty" },
4490
+ { key: "strategyOption", test: "nonempty" },
3436
4491
  present("rerereAutoupdate")
3437
4492
  ],
3438
4493
  origin: "git",
@@ -3447,8 +4502,8 @@ var COMMAND_CONSTRAINTS = {
3447
4502
  active("noCommit"),
3448
4503
  active("signoff"),
3449
4504
  active("mainline"),
3450
- active("strategy"),
3451
- active("strategyOption"),
4505
+ { key: "strategy", test: "nonempty" },
4506
+ { key: "strategyOption", test: "nonempty" },
3452
4507
  present("rerereAutoupdate")
3453
4508
  ],
3454
4509
  origin: "git",
@@ -3458,49 +4513,80 @@ var COMMAND_CONSTRAINTS = {
3458
4513
  ],
3459
4514
  rebase: [
3460
4515
  {
3461
- id: "rebase.abort-continue-skip",
3462
- kind: "exclusive",
3463
- keys: ["abort", "continue", "skip"],
3464
- origin: "git",
3465
- reason: "Git rejects these simultaneous modes or operands.",
3466
- source: git("builtin/rebase.c")
3467
- },
3468
- {
3469
- id: "rebase.keepBase-onto",
3470
- kind: "exclusive",
3471
- keys: ["keepBase", "onto"],
3472
- origin: "git",
3473
- reason: "Git rejects these simultaneous modes or operands.",
3474
- source: git("builtin/rebase.c")
3475
- },
3476
- {
3477
- id: "rebase.keepBase-root",
3478
- kind: "exclusive",
3479
- keys: ["keepBase", "root"],
4516
+ id: "rebase.action-alone",
4517
+ kind: "exclusiveGroups",
4518
+ groups: [
4519
+ [active("abort")],
4520
+ [active("continue")],
4521
+ [active("skip")],
4522
+ [
4523
+ { key: "upstream", test: "nonempty" },
4524
+ { key: "onto", test: "nonempty" },
4525
+ active("interactive"),
4526
+ active("rebaseMerges"),
4527
+ active("noVerify"),
4528
+ active("keepBase"),
4529
+ active("quiet"),
4530
+ active("verbose"),
4531
+ active("signoff"),
4532
+ active("committerDateIsAuthorDate"),
4533
+ active("resetAuthorDate"),
4534
+ active("ignoreWhitespace"),
4535
+ { key: "whitespace", test: "nonempty" },
4536
+ active("forceRebase"),
4537
+ active("noFf"),
4538
+ active("apply"),
4539
+ present("rerereAutoupdate"),
4540
+ { key: "empty", test: "nonempty" },
4541
+ present("autosquash"),
4542
+ present("updateRefs"),
4543
+ active("gpgSign"),
4544
+ present("autostash"),
4545
+ { key: "exec", test: "nonempty" },
4546
+ present("forkPoint"),
4547
+ { key: "strategy", test: "nonempty" },
4548
+ { key: "strategyOption", test: "nonempty" },
4549
+ active("root"),
4550
+ present("rescheduleFailedExec"),
4551
+ present("reapplyCherryPicks")
4552
+ ]
4553
+ ],
3480
4554
  origin: "git",
3481
- reason: "Git rejects these simultaneous modes or operands.",
4555
+ reason: "A rebase action must be the only argument; Git prints usage otherwise.",
3482
4556
  source: git("builtin/rebase.c")
3483
4557
  },
3484
4558
  {
3485
- id: "rebase.apply-rebaseMerges",
3486
- kind: "exclusive",
3487
- keys: ["apply", "rebaseMerges"],
4559
+ id: "rebase.backend",
4560
+ kind: "exclusiveGroups",
4561
+ groups: [
4562
+ [active("apply"), { key: "whitespace", test: "nonempty" }],
4563
+ [
4564
+ { key: "strategy", test: "nonempty" },
4565
+ { key: "strategyOption", test: "nonempty" },
4566
+ { key: "exec", test: "nonempty" },
4567
+ active("rebaseMerges"),
4568
+ equal("updateRefs", true),
4569
+ equal("autosquash", true),
4570
+ { key: "empty", test: "nonempty" },
4571
+ equal("rescheduleFailedExec", true)
4572
+ ]
4573
+ ],
3488
4574
  origin: "git",
3489
- reason: "Git rejects these simultaneous modes or operands.",
4575
+ reason: "Apply options (--apply, --whitespace) cannot be combined with options that select or require the merge backend.",
3490
4576
  source: git("builtin/rebase.c")
3491
4577
  },
3492
4578
  {
3493
- id: "rebase.apply-strategy",
4579
+ id: "rebase.keepBase-onto",
3494
4580
  kind: "exclusive",
3495
- keys: ["apply", "strategy"],
4581
+ keys: ["keepBase", "onto"],
3496
4582
  origin: "git",
3497
4583
  reason: "Git rejects these simultaneous modes or operands.",
3498
4584
  source: git("builtin/rebase.c")
3499
4585
  },
3500
4586
  {
3501
- id: "rebase.apply-exec",
4587
+ id: "rebase.keepBase-root",
3502
4588
  kind: "exclusive",
3503
- keys: ["apply", "exec"],
4589
+ keys: ["keepBase", "root"],
3504
4590
  origin: "git",
3505
4591
  reason: "Git rejects these simultaneous modes or operands.",
3506
4592
  source: git("builtin/rebase.c")
@@ -3520,6 +4606,24 @@ var COMMAND_CONSTRAINTS = {
3520
4606
  origin: "git",
3521
4607
  reason: "Root rebases cannot use fork-point detection.",
3522
4608
  source: git("builtin/rebase.c")
4609
+ },
4610
+ {
4611
+ id: "rebase.whitespace-value",
4612
+ kind: "value",
4613
+ key: "whitespace",
4614
+ allowed: ["", "nowarn", "warn", "error", "error-all", "fix", "strip"],
4615
+ origin: "git",
4616
+ reason: "cmd_rebase accepts only the git apply whitespace actions.",
4617
+ source: git("builtin/rebase.c")
4618
+ },
4619
+ {
4620
+ id: "rebase.empty-value",
4621
+ kind: "value",
4622
+ key: "empty",
4623
+ allowed: ["drop", "keep", "stop", "ask"],
4624
+ origin: "git",
4625
+ reason: "parse_empty_value accepts drop, keep, stop and the deprecated ask.",
4626
+ source: git("builtin/rebase.c")
3523
4627
  }
3524
4628
  ],
3525
4629
  restore: [
@@ -3563,6 +4667,33 @@ var COMMAND_CONSTRAINTS = {
3563
4667
  origin: "git",
3564
4668
  reason: "Git rejects these simultaneous modes or operands.",
3565
4669
  source: git("builtin/checkout.c")
4670
+ },
4671
+ {
4672
+ id: "restore.stage-merge",
4673
+ kind: "conflicts",
4674
+ when: active("merge"),
4675
+ others: [active("ours"), active("theirs")],
4676
+ origin: "git",
4677
+ reason: "Git rejects --ours or --theirs with --merge.",
4678
+ source: git("builtin/checkout.c")
4679
+ },
4680
+ {
4681
+ id: "restore.stage-conflict",
4682
+ kind: "conflicts",
4683
+ when: active("conflict"),
4684
+ others: [active("ours"), active("theirs")],
4685
+ origin: "git",
4686
+ reason: "A conflict style implies --merge, which Git rejects with --ours or --theirs.",
4687
+ source: git("builtin/checkout.c")
4688
+ },
4689
+ {
4690
+ id: "restore.ignoreUnmerged-merge",
4691
+ kind: "conflicts",
4692
+ when: active("ignoreUnmerged"),
4693
+ others: [active("merge"), active("conflict")],
4694
+ origin: "git",
4695
+ reason: "Git rejects --ignore-unmerged with --merge, which a conflict style implies.",
4696
+ source: git("builtin/checkout.c")
3566
4697
  }
3567
4698
  ],
3568
4699
  clean: [
@@ -3748,8 +4879,8 @@ var INPUT_CONSTRAINTS = {
3748
4879
  source: "https://github.com/git-lfs/git-lfs/blob/v3.8.0/commands/command_checkout.go"
3749
4880
  }
3750
4881
  ],
3751
- // repo.commit emits no paths. These stay runtime checks: modeling them in CommitOpts
3752
- // multiplies the compiler's work on every caller of the option type.
4882
+ // repo.commit emits no paths, and its fixup is a free string. These stay runtime checks:
4883
+ // modeling them in CommitOpts multiplies the compiler's work on every caller of the type.
3753
4884
  commitPaths: [
3754
4885
  {
3755
4886
  id: "commit.only-paths",
@@ -3762,7 +4893,6 @@ var INPUT_CONSTRAINTS = {
3762
4893
  { key: "fixup", test: "startsWith", value: "amend:" }
3763
4894
  ],
3764
4895
  origin: "git",
3765
- // Git 2.32+ also refuses amend with a plain fixup, but older Git accepts it.
3766
4896
  reason: "Only mode without paths requires allowEmpty, amend or an amend: fixup.",
3767
4897
  source: "https://github.com/git/git/blob/v2.55.0/builtin/commit.c"
3768
4898
  },
@@ -3778,6 +4908,99 @@ var INPUT_CONSTRAINTS = {
3778
4908
  origin: "git",
3779
4909
  reason: "A reword: fixup cannot include changed files.",
3780
4910
  source: "https://github.com/git/git/blob/v2.55.0/builtin/commit.c"
4911
+ },
4912
+ // Runtime checks: in CommitOpts these exceed the compiler's union budget.
4913
+ {
4914
+ id: "commit.fixup-suboption",
4915
+ kind: "scalar",
4916
+ key: "fixup",
4917
+ parser: "commit-fixup",
4918
+ origin: "git",
4919
+ reason: "A fixup suboption (letters before a colon) must be amend or reword.",
4920
+ source: "https://github.com/git/git/blob/v2.55.0/builtin/commit.c"
4921
+ },
4922
+ {
4923
+ id: "commit.reset-author-amend-fixup",
4924
+ kind: "forbid",
4925
+ when: [
4926
+ { key: "resetAuthor", test: "active" },
4927
+ { key: "amend", test: "active" },
4928
+ { key: "fixup", test: "nonempty" }
4929
+ ],
4930
+ origin: "git",
4931
+ reason: "With a fixup, amend reuses no message, so resetAuthor has nothing to reset.",
4932
+ source: "https://github.com/git/git/blob/v2.55.0/builtin/commit.c"
4933
+ },
4934
+ {
4935
+ id: "commit.fixup-amend-message",
4936
+ kind: "forbid",
4937
+ when: [
4938
+ { key: "fixup", test: "startsWith", value: "amend:" },
4939
+ { key: "message", test: "nonempty" }
4940
+ ],
4941
+ origin: "git",
4942
+ reason: "An amend: fixup takes its message from the amended commit, not from a message.",
4943
+ source: "https://github.com/git/git/blob/v2.55.0/builtin/commit.c"
4944
+ },
4945
+ {
4946
+ id: "commit.fixup-reword-message",
4947
+ kind: "forbid",
4948
+ when: [
4949
+ { key: "fixup", test: "startsWith", value: "reword:" },
4950
+ { key: "message", test: "nonempty" }
4951
+ ],
4952
+ origin: "git",
4953
+ reason: "A reword: fixup takes its message from the amended commit, not from a message.",
4954
+ source: "https://github.com/git/git/blob/v2.55.0/builtin/commit.c"
4955
+ },
4956
+ {
4957
+ id: "commit.author-ident",
4958
+ kind: "scalar",
4959
+ key: "author",
4960
+ parser: "commit-author",
4961
+ // repo.commit skips an empty author; dry runs return before determine_author_info.
4962
+ guard: [
4963
+ { key: "author", test: "nonempty" },
4964
+ { key: "dryRun", test: "inactive" }
4965
+ ],
4966
+ origin: "git",
4967
+ reason: "An author containing '>' must be 'Name <email>' with a nonempty name.",
4968
+ source: "https://github.com/git/git/blob/v2.55.0/builtin/commit.c"
4969
+ },
4970
+ {
4971
+ id: "commit.date",
4972
+ kind: "scalar",
4973
+ key: "date",
4974
+ parser: "commit-date",
4975
+ // repo.commit skips an empty date and converts a Date, which still needs a valid time.
4976
+ guard: [
4977
+ { key: "date", test: "present" },
4978
+ { key: "date", test: "notEquals", value: "" },
4979
+ { key: "dryRun", test: "inactive" }
4980
+ ],
4981
+ origin: "git",
4982
+ reason: "The date must be a Git date (parse_date or approxidate).",
4983
+ source: "https://github.com/git/git/blob/v2.55.0/builtin/commit.c"
4984
+ }
4985
+ ],
4986
+ restorePaths: [
4987
+ {
4988
+ id: "restore.paths",
4989
+ kind: "requiresAny",
4990
+ when: { key: "paths", test: "lengthEquals", value: 0 },
4991
+ // An empty pathspecFromFile is not emitted, so it does not count.
4992
+ choices: [{ key: "pathspecFromFile", test: "nonempty" }],
4993
+ origin: "git",
4994
+ reason: "Restore without patch mode needs paths or a pathspec file.",
4995
+ source: "https://github.com/git/git/blob/v2.55.0/builtin/checkout.c"
4996
+ },
4997
+ {
4998
+ id: "restore.source-empty",
4999
+ kind: "forbid",
5000
+ when: [{ key: "source", test: "equals", value: "" }],
5001
+ origin: "git",
5002
+ reason: "Git cannot resolve an empty --source tree-ish; omit source to restore from the index instead.",
5003
+ source: "https://github.com/git/git/blob/v2.55.0/builtin/checkout.c"
3781
5004
  }
3782
5005
  ],
3783
5006
  pathspec: [
@@ -3810,6 +5033,21 @@ var INPUT_CONSTRAINTS = {
3810
5033
  origin: "git",
3811
5034
  reason: "An empty switch target is never a valid reference or branch name, with or without create, force-create or orphan.",
3812
5035
  source: "https://github.com/git/git/blob/v2.55.0/builtin/checkout.c"
5036
+ },
5037
+ {
5038
+ id: "switch.track-start-point",
5039
+ kind: "scalar",
5040
+ key: "branch",
5041
+ parser: "track-start-point",
5042
+ guard: [
5043
+ { key: "track", test: "active" },
5044
+ { key: "create", test: "inactive" },
5045
+ { key: "forceCreate", test: "inactive" },
5046
+ { key: "orphan", test: "inactive" }
5047
+ ],
5048
+ origin: "git",
5049
+ reason: "--track without create, forceCreate or orphan names the new branch after the first '/' of the target (after refs/ and remotes/), which must leave a nonempty name.",
5050
+ source: "https://github.com/git/git/blob/v2.55.0/builtin/checkout.c"
3813
5051
  }
3814
5052
  ]
3815
5053
  };
@@ -3897,13 +5135,13 @@ function violations(rules, options, scalarContext) {
3897
5135
  return rules.filter((rule) => violates(rule, options, scalarContext));
3898
5136
  }
3899
5137
  function violates(rule, options, scalarContext) {
3900
- if (rule.nativeEmptyPickaxe && _optionalChain([scalarContext, 'optionalAccess', _28 => _28.emptyPickaxeRejected]) === false) {
5138
+ if (rule.nativeEmptyPickaxe && _optionalChain([scalarContext, 'optionalAccess', _40 => _40.emptyPickaxeRejected]) === false) {
3901
5139
  return false;
3902
5140
  }
3903
- if (rule.nativeWhatchangedOptIn && _optionalChain([scalarContext, 'optionalAccess', _29 => _29.whatchangedOptInRequired]) === false) {
5141
+ if (rule.nativeWhatchangedOptIn && _optionalChain([scalarContext, 'optionalAccess', _41 => _41.whatchangedOptInRequired]) === false) {
3904
5142
  return false;
3905
5143
  }
3906
- if (rule.nativePackRedundantOptIn && _optionalChain([scalarContext, 'optionalAccess', _30 => _30.packRedundantOptInRequired]) === false) {
5144
+ if (rule.nativePackRedundantOptIn && _optionalChain([scalarContext, 'optionalAccess', _42 => _42.packRedundantOptInRequired]) === false) {
3907
5145
  return false;
3908
5146
  }
3909
5147
  if (rule.guard && !rule.guard.every((p) => matches(p, options))) {
@@ -3941,8 +5179,18 @@ function violates(rule, options, scalarContext) {
3941
5179
  ));
3942
5180
  }
3943
5181
  case "elements": {
3944
- const items = options[rule.key];
3945
- return items !== void 0 && (!Array.isArray(items) || items.some((item) => !rule.allowed.includes(item)));
5182
+ const stored = options[rule.key];
5183
+ if (stored === void 0 && rule.withKey === void 0) {
5184
+ return false;
5185
+ }
5186
+ if (stored !== void 0 && !Array.isArray(stored)) {
5187
+ return true;
5188
+ }
5189
+ const items = [
5190
+ ..._nullishCoalesce(stored, () => ( [])),
5191
+ ...rule.withKey === void 0 ? [] : [options[rule.withKey]]
5192
+ ];
5193
+ return items.filter((item) => !rule.allowed.includes(item)).length > (_nullishCoalesce(rule.maxOutside, () => ( 0)));
3946
5194
  }
3947
5195
  case "eachScalar": {
3948
5196
  const items = options[rule.key];
@@ -3956,19 +5204,19 @@ function violates(rule, options, scalarContext) {
3956
5204
  rule.parser,
3957
5205
  options[rule.key],
3958
5206
  void 0,
3959
- _optionalChain([scalarContext, 'optionalAccess', _31 => _31.longBits]),
3960
- _optionalChain([scalarContext, 'optionalAccess', _32 => _32.sizeTBits]),
3961
- _optionalChain([scalarContext, 'optionalAccess', _33 => _33.binaryIntegers]),
3962
- _optionalChain([scalarContext, 'optionalAccess', _34 => _34.integerProfile]),
3963
- _optionalChain([scalarContext, 'optionalAccess', _35 => _35.negativeMagnitudes]),
3964
- _optionalChain([scalarContext, 'optionalAccess', _36 => _36.decimalCallbacks]),
3965
- _optionalChain([scalarContext, 'optionalAccess', _37 => _37.unsignedChar]),
3966
- _optionalChain([scalarContext, 'optionalAccess', _38 => _38.booleanSource]),
3967
- _optionalChain([scalarContext, 'optionalAccess', _39 => _39.booleanBinaryIntegers]),
3968
- _optionalChain([scalarContext, 'optionalAccess', _40 => _40.booleanCapabilities]),
3969
- _optionalChain([scalarContext, 'optionalAccess', _41 => _41.compoundNegatedOverflow]),
3970
- _optionalChain([scalarContext, 'optionalAccess', _42 => _42.depthAtoiBits]),
3971
- _optionalChain([scalarContext, 'optionalAccess', _43 => _43.combineEmptyComponents])
5207
+ _optionalChain([scalarContext, 'optionalAccess', _43 => _43.longBits]),
5208
+ _optionalChain([scalarContext, 'optionalAccess', _44 => _44.sizeTBits]),
5209
+ _optionalChain([scalarContext, 'optionalAccess', _45 => _45.binaryIntegers]),
5210
+ _optionalChain([scalarContext, 'optionalAccess', _46 => _46.integerProfile]),
5211
+ _optionalChain([scalarContext, 'optionalAccess', _47 => _47.negativeMagnitudes]),
5212
+ _optionalChain([scalarContext, 'optionalAccess', _48 => _48.decimalCallbacks]),
5213
+ _optionalChain([scalarContext, 'optionalAccess', _49 => _49.unsignedChar]),
5214
+ _optionalChain([scalarContext, 'optionalAccess', _50 => _50.booleanSource]),
5215
+ _optionalChain([scalarContext, 'optionalAccess', _51 => _51.booleanBinaryIntegers]),
5216
+ _optionalChain([scalarContext, 'optionalAccess', _52 => _52.booleanCapabilities]),
5217
+ _optionalChain([scalarContext, 'optionalAccess', _53 => _53.compoundNegatedOverflow]),
5218
+ _optionalChain([scalarContext, 'optionalAccess', _54 => _54.depthAtoiBits]),
5219
+ _optionalChain([scalarContext, 'optionalAccess', _55 => _55.combineEmptyComponents])
3972
5220
  ).valid;
3973
5221
  case "value":
3974
5222
  return options[rule.key] !== void 0 && !rule.allowed.some((v) => v === options[rule.key]);
@@ -4037,7 +5285,7 @@ function validatePathInput(name, paths, opts) {
4037
5285
  "pathspec",
4038
5286
  {
4039
5287
  paths: Array.isArray(paths) ? paths : [paths],
4040
- pathspecFromFile: _optionalChain([opts, 'optionalAccess', _44 => _44.pathspecFromFile]),
5288
+ pathspecFromFile: _optionalChain([opts, 'optionalAccess', _56 => _56.pathspecFromFile]),
4041
5289
  emptyPathspec: ""
4042
5290
  },
4043
5291
  name
@@ -4144,11 +5392,11 @@ function applyEnvOverride(env, override) {
4144
5392
  }
4145
5393
  }
4146
5394
  function validateIO(opts) {
4147
- validateEnv(_optionalChain([opts, 'optionalAccess', _45 => _45.env]));
4148
- if (_optionalChain([opts, 'optionalAccess', _46 => _46.stdout]) !== void 0 && opts.stdout !== "text" && opts.stdout !== "bytes") {
5395
+ validateEnv(_optionalChain([opts, 'optionalAccess', _57 => _57.env]));
5396
+ if (_optionalChain([opts, 'optionalAccess', _58 => _58.stdout]) !== void 0 && opts.stdout !== "text" && opts.stdout !== "bytes") {
4149
5397
  throw new GitArgumentError("stdout must be text or bytes");
4150
5398
  }
4151
- const input = _optionalChain([opts, 'optionalAccess', _47 => _47.stdin]);
5399
+ const input = _optionalChain([opts, 'optionalAccess', _59 => _59.stdin]);
4152
5400
  if (input !== void 0 && typeof input !== "string" && !(ArrayBuffer.isView(input) && Object.prototype.toString.call(input) === "[object Uint8Array]")) {
4153
5401
  throw new GitArgumentError("stdin must be a string or Uint8Array");
4154
5402
  }
@@ -4181,21 +5429,23 @@ var CliRunner = class _CliRunner {
4181
5429
 
4182
5430
 
4183
5431
 
5432
+
4184
5433
  constructor(adapters, options) {
4185
5434
  this.exec = adapters.exec;
4186
5435
  this.fs = adapters.fs;
4187
- this.gitBinary = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _48 => _48.gitBinary]), () => ( "git"));
5436
+ this.gitBinary = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _60 => _60.gitBinary]), () => ( "git"));
4188
5437
  this.companionBinaries = {
4189
- scalar: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _49 => _49.companionBinaries, 'optionalAccess', _50 => _50.scalar]), () => ( "scalar")),
4190
- gitk: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _51 => _51.companionBinaries, 'optionalAccess', _52 => _52.gitk]), () => ( "gitk")),
4191
- gitweb: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _53 => _53.companionBinaries, 'optionalAccess', _54 => _54.gitweb]), () => ( "gitweb.cgi"))
5438
+ scalar: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _61 => _61.companionBinaries, 'optionalAccess', _62 => _62.scalar]), () => ( "scalar")),
5439
+ gitk: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _63 => _63.companionBinaries, 'optionalAccess', _64 => _64.gitk]), () => ( "gitk")),
5440
+ gitweb: _nullishCoalesce(_optionalChain([options, 'optionalAccess', _65 => _65.companionBinaries, 'optionalAccess', _66 => _66.gitweb]), () => ( "gitweb.cgi"))
4192
5441
  };
4193
- this.baseEnv = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _55 => _55.env]), () => ( {}));
4194
- this.inheritEnv = _optionalChain([options, 'optionalAccess', _56 => _56.inheritEnv]);
4195
- this.pathPrefix = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _57 => _57.pathPrefix]), () => ( []));
4196
- this.home = _optionalChain([options, 'optionalAccess', _58 => _58.home]);
4197
- this.credential = _optionalChain([options, 'optionalAccess', _59 => _59.credential]);
4198
- this.audit = _optionalChain([options, 'optionalAccess', _60 => _60.audit]);
5442
+ this.baseEnv = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _67 => _67.env]), () => ( {}));
5443
+ this.inheritEnv = _optionalChain([options, 'optionalAccess', _68 => _68.inheritEnv]);
5444
+ this.pathPrefix = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _69 => _69.pathPrefix]), () => ( []));
5445
+ this.home = _optionalChain([options, 'optionalAccess', _70 => _70.home]);
5446
+ this.credential = _optionalChain([options, 'optionalAccess', _71 => _71.credential]);
5447
+ this.audit = _optionalChain([options, 'optionalAccess', _72 => _72.audit]);
5448
+ this.configOverrides = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _73 => _73.configOverrides]), () => ( []));
4199
5449
  }
4200
5450
  /**
4201
5451
  * Create a new CliRunner with additional options merged
@@ -4217,26 +5467,32 @@ var CliRunner = class _CliRunner {
4217
5467
  {
4218
5468
  gitBinary: _nullishCoalesce(options.gitBinary, () => ( this.gitBinary)),
4219
5469
  companionBinaries: {
4220
- scalar: _nullishCoalesce(_optionalChain([options, 'access', _61 => _61.companionBinaries, 'optionalAccess', _62 => _62.scalar]), () => ( this.companionBinaries.scalar)),
4221
- gitk: _nullishCoalesce(_optionalChain([options, 'access', _63 => _63.companionBinaries, 'optionalAccess', _64 => _64.gitk]), () => ( this.companionBinaries.gitk)),
4222
- gitweb: _nullishCoalesce(_optionalChain([options, 'access', _65 => _65.companionBinaries, 'optionalAccess', _66 => _66.gitweb]), () => ( this.companionBinaries.gitweb))
5470
+ scalar: _nullishCoalesce(_optionalChain([options, 'access', _74 => _74.companionBinaries, 'optionalAccess', _75 => _75.scalar]), () => ( this.companionBinaries.scalar)),
5471
+ gitk: _nullishCoalesce(_optionalChain([options, 'access', _76 => _76.companionBinaries, 'optionalAccess', _77 => _77.gitk]), () => ( this.companionBinaries.gitk)),
5472
+ gitweb: _nullishCoalesce(_optionalChain([options, 'access', _78 => _78.companionBinaries, 'optionalAccess', _79 => _79.gitweb]), () => ( this.companionBinaries.gitweb))
4223
5473
  },
4224
5474
  env: mergedEnv,
4225
5475
  inheritEnv,
4226
5476
  pathPrefix: mergedPathPrefix,
4227
5477
  home,
4228
5478
  credential,
4229
- audit
5479
+ audit,
5480
+ configOverrides: [...this.configOverrides, ..._nullishCoalesce(options.configOverrides, () => ( []))]
4230
5481
  }
4231
5482
  );
4232
5483
  }
5484
+ /** `key=value` pairs passed with `-c`: the credential helper, then the configured overrides. */
5485
+ configParameters() {
5486
+ const parameters = _optionalChain([this, 'access', _80 => _80.credential, 'optionalAccess', _81 => _81.helper]) ? [`credential.helper=${this.credential.helper}`] : [];
5487
+ return [...parameters, ...this.configOverrides];
5488
+ }
4233
5489
  /**
4234
5490
  * Build command argv based on execution context
4235
5491
  */
4236
5492
  buildArgv(context, args) {
4237
5493
  const argv = [this.gitBinary];
4238
- if (_optionalChain([this, 'access', _67 => _67.credential, 'optionalAccess', _68 => _68.helper])) {
4239
- argv.push("-c", `credential.helper=${this.credential.helper}`);
5494
+ for (const parameter of this.configParameters()) {
5495
+ argv.push("-c", parameter);
4240
5496
  }
4241
5497
  switch (context.type) {
4242
5498
  case "global":
@@ -4263,7 +5519,7 @@ var CliRunner = class _CliRunner {
4263
5519
  let inheritEnv = this.inheritEnv;
4264
5520
  if (executable === "gitk" && inheritEnv !== true && inheritEnv !== false && typeof inheritEnv !== "function") {
4265
5521
  const displayVariables = ["DISPLAY", "XAUTHORITY"];
4266
- inheritEnv = Array.isArray(inheritEnv) ? [...inheritEnv, ...displayVariables] : { ...inheritEnv, add: [..._nullishCoalesce(_optionalChain([inheritEnv, 'optionalAccess', _69 => _69.add]), () => ( [])), ...displayVariables] };
5522
+ inheritEnv = Array.isArray(inheritEnv) ? [...inheritEnv, ...displayVariables] : { ...inheritEnv, add: [..._nullishCoalesce(_optionalChain([inheritEnv, 'optionalAccess', _82 => _82.add]), () => ( [])), ...displayVariables] };
4267
5523
  }
4268
5524
  const env = {
4269
5525
  ...resolveInheritedEnv(_process2.default.env, inheritEnv, _process2.default.platform),
@@ -4274,7 +5530,7 @@ var CliRunner = class _CliRunner {
4274
5530
  env.USERPROFILE = this.home;
4275
5531
  }
4276
5532
  const allPathPrefixes = [...this.pathPrefix];
4277
- if (_optionalChain([this, 'access', _70 => _70.credential, 'optionalAccess', _71 => _71.helperPath])) {
5533
+ if (_optionalChain([this, 'access', _83 => _83.credential, 'optionalAccess', _84 => _84.helperPath])) {
4278
5534
  const helperDir = this.extractDirectory(this.credential.helperPath);
4279
5535
  if (helperDir) {
4280
5536
  allPathPrefixes.unshift(helperDir);
@@ -4287,7 +5543,7 @@ var CliRunner = class _CliRunner {
4287
5543
  const currentPath = _nullishCoalesce(env[pathKey], () => ( ""));
4288
5544
  env[pathKey] = [...allPathPrefixes, currentPath].join(separator);
4289
5545
  }
4290
- if (_optionalChain([this, 'access', _72 => _72.audit, 'optionalAccess', _73 => _73.onTrace]) && !internal) {
5546
+ if (_optionalChain([this, 'access', _85 => _85.audit, 'optionalAccess', _86 => _86.onTrace]) && !internal) {
4291
5547
  if (env.GIT_TRACE === void 0) {
4292
5548
  env.GIT_TRACE = "1";
4293
5549
  } else if (!env.GIT_TRACE || env.GIT_TRACE === "0") {
@@ -4331,7 +5587,7 @@ var CliRunner = class _CliRunner {
4331
5587
  if (context.type !== "global") {
4332
5588
  return await this.probe(context, args, opts);
4333
5589
  }
4334
- if (_optionalChain([opts, 'access', _74 => _74.signal, 'optionalAccess', _75 => _75.aborted])) {
5590
+ if (_optionalChain([opts, 'access', _87 => _87.signal, 'optionalAccess', _88 => _88.aborted])) {
4335
5591
  return { stdout: "", stderr: "", exitCode: -1, aborted: true };
4336
5592
  }
4337
5593
  const directory = this.fs.createTempDirectory ? await this.fs.createTempDirectory("type-git-probe-") : void 0;
@@ -4362,8 +5618,8 @@ var CliRunner = class _CliRunner {
4362
5618
  context,
4363
5619
  ["clone", "--depth=2147483648", "type-git-depth-profile:invalid", destination],
4364
5620
  {
4365
- ..._optionalChain([opts, 'optionalAccess', _76 => _76.env]) ? { env: opts.env } : {},
4366
- ..._optionalChain([opts, 'optionalAccess', _77 => _77.signal]) ? { signal: opts.signal } : {}
5621
+ ..._optionalChain([opts, 'optionalAccess', _89 => _89.env]) ? { env: opts.env } : {},
5622
+ ..._optionalChain([opts, 'optionalAccess', _90 => _90.signal]) ? { signal: opts.signal } : {}
4367
5623
  }
4368
5624
  );
4369
5625
  let bits;
@@ -4386,7 +5642,7 @@ var CliRunner = class _CliRunner {
4386
5642
  /** Check universally invalid input first, then only the native dimensions that affect validity. */
4387
5643
  async validateNativeOptions(context, name, options, opts) {
4388
5644
  validateIO(opts);
4389
- const depth = name === "clone" || name === "fetch" ? _optionalChain([options, 'optionalAccess', _78 => _78.depth]) : void 0;
5645
+ const depth = name === "clone" || name === "fetch" ? _optionalChain([options, 'optionalAccess', _91 => _91.depth]) : void 0;
4390
5646
  const depthValid = [32, 64].filter(
4391
5647
  (bits) => depth === void 0 || validInitialDepth(depth, bits)
4392
5648
  );
@@ -4418,7 +5674,7 @@ var CliRunner = class _CliRunner {
4418
5674
  }
4419
5675
  if (depth !== void 0 && depthValid.length === 1) {
4420
5676
  const observed = await this.observeDepthAtoi(context, opts);
4421
- if (_optionalChain([observed, 'access', _79 => _79.result, 'optionalAccess', _80 => _80.aborted])) {
5677
+ if (_optionalChain([observed, 'access', _92 => _92.result, 'optionalAccess', _93 => _93.aborted])) {
4422
5678
  throw this.mapError(observed.result, context, this.buildArgv(context, ["clone"]));
4423
5679
  }
4424
5680
  if (observed.bits !== void 0) {
@@ -4427,10 +5683,10 @@ var CliRunner = class _CliRunner {
4427
5683
  }
4428
5684
  }
4429
5685
  const probeOptions = {
4430
- ..._optionalChain([opts, 'optionalAccess', _81 => _81.env]) ? { env: opts.env } : {},
4431
- ..._optionalChain([opts, 'optionalAccess', _82 => _82.signal]) ? { signal: opts.signal } : {}
5686
+ ..._optionalChain([opts, 'optionalAccess', _94 => _94.env]) ? { env: opts.env } : {},
5687
+ ..._optionalChain([opts, 'optionalAccess', _95 => _95.signal]) ? { signal: opts.signal } : {}
4432
5688
  };
4433
- const filter = _optionalChain([options, 'optionalAccess', _83 => _83.filter]);
5689
+ const filter = _optionalChain([options, 'optionalAccess', _96 => _96.filter]);
4434
5690
  if (typeof filter === "string" && objectFilterUsesEmptyComponent(filter)) {
4435
5691
  const args = [...OBJECT_FILTER_EMPTY_PROBE];
4436
5692
  const probe = await this.probe(context, args, probeOptions);
@@ -4504,7 +5760,7 @@ var CliRunner = class _CliRunner {
4504
5760
  if (widths.aborted) {
4505
5761
  throw this.mapError(widths, context, this.buildArgv(context, args));
4506
5762
  }
4507
- const bytes = _optionalChain([/^sizeof-long: ([48])\r?$/m, 'access', _84 => _84.exec, 'call', _85 => _85(widths.stdout), 'optionalAccess', _86 => _86[1]]);
5763
+ const bytes = _optionalChain([/^sizeof-long: ([48])\r?$/m, 'access', _97 => _97.exec, 'call', _98 => _98(widths.stdout), 'optionalAccess', _99 => _99[1]]);
4508
5764
  if (widths.exitCode !== 0 || !bytes) {
4509
5765
  if (name === "cherryPick" || name === "revert") {
4510
5766
  return;
@@ -4544,10 +5800,10 @@ var CliRunner = class _CliRunner {
4544
5800
  }
4545
5801
  /** Validate per-call options, then spawn one Git or companion process and collect its result. */
4546
5802
  async execute(context, args, opts, binary, executable, internal = false) {
4547
- validateIO({ stdin: _optionalChain([opts, 'optionalAccess', _87 => _87.stdin]), env: _optionalChain([opts, 'optionalAccess', _88 => _88.env]) });
5803
+ validateIO({ stdin: _optionalChain([opts, 'optionalAccess', _100 => _100.stdin]), env: _optionalChain([opts, 'optionalAccess', _101 => _101.env]) });
4548
5804
  const argv = executable ? [this.companionBinaries[executable], ...args] : this.buildArgv(context, args);
4549
5805
  const { signal, onProgress, onLfsProgress, env: envOverride } = _nullishCoalesce(opts, () => ( {}));
4550
- if (_optionalChain([signal, 'optionalAccess', _89 => _89.aborted])) {
5806
+ if (_optionalChain([signal, 'optionalAccess', _102 => _102.aborted])) {
4551
5807
  return {
4552
5808
  stdout: binary ? new Uint8Array(0) : "",
4553
5809
  stderr: "",
@@ -4563,16 +5819,17 @@ var CliRunner = class _CliRunner {
4563
5819
  stripTraceEnv(env);
4564
5820
  }
4565
5821
  const audit = internal ? void 0 : this.audit;
4566
- if (executable && _optionalChain([this, 'access', _90 => _90.credential, 'optionalAccess', _91 => _91.helper])) {
5822
+ const parameters = executable ? this.configParameters() : [];
5823
+ if (parameters.length > 0) {
4567
5824
  const quote = (value) => `'${value.replace(/['!]/g, "'\\$&'")}'`;
4568
- const parameter = quote(`credential.helper=${this.credential.helper}`);
4569
- env.GIT_CONFIG_PARAMETERS = env.GIT_CONFIG_PARAMETERS ? `${env.GIT_CONFIG_PARAMETERS} ${parameter}` : parameter;
5825
+ const quoted = parameters.map(quote).join(" ");
5826
+ env.GIT_CONFIG_PARAMETERS = env.GIT_CONFIG_PARAMETERS ? `${env.GIT_CONFIG_PARAMETERS} ${quoted}` : quoted;
4570
5827
  }
4571
5828
  if (onLfsProgress) {
4572
5829
  env.GIT_LFS_FORCE_PROGRESS = "1";
4573
5830
  }
4574
5831
  const startTimestamp = Date.now();
4575
- if (_optionalChain([audit, 'optionalAccess', _92 => _92.onAudit])) {
5832
+ if (_optionalChain([audit, 'optionalAccess', _103 => _103.onAudit])) {
4576
5833
  audit.onAudit({
4577
5834
  type: "start",
4578
5835
  timestamp: startTimestamp,
@@ -4581,7 +5838,7 @@ var CliRunner = class _CliRunner {
4581
5838
  });
4582
5839
  }
4583
5840
  let stderrBuffer = "";
4584
- const needsStderrStreaming = onProgress || onLfsProgress || _optionalChain([audit, 'optionalAccess', _93 => _93.onTrace]);
5841
+ const needsStderrStreaming = onProgress || onLfsProgress || _optionalChain([audit, 'optionalAccess', _104 => _104.onTrace]);
4585
5842
  let result;
4586
5843
  try {
4587
5844
  const spawnProcess = binary ? this.exec.spawnBytes : this.exec.spawn;
@@ -4595,7 +5852,7 @@ var CliRunner = class _CliRunner {
4595
5852
  this.exec,
4596
5853
  {
4597
5854
  argv,
4598
- stdin: _optionalChain([opts, 'optionalAccess', _94 => _94.stdin]),
5855
+ stdin: _optionalChain([opts, 'optionalAccess', _105 => _105.stdin]),
4599
5856
  env,
4600
5857
  // The env above is already fully resolved (including any inherited variables),
4601
5858
  // so the adapter must not merge the parent environment on top of it.
@@ -4609,16 +5866,16 @@ var CliRunner = class _CliRunner {
4609
5866
  const lines = stderrBuffer.split(LINE_SEPARATOR_PATTERN);
4610
5867
  stderrBuffer = _nullishCoalesce(lines.pop(), () => ( ""));
4611
5868
  for (const line of lines) {
4612
- this.processStderrLine(line, onProgress, onLfsProgress, _optionalChain([audit, 'optionalAccess', _95 => _95.onTrace]));
5869
+ this.processStderrLine(line, onProgress, onLfsProgress, _optionalChain([audit, 'optionalAccess', _106 => _106.onTrace]));
4613
5870
  }
4614
5871
  }
4615
5872
  } : void 0
4616
5873
  );
4617
5874
  if (stderrBuffer.trim() && needsStderrStreaming) {
4618
- this.processStderrLine(stderrBuffer, onProgress, onLfsProgress, _optionalChain([audit, 'optionalAccess', _96 => _96.onTrace]));
5875
+ this.processStderrLine(stderrBuffer, onProgress, onLfsProgress, _optionalChain([audit, 'optionalAccess', _107 => _107.onTrace]));
4619
5876
  }
4620
5877
  } catch (error) {
4621
- if (_optionalChain([audit, 'optionalAccess', _97 => _97.onAudit])) {
5878
+ if (_optionalChain([audit, 'optionalAccess', _108 => _108.onAudit])) {
4622
5879
  const endTimestamp = Date.now();
4623
5880
  audit.onAudit({
4624
5881
  type: "end",
@@ -4628,7 +5885,7 @@ var CliRunner = class _CliRunner {
4628
5885
  stdout: "",
4629
5886
  stderr: error instanceof Error ? error.message : String(error),
4630
5887
  exitCode: -1,
4631
- aborted: _nullishCoalesce(_optionalChain([signal, 'optionalAccess', _98 => _98.aborted]), () => ( false)),
5888
+ aborted: _nullishCoalesce(_optionalChain([signal, 'optionalAccess', _109 => _109.aborted]), () => ( false)),
4632
5889
  duration: endTimestamp - startTimestamp
4633
5890
  });
4634
5891
  }
@@ -4636,7 +5893,7 @@ var CliRunner = class _CliRunner {
4636
5893
  throw error;
4637
5894
  }
4638
5895
  throw new GitError(
4639
- _optionalChain([signal, 'optionalAccess', _99 => _99.aborted]) ? "Aborted" : "SpawnFailed",
5896
+ _optionalChain([signal, 'optionalAccess', _110 => _110.aborted]) ? "Aborted" : "SpawnFailed",
4640
5897
  error instanceof Error ? error.message : String(error),
4641
5898
  {
4642
5899
  argv,
@@ -4644,7 +5901,7 @@ var CliRunner = class _CliRunner {
4644
5901
  }
4645
5902
  );
4646
5903
  }
4647
- if (_optionalChain([audit, 'optionalAccess', _100 => _100.onAudit])) {
5904
+ if (_optionalChain([audit, 'optionalAccess', _111 => _111.onAudit])) {
4648
5905
  const endTimestamp = Date.now();
4649
5906
  audit.onAudit({
4650
5907
  type: "end",
@@ -4740,12 +5997,12 @@ var CliRunner = class _CliRunner {
4740
5997
  extractErrorMessage(result) {
4741
5998
  const stderr = result.stderr.trim();
4742
5999
  const fatalMatch = stderr.match(FATAL_ERROR_PATTERN);
4743
- const fatalMessage = _optionalChain([fatalMatch, 'optionalAccess', _101 => _101[1]]);
6000
+ const fatalMessage = _optionalChain([fatalMatch, 'optionalAccess', _112 => _112[1]]);
4744
6001
  if (fatalMessage) {
4745
6002
  return fatalMessage;
4746
6003
  }
4747
6004
  const errorMatch = stderr.match(ERROR_PATTERN);
4748
- const errorMessage = _optionalChain([errorMatch, 'optionalAccess', _102 => _102[1]]);
6005
+ const errorMessage = _optionalChain([errorMatch, 'optionalAccess', _113 => _113[1]]);
4749
6006
  if (errorMessage) {
4750
6007
  return errorMessage;
4751
6008
  }
@@ -4819,4 +6076,6 @@ var CliRunner = class _CliRunner {
4819
6076
 
4820
6077
 
4821
6078
 
4822
- exports.nonEmpty = nonEmpty; exports.isNonEmpty = isNonEmpty; exports.GitError = GitError; exports.GitArgumentError = GitArgumentError; exports.asciiLower = asciiLower; exports.DECIMAL_CALLBACK_PROBES = DECIMAL_CALLBACK_PROBES; exports.decimalCallbackFamily = decimalCallbackFamily; exports.isCompoundDecimal = isCompoundDecimal; exports.isBooleanCallback = isBooleanCallback; exports.nativeCLongBits = nativeCLongBits; exports.nativeSizeTBits = nativeSizeTBits; exports.objectFilterUsesBinary = objectFilterUsesBinary; exports.objectFilterUsesNegativeMagnitude = objectFilterUsesNegativeMagnitude; exports.objectFilterUsesHighBytes = objectFilterUsesHighBytes; exports.objectFilterUsesEmptyComponent = objectFilterUsesEmptyComponent; exports.OBJECT_FILTER_EMPTY_PROBE = OBJECT_FILTER_EMPTY_PROBE; exports.objectFilterCombineEmptyComponents = objectFilterCombineEmptyComponents; exports.OBJECT_FILTER_CHAR_PROBE = OBJECT_FILTER_CHAR_PROBE; exports.objectFilterUnsignedChar = objectFilterUnsignedChar; exports.parseGitScalar = parseGitScalar; exports.matches = matches; exports.violations = violations; exports.validateOptions = validateOptions; exports.validateRevParseQuery = validateRevParseQuery; exports.validateRevParseRefOpts = validateRevParseRefOpts; exports.validatePathInput = validatePathInput; exports.validateInput = validateInput; exports.registerCommandHost = registerCommandHost; exports.commandHostOf = commandHostOf; exports.parseLines = parseLines; exports.parseRecords = parseRecords; exports.parseJson = parseJson; exports.parseKeyValue = parseKeyValue; exports.parsePorcelainV2 = parsePorcelainV2; exports.parseGitProgress = parseGitProgress; exports.parseLfsProgress = parseLfsProgress; exports.parseLsRemote = parseLsRemote; exports.parseLsTree = parseLsTree; exports.GIT_LOG_FORMAT = GIT_LOG_FORMAT; exports.parseGitLog = parseGitLog; exports.parseWorktreeList = parseWorktreeList; exports.detectErrorCategory = detectErrorCategory; exports.DEFAULT_ENV_ALLOWLIST = DEFAULT_ENV_ALLOWLIST; exports.resolveInheritedEnv = resolveInheritedEnv; exports.validateIO = validateIO; exports.cliRunnerInternals = cliRunnerInternals; exports.CliRunner = CliRunner;
6079
+
6080
+
6081
+ exports.nonEmpty = nonEmpty; exports.isNonEmpty = isNonEmpty; exports.GitError = GitError; exports.GitArgumentError = GitArgumentError; exports.asciiLower = asciiLower; exports.isBooleanCallback = isBooleanCallback; exports.validRefSortKey = validRefSortKey; exports.branchNameSyntax = branchNameSyntax; exports.DECIMAL_CALLBACK_PROBES = DECIMAL_CALLBACK_PROBES; exports.decimalCallbackFamily = decimalCallbackFamily; exports.isCompoundDecimal = isCompoundDecimal; exports.nativeCLongBits = nativeCLongBits; exports.nativeSizeTBits = nativeSizeTBits; exports.objectFilterUsesBinary = objectFilterUsesBinary; exports.objectFilterUsesNegativeMagnitude = objectFilterUsesNegativeMagnitude; exports.objectFilterUsesHighBytes = objectFilterUsesHighBytes; exports.objectFilterUsesEmptyComponent = objectFilterUsesEmptyComponent; exports.OBJECT_FILTER_EMPTY_PROBE = OBJECT_FILTER_EMPTY_PROBE; exports.objectFilterCombineEmptyComponents = objectFilterCombineEmptyComponents; exports.OBJECT_FILTER_CHAR_PROBE = OBJECT_FILTER_CHAR_PROBE; exports.objectFilterUnsignedChar = objectFilterUnsignedChar; exports.parseGitScalar = parseGitScalar; exports.matches = matches; exports.violations = violations; exports.validateOptions = validateOptions; exports.validateRevParseQuery = validateRevParseQuery; exports.validateRevParseRefOpts = validateRevParseRefOpts; exports.validatePathInput = validatePathInput; exports.validateInput = validateInput; exports.registerCommandHost = registerCommandHost; exports.commandHostOf = commandHostOf; exports.parseLines = parseLines; exports.parseRecords = parseRecords; exports.parseJson = parseJson; exports.parseKeyValue = parseKeyValue; exports.parsePorcelainV2 = parsePorcelainV2; exports.parseGitProgress = parseGitProgress; exports.parseLfsProgress = parseLfsProgress; exports.parseLsRemote = parseLsRemote; exports.parseLsTree = parseLsTree; exports.GIT_LOG_FORMAT = GIT_LOG_FORMAT; exports.parseGitLog = parseGitLog; exports.parseWorktreeList = parseWorktreeList; exports.detectErrorCategory = detectErrorCategory; exports.DEFAULT_ENV_ALLOWLIST = DEFAULT_ENV_ALLOWLIST; exports.resolveInheritedEnv = resolveInheritedEnv; exports.validateIO = validateIO; exports.cliRunnerInternals = cliRunnerInternals; exports.CliRunner = CliRunner;