type-git 0.8.1 → 0.8.2
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.
- package/dist/adapters/bun/index.cjs +8 -8
- package/dist/adapters/bun/index.d.cts +2 -2
- package/dist/adapters/bun/index.d.ts +2 -2
- package/dist/adapters/bun/index.js +2 -2
- package/dist/adapters/deno/index.cjs +8 -8
- package/dist/adapters/deno/index.d.cts +2 -2
- package/dist/adapters/deno/index.d.ts +2 -2
- package/dist/adapters/deno/index.js +2 -2
- package/dist/adapters/node/index.cjs +4 -4
- package/dist/adapters/node/index.d.cts +2 -2
- package/dist/adapters/node/index.d.ts +2 -2
- package/dist/adapters/node/index.js +3 -3
- package/dist/{chunk-JDCCYWIX.cjs → chunk-4K65HJ37.cjs} +7 -7
- package/dist/{chunk-ADC26634.js → chunk-RR5Q2UP2.js} +170 -124
- package/dist/{chunk-6HDMSFY7.cjs → chunk-RWKMVYO5.cjs} +16 -9
- package/dist/{chunk-UHZWPYTF.cjs → chunk-SKN5H7RX.cjs} +543 -497
- package/dist/{chunk-UAKOSACD.js → chunk-SXHFNCJZ.js} +16 -9
- package/dist/{chunk-S3EFBFVP.js → chunk-YCSKHC3M.js} +1 -1
- package/dist/{client.d-Cg5wWJnY.d.cts → client.d-C8wHgA_S.d.ts} +1 -1
- package/dist/{client.d-DCiFA_CK.d.ts → client.d-DVs3pi2e.d.cts} +1 -1
- package/dist/{git.d-DqAvRXEf.d.cts → git.d-CJUJ4264.d.cts} +31 -8
- package/dist/index.cjs +4 -4
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +3 -3
- package/dist/strict/index.cjs +99 -99
- package/dist/strict/index.d.cts +1 -1
- package/dist/strict/index.js +1 -1
- package/package.json +1 -1
package/dist/strict/index.cjs
CHANGED
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _chunkRWKMVYO5cjs = require('../chunk-RWKMVYO5.cjs');
|
|
25
25
|
|
|
26
26
|
// src/strict/command-runner.ts
|
|
27
27
|
var _process = require('process'); var _process2 = _interopRequireDefault(_process);
|
|
@@ -91,19 +91,19 @@ function guiGrammarFromSource(source) {
|
|
|
91
91
|
}
|
|
92
92
|
function guiArguments(spec, args, rootOptions) {
|
|
93
93
|
if (!Array.isArray(args)) {
|
|
94
|
-
throw new (0,
|
|
94
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)("Command arguments must be an array");
|
|
95
95
|
}
|
|
96
96
|
const words = [...spec.argv];
|
|
97
97
|
for (const arg of args) {
|
|
98
98
|
if (!Array.isArray(arg)) {
|
|
99
99
|
if (!arg || typeof arg !== "object" || !("operand" in arg) || typeof arg.operand !== "string" || arg.operand.includes("\0")) {
|
|
100
|
-
throw new (0,
|
|
100
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)("Expected a string operand without NUL");
|
|
101
101
|
}
|
|
102
102
|
words.push(arg.operand);
|
|
103
103
|
continue;
|
|
104
104
|
}
|
|
105
105
|
if (arg.length === 0 || arg.length > 2) {
|
|
106
|
-
throw new (0,
|
|
106
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)("Invalid GUI option tuple");
|
|
107
107
|
}
|
|
108
108
|
const flag = arg[0];
|
|
109
109
|
if (flag === "--" && arg.length === 1 && spec.separator) {
|
|
@@ -112,17 +112,17 @@ function guiArguments(spec, args, rootOptions) {
|
|
|
112
112
|
}
|
|
113
113
|
const options = spec.argv.length === 1 ? rootOptions : spec.options;
|
|
114
114
|
if (typeof flag !== "string" || !Object.hasOwn(options, flag)) {
|
|
115
|
-
throw new (0,
|
|
115
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`Unsupported GUI option: ${String(flag)}`);
|
|
116
116
|
}
|
|
117
117
|
const option = options[flag];
|
|
118
118
|
if (option.value === "flag") {
|
|
119
119
|
if (arg.length > 1 && arg[1] !== void 0) {
|
|
120
|
-
throw new (0,
|
|
120
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`${flag}: this flag takes no value`);
|
|
121
121
|
}
|
|
122
122
|
words.push(flag);
|
|
123
123
|
} else {
|
|
124
124
|
if (arg.length !== 2 || !Number.isSafeInteger(arg[1])) {
|
|
125
|
-
throw new (0,
|
|
125
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`${flag}: expected a safe integer`);
|
|
126
126
|
}
|
|
127
127
|
words.push(`${flag}=${arg[1]}`);
|
|
128
128
|
}
|
|
@@ -151,7 +151,7 @@ function validateGuiArguments(argv, grammar, launch) {
|
|
|
151
151
|
}
|
|
152
152
|
const operation = argv[0] === "citool" ? "citool" : _nullishCoalesce(words.shift(), () => ( "gui"));
|
|
153
153
|
const fail = () => {
|
|
154
|
-
throw new (0,
|
|
154
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`Invalid ${argv[0]} ${operation} argument syntax`);
|
|
155
155
|
};
|
|
156
156
|
if (operation === "gui" || operation === "pick" || operation === "citool") {
|
|
157
157
|
if (operation === "pick" && grammar === "path-loop") {
|
|
@@ -284,7 +284,7 @@ function initialParserPass(spec, argv, emptyRegistered = true, exit = spec.parse
|
|
|
284
284
|
}
|
|
285
285
|
const typo = (word) => {
|
|
286
286
|
if (word.length >= 3 && (word.startsWith("no-") || _optionalChain([longNames, 'optionalAccess', _24 => _24.some, 'call', _25 => _25((name) => name.startsWith(word))]))) {
|
|
287
|
-
throw new (0,
|
|
287
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`-${word}: Git requires two dashes for this option`);
|
|
288
288
|
}
|
|
289
289
|
};
|
|
290
290
|
let index = 0;
|
|
@@ -294,7 +294,7 @@ function initialParserPass(spec, argv, emptyRegistered = true, exit = spec.parse
|
|
|
294
294
|
if (word === "--" || word === "--end-of-options") {
|
|
295
295
|
literalOption ||= literalWord;
|
|
296
296
|
if (exit.mandatorySubcommand) {
|
|
297
|
-
throw new (0,
|
|
297
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)("Git requires a subcommand before the option boundary");
|
|
298
298
|
}
|
|
299
299
|
if (word === "--end-of-options" ? exit.keepEndOfOptions !== false : exit.keepDashDash) {
|
|
300
300
|
remaining.push(word);
|
|
@@ -309,7 +309,7 @@ function initialParserPass(spec, argv, emptyRegistered = true, exit = spec.parse
|
|
|
309
309
|
if (!word.startsWith("-") || word === "-") {
|
|
310
310
|
if (exit.mandatorySubcommand) {
|
|
311
311
|
if (!(spec.dispatch && Object.hasOwn(spec.dispatch, word))) {
|
|
312
|
-
throw new (0,
|
|
312
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`Unknown Git subcommand: ${word}`);
|
|
313
313
|
}
|
|
314
314
|
return result(
|
|
315
315
|
{ exited: false, tokens, remaining: argv.slice(index), subcommand: word },
|
|
@@ -330,11 +330,11 @@ function initialParserPass(spec, argv, emptyRegistered = true, exit = spec.parse
|
|
|
330
330
|
const forms = equal < 0 ? _optionalChain([exit, 'access', _26 => _26.longForms, 'optionalAccess', _27 => _27.plain]) : _optionalChain([exit, 'access', _28 => _28.longForms, 'optionalAccess', _29 => _29.attached]);
|
|
331
331
|
const flag = forms ? Object.hasOwn(forms, incoming) ? forms[incoming] : void 0 : incoming;
|
|
332
332
|
if (flag === null) {
|
|
333
|
-
throw new (0,
|
|
333
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`${incoming}: ambiguous option`);
|
|
334
334
|
}
|
|
335
335
|
if (!(flag && recognized.has(flag))) {
|
|
336
336
|
if (exit.unknownOptions === "error") {
|
|
337
|
-
throw new (0,
|
|
337
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`${incoming}: unknown option`);
|
|
338
338
|
}
|
|
339
339
|
remaining.push(word);
|
|
340
340
|
remainingFlags.push(literalWord);
|
|
@@ -349,7 +349,7 @@ function initialParserPass(spec, argv, emptyRegistered = true, exit = spec.parse
|
|
|
349
349
|
const option = spec.options[flag];
|
|
350
350
|
if (option.value === "flag") {
|
|
351
351
|
if (equal >= 0) {
|
|
352
|
-
throw new (0,
|
|
352
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`${flag}: this flag takes no value`);
|
|
353
353
|
}
|
|
354
354
|
tokens.push([flag]);
|
|
355
355
|
if (_optionalChain([onToken, 'optionalCall', _30 => _30(tokens[tokens.length - 1])])) {
|
|
@@ -368,7 +368,7 @@ function initialParserPass(spec, argv, emptyRegistered = true, exit = spec.parse
|
|
|
368
368
|
} else {
|
|
369
369
|
const value = argv[index++];
|
|
370
370
|
if (value === void 0) {
|
|
371
|
-
throw new (0,
|
|
371
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`${flag}: missing option value`);
|
|
372
372
|
}
|
|
373
373
|
tokens.push([flag, value]);
|
|
374
374
|
if (_optionalChain([onToken, 'optionalCall', _33 => _33(tokens[tokens.length - 1])])) {
|
|
@@ -390,7 +390,7 @@ function initialParserPass(spec, argv, emptyRegistered = true, exit = spec.parse
|
|
|
390
390
|
return help();
|
|
391
391
|
}
|
|
392
392
|
if (exit.unknownOptions === "error") {
|
|
393
|
-
throw new (0,
|
|
393
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`${flag}: unknown option`);
|
|
394
394
|
}
|
|
395
395
|
remaining.push(`-${cluster}`);
|
|
396
396
|
remainingFlags.push(literalWord);
|
|
@@ -422,7 +422,7 @@ function initialParserPass(spec, argv, emptyRegistered = true, exit = spec.parse
|
|
|
422
422
|
} else {
|
|
423
423
|
const value = argv[index++];
|
|
424
424
|
if (value === void 0) {
|
|
425
|
-
throw new (0,
|
|
425
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`${flag}: missing option value`);
|
|
426
426
|
}
|
|
427
427
|
tokens.push([flag, value]);
|
|
428
428
|
if (_optionalChain([onToken, 'optionalCall', _37 => _37(tokens[tokens.length - 1])])) {
|
|
@@ -438,7 +438,7 @@ function initialParserPass(spec, argv, emptyRegistered = true, exit = spec.parse
|
|
|
438
438
|
}
|
|
439
439
|
}
|
|
440
440
|
if (exit.mandatorySubcommand) {
|
|
441
|
-
throw new (0,
|
|
441
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)("Git requires a subcommand");
|
|
442
442
|
}
|
|
443
443
|
const postParseExit = exit.postParseBooleanExit;
|
|
444
444
|
if (postParseExit) {
|
|
@@ -490,7 +490,7 @@ function revisionParserPass(spec, argv, literal = []) {
|
|
|
490
490
|
const lookup = (flag) => Object.hasOwn(options, flag) ? options[flag] : void 0;
|
|
491
491
|
const typo = (word) => {
|
|
492
492
|
if (word.length >= 3 && (word.startsWith("no-") || _optionalChain([phase, 'access', _43 => _43.remainingLongNames, 'optionalAccess', _44 => _44.some, 'call', _45 => _45((name) => name.startsWith(word))]))) {
|
|
493
|
-
throw new (0,
|
|
493
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`-${word}: Git requires two dashes for this option`);
|
|
494
494
|
}
|
|
495
495
|
};
|
|
496
496
|
let index = 0;
|
|
@@ -520,7 +520,7 @@ function revisionParserPass(spec, argv, literal = []) {
|
|
|
520
520
|
const forms = equal < 0 ? phase.remainingLongForms.plain : phase.remainingLongForms.attached;
|
|
521
521
|
const canonical = Object.hasOwn(forms, incoming) ? forms[incoming] : void 0;
|
|
522
522
|
if (canonical === null) {
|
|
523
|
-
throw new (0,
|
|
523
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`${incoming}: ambiguous diff option`);
|
|
524
524
|
}
|
|
525
525
|
flag = _nullishCoalesce(canonical, () => ( ""));
|
|
526
526
|
}
|
|
@@ -528,18 +528,18 @@ function revisionParserPass(spec, argv, literal = []) {
|
|
|
528
528
|
if (option) {
|
|
529
529
|
if (word.startsWith("--") && equal >= 0) {
|
|
530
530
|
if (option.value === "flag" || option.separateValue) {
|
|
531
|
-
throw new (0,
|
|
531
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`${flag}: unexpected attached value`);
|
|
532
532
|
}
|
|
533
533
|
tokens.push([flag, word.slice(equal + 1)]);
|
|
534
534
|
} else if (option.value === "flag" || option.value.startsWith("optional-")) {
|
|
535
535
|
tokens.push([flag]);
|
|
536
536
|
} else {
|
|
537
537
|
if (flag.startsWith("--") && !_optionalChain([phase, 'access', _49 => _49.remainingDetachedOptions, 'optionalAccess', _50 => _50.includes, 'call', _51 => _51(flag)])) {
|
|
538
|
-
throw new (0,
|
|
538
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`${flag}: requires an attached value`);
|
|
539
539
|
}
|
|
540
540
|
const value = words[index++];
|
|
541
541
|
if (value === void 0) {
|
|
542
|
-
throw new (0,
|
|
542
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`${flag}: missing option value after initial parsing`);
|
|
543
543
|
}
|
|
544
544
|
tokens.push([flag, value]);
|
|
545
545
|
}
|
|
@@ -580,7 +580,7 @@ function revisionParserPass(spec, argv, literal = []) {
|
|
|
580
580
|
} else {
|
|
581
581
|
const value = words[index++];
|
|
582
582
|
if (value === void 0) {
|
|
583
|
-
throw new (0,
|
|
583
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`${short}: missing option value after initial parsing`);
|
|
584
584
|
}
|
|
585
585
|
tokens.push([short, value]);
|
|
586
586
|
}
|
|
@@ -596,7 +596,7 @@ function revisionParserPass(spec, argv, literal = []) {
|
|
|
596
596
|
tokens.push(["--"], ...argv.slice(boundary + 1).map((operand) => ({ operand })));
|
|
597
597
|
}
|
|
598
598
|
if (unknown) {
|
|
599
|
-
throw new (0,
|
|
599
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(unknown);
|
|
600
600
|
}
|
|
601
601
|
return literalOption ? { tokens, literalOption: true } : { tokens };
|
|
602
602
|
}
|
|
@@ -769,17 +769,17 @@ function dispatchArguments(spec, args) {
|
|
|
769
769
|
}
|
|
770
770
|
function validateArgvStrings(args) {
|
|
771
771
|
if (!Array.isArray(args)) {
|
|
772
|
-
throw new (0,
|
|
772
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)("Command arguments must be an array");
|
|
773
773
|
}
|
|
774
774
|
for (const token of args) {
|
|
775
775
|
if (Array.isArray(token)) {
|
|
776
776
|
for (const word of token) {
|
|
777
777
|
if (typeof word === "string" && word.includes(ARGV_STRING_CONSTRAINT.forbiddenCharacter)) {
|
|
778
|
-
throw new (0,
|
|
778
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)("NUL is not a valid CLI argument");
|
|
779
779
|
}
|
|
780
780
|
}
|
|
781
781
|
} else if (token && typeof token === "object" && "operand" in token && typeof token.operand === "string" && token.operand.includes(ARGV_STRING_CONSTRAINT.forbiddenCharacter)) {
|
|
782
|
-
throw new (0,
|
|
782
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)("Expected a string operand without NUL");
|
|
783
783
|
}
|
|
784
784
|
}
|
|
785
785
|
}
|
|
@@ -797,7 +797,7 @@ function commandArguments(command, args, inRepository, abi, guiGrammar, guiLaunc
|
|
|
797
797
|
function buildArguments(command, args, inRepository, abi, guiGrammar, guiLaunch, evaluationMode = "full", replay, specOverride, shapeOptions, operandIndexes, guard = false) {
|
|
798
798
|
let spec = _nullishCoalesce(specOverride, () => ( (Object.hasOwn(commandSpecs(), command) ? commandSpecs()[command] : void 0)));
|
|
799
799
|
if (!spec) {
|
|
800
|
-
throw new (0,
|
|
800
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`Unknown Git command: ${command}`);
|
|
801
801
|
}
|
|
802
802
|
validateArgvStrings(args);
|
|
803
803
|
const documentationDispatch = isDocumentationDispatch(spec, args);
|
|
@@ -932,7 +932,7 @@ function buildArguments(command, args, inRepository, abi, guiGrammar, guiLaunch,
|
|
|
932
932
|
}
|
|
933
933
|
}
|
|
934
934
|
const rejectLiteralOption = () => {
|
|
935
|
-
throw new (0,
|
|
935
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(
|
|
936
936
|
'Use an explicit ["--"] separator before an operand starting with a dash'
|
|
937
937
|
);
|
|
938
938
|
};
|
|
@@ -954,7 +954,7 @@ function buildArguments(command, args, inRepository, abi, guiGrammar, guiLaunch,
|
|
|
954
954
|
try {
|
|
955
955
|
pass = firstPass();
|
|
956
956
|
} catch (error) {
|
|
957
|
-
if (guard && error instanceof
|
|
957
|
+
if (guard && error instanceof _chunkRWKMVYO5cjs.GitArgumentError) {
|
|
958
958
|
return serialized;
|
|
959
959
|
}
|
|
960
960
|
throw error;
|
|
@@ -1115,15 +1115,15 @@ function buildArguments(command, args, inRepository, abi, guiGrammar, guiLaunch,
|
|
|
1115
1115
|
if (!Array.isArray(arg)) {
|
|
1116
1116
|
const operand = arg !== null && typeof arg === "object" && "operand" in arg ? arg.operand : void 0;
|
|
1117
1117
|
if (typeof operand !== "string" || operand.includes(ARGV_STRING_CONSTRAINT.forbiddenCharacter)) {
|
|
1118
|
-
throw new (0,
|
|
1118
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)("Expected a string operand without NUL");
|
|
1119
1119
|
}
|
|
1120
1120
|
if ((guard ? !(guardExited || guardEnded || guardLiteral) : !(parserExited || ended || literalOperands)) && spec.optionParsing !== "none" && !(spec.optionParsing === "stop-at-operand" && operands.length > 0) && operand.startsWith("-") && operand !== "-") {
|
|
1121
|
-
throw new (0,
|
|
1121
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(
|
|
1122
1122
|
'Use an explicit ["--"] separator before an operand starting with a dash'
|
|
1123
1123
|
);
|
|
1124
1124
|
}
|
|
1125
1125
|
if (spec.forwardedOperands && operands.length >= (_nullishCoalesce(spec.forwardedOperands.firstForwarded, () => ( 0))) && !(helpExited || (evaluationMode === "shape" ? guard && guardExited : parserExited)) && state.help !== true && operand.startsWith("-") && operand !== "-") {
|
|
1126
|
-
throw new (0,
|
|
1126
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(
|
|
1127
1127
|
`${command}: ${spec.forwardedOperands.reason} [forwarded operand ${JSON.stringify(operand)}]`
|
|
1128
1128
|
);
|
|
1129
1129
|
}
|
|
@@ -1136,13 +1136,13 @@ function buildArguments(command, args, inRepository, abi, guiGrammar, guiLaunch,
|
|
|
1136
1136
|
continue;
|
|
1137
1137
|
}
|
|
1138
1138
|
if (!(parserExited || replay && index >= replay.firstCount && arg[0] === "--" && arg.length === 1) && (literalOperands || spec.optionParsing === "stop-at-operand" && operands.length > 0)) {
|
|
1139
|
-
throw new (0,
|
|
1139
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(
|
|
1140
1140
|
`${command}: options must precede the first operand; use an operand object for literal words`
|
|
1141
1141
|
);
|
|
1142
1142
|
}
|
|
1143
1143
|
if (arg[0] === "--" && arg.length === 1) {
|
|
1144
1144
|
if (!parserExited && (!spec.separator || ended)) {
|
|
1145
|
-
throw new (0,
|
|
1145
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`${command}: unexpected end-of-options marker`);
|
|
1146
1146
|
}
|
|
1147
1147
|
if (spec.separator) {
|
|
1148
1148
|
guardEnded = true;
|
|
@@ -1153,11 +1153,11 @@ function buildArguments(command, args, inRepository, abi, guiGrammar, guiLaunch,
|
|
|
1153
1153
|
continue;
|
|
1154
1154
|
}
|
|
1155
1155
|
if (!parserExited && ended) {
|
|
1156
|
-
throw new (0,
|
|
1156
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`${command}: options cannot follow the end-of-options marker`);
|
|
1157
1157
|
}
|
|
1158
1158
|
const flag = arg[0];
|
|
1159
1159
|
if (typeof flag !== "string") {
|
|
1160
|
-
throw new (0,
|
|
1160
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`${command}: option names must be strings`);
|
|
1161
1161
|
}
|
|
1162
1162
|
const activeOptions = evaluationMode === "shape" && _optionalChain([spec, 'access', _95 => _95.parserExit, 'optionalAccess', _96 => _96.argumentOptions]) ? spec.parserExit.argumentOptions : replay && index >= replay.firstCount ? replay.options : spec.options;
|
|
1163
1163
|
const numeric = !Object.hasOwn(activeOptions, flag) && spec.numericOption && _optionalChain([/^-\d+$/, 'access', _97 => _97.exec, 'call', _98 => _98(flag), 'optionalAccess', _99 => _99[0]]) === flag;
|
|
@@ -1167,21 +1167,21 @@ function buildArguments(command, args, inRepository, abi, guiGrammar, guiLaunch,
|
|
|
1167
1167
|
set: typeof spec.numericOption.parser === "object" ? flag.slice(1) : Number(flag.slice(1))
|
|
1168
1168
|
} : void 0;
|
|
1169
1169
|
if (!option) {
|
|
1170
|
-
throw new (0,
|
|
1170
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`${command}: unknown option ${flag}`);
|
|
1171
1171
|
}
|
|
1172
1172
|
if (evaluationMode !== "shape" && !parserExited && option.nativeCapability === "submodule-init-alias" && _optionalChain([abi, 'optionalAccess', _100 => _100.submoduleInitAlias]) !== true) {
|
|
1173
|
-
throw new (0,
|
|
1173
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`${command}: ${flag} is unavailable in the selected helper`);
|
|
1174
1174
|
}
|
|
1175
1175
|
if (!parserExited && option.nativeReadTreeExclude && _optionalChain([abi, 'optionalAccess', _101 => _101.readTreeExclude]) === "legacy" && commandUsesReadTreeExclude(command, args)) {
|
|
1176
1176
|
if (readTreeExcludeSeen) {
|
|
1177
|
-
throw new (0,
|
|
1177
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)("--exclude-per-directory: repeated legacy callback");
|
|
1178
1178
|
}
|
|
1179
1179
|
readTreeExcludeSeen = true;
|
|
1180
1180
|
option = { ...option, checks: void 0, allowed: void 0 };
|
|
1181
1181
|
}
|
|
1182
1182
|
if (!parserExited && _optionalChain([abi, 'optionalAccess', _102 => _102.lsTreeModes]) === "bits" && commandUsesLsTreeModes(command, args)) {
|
|
1183
1183
|
if (option.nativeLsTreeModern) {
|
|
1184
|
-
throw new (0,
|
|
1184
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`${flag}: unavailable in the selected legacy ls-tree parser`);
|
|
1185
1185
|
}
|
|
1186
1186
|
if (option.nativeLsTreeMode) {
|
|
1187
1187
|
option = { ...option, modeGroup: void 0 };
|
|
@@ -1189,25 +1189,25 @@ function buildArguments(command, args, inRepository, abi, guiGrammar, guiLaunch,
|
|
|
1189
1189
|
}
|
|
1190
1190
|
const documentationHelp = option.key === "help" && spec.argv.length === 1 && Array.isArray(args[0]) && args[0].length === 1 && args[0][0] === "--help";
|
|
1191
1191
|
if (option.firstOnly && index !== 0 && !documentationHelp && !firstWordExited) {
|
|
1192
|
-
throw new (0,
|
|
1192
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`${command}: ${flag} must be the first argument`);
|
|
1193
1193
|
}
|
|
1194
1194
|
if (arg.length > 2) {
|
|
1195
|
-
throw new (0,
|
|
1195
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`${command}: ${flag} accepts at most one value`);
|
|
1196
1196
|
}
|
|
1197
1197
|
const supplied = arg.length === 2 && arg[1] !== void 0;
|
|
1198
1198
|
const rawValue = option.clear ? void 0 : supplied ? arg[1] : _nullishCoalesce(option.set, () => ( true));
|
|
1199
1199
|
if (typeof rawValue === "string" && rawValue.includes(ARGV_STRING_CONSTRAINT.forbiddenCharacter)) {
|
|
1200
|
-
throw new (0,
|
|
1200
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`${flag}: NUL is not a valid CLI argument`);
|
|
1201
1201
|
}
|
|
1202
1202
|
if (!parserExited && option.nativeEnumCallback === "conflict-style" && Array.isArray(args[0]) && args[0].length === 1 && _optionalChain([spec, 'access', _103 => _103.parserExit, 'optionalAccess', _104 => _104.exceptFirst, 'optionalAccess', _105 => _105.includes, 'call', _106 => _106(args[0][0])])) {
|
|
1203
|
-
throw new (0,
|
|
1203
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`${flag}: not an option of Git's help dispatcher`);
|
|
1204
1204
|
}
|
|
1205
1205
|
const deferredInteger = option.nativeIntegerTiming === "repack-max-pack-size" && _optionalChain([abi, 'optionalAccess', _107 => _107.repackMaxPackSize]) === "deferred" && commandUsesRepackMaxPackSize(command, args);
|
|
1206
1206
|
const integerParser = typeof option.parser === "object";
|
|
1207
1207
|
if (integerParser && supplied && !["string", "number", "bigint"].includes(typeof rawValue)) {
|
|
1208
|
-
throw new (0,
|
|
1208
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`${flag}: expected a number, bigint or numeric string`);
|
|
1209
1209
|
}
|
|
1210
|
-
const integer = integerParser && !parserExited && !deferredInteger ?
|
|
1210
|
+
const integer = integerParser && !parserExited && !deferredInteger ? _chunkRWKMVYO5cjs.parseGitScalar.call(void 0,
|
|
1211
1211
|
option.parser,
|
|
1212
1212
|
rawValue,
|
|
1213
1213
|
state[option.key],
|
|
@@ -1226,29 +1226,29 @@ function buildArguments(command, args, inRepository, abi, guiGrammar, guiLaunch,
|
|
|
1226
1226
|
_optionalChain([abi, 'optionalAccess', _120 => _120.combineEmptyComponents])
|
|
1227
1227
|
) : void 0;
|
|
1228
1228
|
if (integer && !integer.valid) {
|
|
1229
|
-
throw new (0,
|
|
1229
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`${flag}: invalid integer value ${String(rawValue)}`);
|
|
1230
1230
|
}
|
|
1231
1231
|
const value = integer ? integer.value : rawValue;
|
|
1232
1232
|
if (!parserExited && option.checks) {
|
|
1233
1233
|
const inputState = { ...state };
|
|
1234
1234
|
inputState.$value = value;
|
|
1235
1235
|
inputState.$remaining = args.slice(index + 1);
|
|
1236
|
-
const errors =
|
|
1236
|
+
const errors = _chunkRWKMVYO5cjs.violations.call(void 0, option.checks, inputState, abi);
|
|
1237
1237
|
if (errors.length > 0) {
|
|
1238
|
-
throw new (0,
|
|
1238
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(
|
|
1239
1239
|
`${flag}: ${errors.map((rule) => `[${rule.id}] ${rule.reason}`).join("; ")}`
|
|
1240
1240
|
);
|
|
1241
1241
|
}
|
|
1242
1242
|
}
|
|
1243
1243
|
if (!parserExited && (supplied || numeric) && !(option.nativeEnumCallback === "conflict-style" && _optionalChain([abi, 'optionalAccess', _121 => _121.conflictStyle]) === "deferred") && option.allowed && !option.allowed.includes(
|
|
1244
|
-
option.caseInsensitive && typeof value === "string" ?
|
|
1244
|
+
option.caseInsensitive && typeof value === "string" ? _chunkRWKMVYO5cjs.asciiLower.call(void 0, value) : value
|
|
1245
1245
|
)) {
|
|
1246
|
-
throw new (0,
|
|
1246
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`${flag}: unsupported option value ${String(value)}`);
|
|
1247
1247
|
}
|
|
1248
1248
|
if (!parserExited && option.modeGroup) {
|
|
1249
1249
|
const mode = value === false || value === void 0 ? false : option.modeFromValue ? value : _nullishCoalesce(option.modeValue, () => ( option.key));
|
|
1250
1250
|
if (modes.has(option.modeGroup) && modes.get(option.modeGroup) !== mode) {
|
|
1251
|
-
throw new (0,
|
|
1251
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`${flag}: incompatible command mode`);
|
|
1252
1252
|
}
|
|
1253
1253
|
if (mode !== false) {
|
|
1254
1254
|
modes.set(option.modeGroup, mode);
|
|
@@ -1257,18 +1257,18 @@ function buildArguments(command, args, inRepository, abi, guiGrammar, guiLaunch,
|
|
|
1257
1257
|
const start = argv.length;
|
|
1258
1258
|
if (option.value === "flag") {
|
|
1259
1259
|
if (supplied) {
|
|
1260
|
-
throw new (0,
|
|
1260
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`${flag}: this flag takes no value`);
|
|
1261
1261
|
}
|
|
1262
1262
|
argv.push(flag);
|
|
1263
1263
|
} else if (option.value === "boolean") {
|
|
1264
1264
|
if (typeof value !== "boolean") {
|
|
1265
|
-
throw new (0,
|
|
1265
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`${flag}: expected a boolean`);
|
|
1266
1266
|
}
|
|
1267
1267
|
argv.push(supplied ? `${flag}=${value}` : flag);
|
|
1268
1268
|
} else {
|
|
1269
1269
|
const optional = option.value.startsWith("optional-");
|
|
1270
1270
|
if (!(supplied || optional)) {
|
|
1271
|
-
throw new (0,
|
|
1271
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`${flag}: missing option value`);
|
|
1272
1272
|
}
|
|
1273
1273
|
if (supplied) {
|
|
1274
1274
|
const interpretedInteger = [
|
|
@@ -1280,15 +1280,15 @@ function buildArguments(command, args, inRepository, abi, guiGrammar, guiLaunch,
|
|
|
1280
1280
|
"fast-import-cat-blob-fd"
|
|
1281
1281
|
].includes(typeof option.parser === "string" ? option.parser : "");
|
|
1282
1282
|
if (option.value.endsWith("integer") && !integerParser && (interpretedInteger ? !["number", "string", "bigint"].includes(typeof value) : parserExited ? typeof value !== "number" : !Number.isSafeInteger(value))) {
|
|
1283
|
-
throw new (0,
|
|
1283
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(
|
|
1284
1284
|
`${flag}: expected ${interpretedInteger ? "integer text, number or bigint" : parserExited ? "a number" : "a safe integer"}`
|
|
1285
1285
|
);
|
|
1286
1286
|
}
|
|
1287
1287
|
if (option.value.endsWith("string") && typeof value !== "string") {
|
|
1288
|
-
throw new (0,
|
|
1288
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`${flag}: expected a string`);
|
|
1289
1289
|
}
|
|
1290
1290
|
if (String(value).includes(ARGV_STRING_CONSTRAINT.forbiddenCharacter)) {
|
|
1291
|
-
throw new (0,
|
|
1291
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`${flag}: NUL is not a valid CLI argument`);
|
|
1292
1292
|
}
|
|
1293
1293
|
if (optional && !flag.startsWith("--") && rawValue === "" && option.emptyValueFlag) {
|
|
1294
1294
|
argv.push(`${option.emptyValueFlag}=`);
|
|
@@ -1342,13 +1342,13 @@ function buildArguments(command, args, inRepository, abi, guiGrammar, guiLaunch,
|
|
|
1342
1342
|
continue;
|
|
1343
1343
|
}
|
|
1344
1344
|
if (option.rejectedWhenReached) {
|
|
1345
|
-
throw new (0,
|
|
1345
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`${flag}: ${option.rejectedWhenReached.reason}`);
|
|
1346
1346
|
}
|
|
1347
1347
|
if (evaluationMode !== "pipeline" && _optionalChain([spec, 'access', _146 => _146.parserExit, 'optionalAccess', _147 => _147.flags, 'access', _148 => _148.includes, 'call', _149 => _149(flag)]) && !(index === 0 && _optionalChain([spec, 'access', _150 => _150.parserExit, 'access', _151 => _151.exceptFirst, 'optionalAccess', _152 => _152.includes, 'call', _153 => _153(flag)]))) {
|
|
1348
1348
|
parserExited = true;
|
|
1349
1349
|
continue;
|
|
1350
1350
|
}
|
|
1351
|
-
const parsed = _nullishCoalesce(_nullishCoalesce((deferredInteger ? { valid: true, value } : void 0), () => ( integer)), () => ( (option.parser ?
|
|
1351
|
+
const parsed = _nullishCoalesce(_nullishCoalesce((deferredInteger ? { valid: true, value } : void 0), () => ( integer)), () => ( (option.parser ? _chunkRWKMVYO5cjs.parseGitScalar.call(void 0,
|
|
1352
1352
|
option.parser,
|
|
1353
1353
|
value,
|
|
1354
1354
|
state[option.key],
|
|
@@ -1370,7 +1370,7 @@ function buildArguments(command, args, inRepository, abi, guiGrammar, guiLaunch,
|
|
|
1370
1370
|
if (option.parserErrorKey) {
|
|
1371
1371
|
state[option.parserErrorKey] = true;
|
|
1372
1372
|
} else {
|
|
1373
|
-
throw new (0,
|
|
1373
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(`${flag}: invalid ${option.parser} value ${String(value)}`);
|
|
1374
1374
|
}
|
|
1375
1375
|
}
|
|
1376
1376
|
if (option.consumesRest) {
|
|
@@ -1401,11 +1401,11 @@ function buildArguments(command, args, inRepository, abi, guiGrammar, guiLaunch,
|
|
|
1401
1401
|
];
|
|
1402
1402
|
} else if (option.emptyIsUnset && _optionalChain([abi, 'optionalAccess', _169 => _169.filenameProfile]) === "optional" && typeof value === "string" && value.startsWith(":(optional)") && _optionalChain([abi, 'access', _170 => _170.ignoreOptionalFilename, 'optionalCall', _171 => _171(option.key, value)])) {
|
|
1403
1403
|
} else {
|
|
1404
|
-
state[option.key] = option.emptyIsUnset && value === "" && _optionalChain([abi, 'optionalAccess', _172 => _172.filenameProfile]) !== "legacy" ? void 0 : option.caseInsensitive && !option.preserveCase && typeof parsed.value === "string" ?
|
|
1404
|
+
state[option.key] = option.emptyIsUnset && value === "" && _optionalChain([abi, 'optionalAccess', _172 => _172.filenameProfile]) !== "legacy" ? void 0 : option.caseInsensitive && !option.preserveCase && typeof parsed.value === "string" ? _chunkRWKMVYO5cjs.asciiLower.call(void 0, parsed.value) : parsed.value;
|
|
1405
1405
|
}
|
|
1406
1406
|
for (const effect of option.nativeEnumCallback === "conflict-style" && _optionalChain([abi, 'optionalAccess', _173 => _173.conflictStyle]) === "deferred" ? [] : _nullishCoalesce(option.effects, () => ( []))) {
|
|
1407
1407
|
const previous = state[effect.key];
|
|
1408
|
-
if (!effect.when || ("all" in effect.when ? effect.when.all.every((predicate) =>
|
|
1408
|
+
if (!effect.when || ("all" in effect.when ? effect.when.all.every((predicate) => _chunkRWKMVYO5cjs.matches.call(void 0, predicate, state)) : "equals" in effect.when ? previous === effect.when.equals : previous !== effect.when.notEquals)) {
|
|
1409
1409
|
state[effect.key] = effect.set;
|
|
1410
1410
|
}
|
|
1411
1411
|
}
|
|
@@ -1422,7 +1422,7 @@ function buildArguments(command, args, inRepository, abi, guiGrammar, guiLaunch,
|
|
|
1422
1422
|
}
|
|
1423
1423
|
for (const option of Object.values(spec.options)) {
|
|
1424
1424
|
if (option.nativeEnumCallback === "conflict-style" && state[option.key] !== void 0 && !_optionalChain([option, 'access', _178 => _178.allowed, 'optionalAccess', _179 => _179.includes, 'call', _180 => _180(state[option.key])])) {
|
|
1425
|
-
throw new (0,
|
|
1425
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(
|
|
1426
1426
|
`--conflict: unsupported final option value ${String(state[option.key])}`
|
|
1427
1427
|
);
|
|
1428
1428
|
}
|
|
@@ -1431,14 +1431,14 @@ function buildArguments(command, args, inRepository, abi, guiGrammar, guiLaunch,
|
|
|
1431
1431
|
if (_optionalChain([abi, 'optionalAccess', _181 => _181.submoduleInitAlias]) && spec.argv.join(" ") === "submodule update") {
|
|
1432
1432
|
state["short-init"] = false;
|
|
1433
1433
|
}
|
|
1434
|
-
const errors =
|
|
1434
|
+
const errors = _chunkRWKMVYO5cjs.violations.call(void 0, spec.rules, state, abi);
|
|
1435
1435
|
if (errors.length > 0) {
|
|
1436
|
-
throw new (0,
|
|
1436
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(
|
|
1437
1437
|
`${command}: ${errors.map((rule) => `[${rule.id}] ${rule.reason}`).join("; ")}`
|
|
1438
1438
|
);
|
|
1439
1439
|
}
|
|
1440
1440
|
if (readTreeExcludeSeen && state.u !== true) {
|
|
1441
|
-
throw new (0,
|
|
1441
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)("--exclude-per-directory: legacy callback requires -u");
|
|
1442
1442
|
}
|
|
1443
1443
|
}
|
|
1444
1444
|
return argv;
|
|
@@ -1457,9 +1457,9 @@ function partitionRules(spec) {
|
|
|
1457
1457
|
});
|
|
1458
1458
|
}
|
|
1459
1459
|
function rejectPartitionRules(command, spec, partitionState) {
|
|
1460
|
-
const errors =
|
|
1460
|
+
const errors = _chunkRWKMVYO5cjs.violations.call(void 0, partitionRules(spec), { ...spec.initial, ...partitionState });
|
|
1461
1461
|
if (errors.length > 0) {
|
|
1462
|
-
throw new (0,
|
|
1462
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(
|
|
1463
1463
|
`${command}: ${errors.map((rule) => `[${rule.id}] ${rule.reason}`).join("; ")}`
|
|
1464
1464
|
);
|
|
1465
1465
|
}
|
|
@@ -1503,7 +1503,7 @@ function commandHasLegacyStashHelp(command, args, inRepository) {
|
|
|
1503
1503
|
keepDashDash: true
|
|
1504
1504
|
}).exited;
|
|
1505
1505
|
} catch (error) {
|
|
1506
|
-
if (error instanceof
|
|
1506
|
+
if (error instanceof _chunkRWKMVYO5cjs.GitArgumentError) {
|
|
1507
1507
|
return false;
|
|
1508
1508
|
}
|
|
1509
1509
|
throw error;
|
|
@@ -1634,7 +1634,7 @@ function commandUsesNativeABI(command, args, emptyRegistered = true) {
|
|
|
1634
1634
|
const option = Object.hasOwn(spec.options, arg[0]) ? spec.options[arg[0]] : spec.numericOption && _optionalChain([/^-\d+$/, 'access', _205 => _205.exec, 'call', _206 => _206(arg[0]), 'optionalAccess', _207 => _207[0]]) === arg[0] ? spec.numericOption : void 0;
|
|
1635
1635
|
const remaining = _optionalChain([spec, 'access', _208 => _208.parserExit, 'optionalAccess', _209 => _209.remainingOptions]);
|
|
1636
1636
|
const parser = _nullishCoalesce(_optionalChain([option, 'optionalAccess', _210 => _210.parser]), () => ( (remaining && Object.hasOwn(remaining, arg[0]) ? _optionalChain([remaining, 'access', _211 => _211[arg[0]], 'optionalAccess', _212 => _212.parser]) : void 0)));
|
|
1637
|
-
return typeof parser === "string" &&
|
|
1637
|
+
return typeof parser === "string" && _chunkRWKMVYO5cjs.isBooleanCallback.call(void 0, parser) || _optionalChain([option, 'optionalAccess', _213 => _213.nativeEnumCallback]) === "conflict-style" || typeof parser === "object" || parser === "abbrev" || parser === "mainline" || parser === "object-filter" || parser === "object-filter-auto" || parser === "unsigned-size" || _chunkRWKMVYO5cjs.isCompoundDecimal.call(void 0, parser);
|
|
1638
1638
|
});
|
|
1639
1639
|
}
|
|
1640
1640
|
function commandUsesObjectFilterBinary(command, args, emptyRegistered = true) {
|
|
@@ -1651,7 +1651,7 @@ function commandUsesObjectFilterBinary(command, args, emptyRegistered = true) {
|
|
|
1651
1651
|
return false;
|
|
1652
1652
|
}
|
|
1653
1653
|
const option = Object.hasOwn(spec.options, arg[0]) ? spec.options[arg[0]] : spec.numericOption && _optionalChain([/^-\d+$/, 'access', _214 => _214.exec, 'call', _215 => _215(arg[0]), 'optionalAccess', _216 => _216[0]]) === arg[0] ? spec.numericOption : void 0;
|
|
1654
|
-
return typeof _optionalChain([option, 'optionalAccess', _217 => _217.parser]) === "object" && option.parser.kind === "integer" && /^[ \t\r\n\v\f]*[+-]?0[bB]/.test(arg[1]) || (_optionalChain([option, 'optionalAccess', _218 => _218.parser]) === "object-filter" || _optionalChain([option, 'optionalAccess', _219 => _219.parser]) === "object-filter-auto") &&
|
|
1654
|
+
return typeof _optionalChain([option, 'optionalAccess', _217 => _217.parser]) === "object" && option.parser.kind === "integer" && /^[ \t\r\n\v\f]*[+-]?0[bB]/.test(arg[1]) || (_optionalChain([option, 'optionalAccess', _218 => _218.parser]) === "object-filter" || _optionalChain([option, 'optionalAccess', _219 => _219.parser]) === "object-filter-auto") && _chunkRWKMVYO5cjs.objectFilterUsesBinary.call(void 0, arg[1]) || (_optionalChain([option, 'optionalAccess', _220 => _220.parser]) === "pack-objects-index-version" || _optionalChain([option, 'optionalAccess', _221 => _221.parser]) === "index-pack-index-version") && /,[ \t\r\n\v\f]*[+-]?0[bB]/.test(arg[1]);
|
|
1655
1655
|
});
|
|
1656
1656
|
}
|
|
1657
1657
|
function commandUsesIntegerProfile(command, args, emptyRegistered = true) {
|
|
@@ -1689,7 +1689,7 @@ function commandUsesNegativeMagnitude(command, args, emptyRegistered = true) {
|
|
|
1689
1689
|
return false;
|
|
1690
1690
|
}
|
|
1691
1691
|
const parser = Object.hasOwn(spec.options, arg[0]) ? _optionalChain([spec, 'access', _225 => _225.options, 'access', _226 => _226[arg[0]], 'optionalAccess', _227 => _227.parser]) : spec.numericOption && _optionalChain([/^-\d+$/, 'access', _228 => _228.exec, 'call', _229 => _229(arg[0]), 'optionalAccess', _230 => _230[0]]) === arg[0] ? spec.numericOption.parser : void 0;
|
|
1692
|
-
return typeof parser === "object" && parser.kind === "integer" && !parser.signed && /^(?:[ \t\r\n\v\f]*-|[kKmMgG]$)/.test(String(arg[1])) || (parser === "object-filter" || parser === "object-filter-auto") && typeof arg[1] === "string" &&
|
|
1692
|
+
return typeof parser === "object" && parser.kind === "integer" && !parser.signed && /^(?:[ \t\r\n\v\f]*-|[kKmMgG]$)/.test(String(arg[1])) || (parser === "object-filter" || parser === "object-filter-auto") && typeof arg[1] === "string" && _chunkRWKMVYO5cjs.objectFilterUsesNegativeMagnitude.call(void 0, arg[1]);
|
|
1693
1693
|
});
|
|
1694
1694
|
}
|
|
1695
1695
|
function commandDecimalCallbacks(command, args, emptyRegistered = true) {
|
|
@@ -1735,7 +1735,7 @@ function commandUsesObjectFilterCharProfile(command, args, emptyRegistered = tru
|
|
|
1735
1735
|
return false;
|
|
1736
1736
|
}
|
|
1737
1737
|
const option = Object.hasOwn(spec.options, arg[0]) ? spec.options[arg[0]] : void 0;
|
|
1738
|
-
return (_optionalChain([option, 'optionalAccess', _236 => _236.parser]) === "object-filter" || _optionalChain([option, 'optionalAccess', _237 => _237.parser]) === "object-filter-auto") &&
|
|
1738
|
+
return (_optionalChain([option, 'optionalAccess', _236 => _236.parser]) === "object-filter" || _optionalChain([option, 'optionalAccess', _237 => _237.parser]) === "object-filter-auto") && _chunkRWKMVYO5cjs.objectFilterUsesHighBytes.call(void 0, arg[1]);
|
|
1739
1739
|
});
|
|
1740
1740
|
}
|
|
1741
1741
|
function commandUsesObjectFilterEmptyComponent(command, args, emptyRegistered = true) {
|
|
@@ -1753,7 +1753,7 @@ function commandUsesObjectFilterEmptyComponent(command, args, emptyRegistered =
|
|
|
1753
1753
|
return false;
|
|
1754
1754
|
}
|
|
1755
1755
|
const option = Object.hasOwn(spec.options, arg[0]) ? spec.options[arg[0]] : void 0;
|
|
1756
|
-
return (_optionalChain([option, 'optionalAccess', _238 => _238.parser]) === "object-filter" || _optionalChain([option, 'optionalAccess', _239 => _239.parser]) === "object-filter-auto") &&
|
|
1756
|
+
return (_optionalChain([option, 'optionalAccess', _238 => _238.parser]) === "object-filter" || _optionalChain([option, 'optionalAccess', _239 => _239.parser]) === "object-filter-auto") && _chunkRWKMVYO5cjs.objectFilterUsesEmptyComponent.call(void 0, arg[1]);
|
|
1757
1757
|
});
|
|
1758
1758
|
}
|
|
1759
1759
|
function commandUsesCompoundDecimal(command, args, emptyRegistered = true) {
|
|
@@ -1769,7 +1769,7 @@ function commandUsesCompoundDecimal(command, args, emptyRegistered = true) {
|
|
|
1769
1769
|
const option = Object.hasOwn(spec.options, arg[0]) ? spec.options[arg[0]] : void 0;
|
|
1770
1770
|
const remaining = _optionalChain([spec, 'access', _240 => _240.parserExit, 'optionalAccess', _241 => _241.remainingOptions]);
|
|
1771
1771
|
const parser = _nullishCoalesce(_optionalChain([option, 'optionalAccess', _242 => _242.parser]), () => ( (remaining && Object.hasOwn(remaining, arg[0]) ? _optionalChain([remaining, 'access', _243 => _243[arg[0]], 'optionalAccess', _244 => _244.parser]) : void 0)));
|
|
1772
|
-
return
|
|
1772
|
+
return _chunkRWKMVYO5cjs.isCompoundDecimal.call(void 0, parser) || typeof parser === "object" && parser !== null && parser.kind === "decimal" && parser.unsignedLong === true;
|
|
1773
1773
|
});
|
|
1774
1774
|
}
|
|
1775
1775
|
function commandUsesLsTreeModes(command, args) {
|
|
@@ -1852,7 +1852,7 @@ function commandUsesBooleanSource(command, args, emptyRegistered = true) {
|
|
|
1852
1852
|
return commandUsesBooleanSource(dispatched.command, dispatched.args, emptyRegistered);
|
|
1853
1853
|
}
|
|
1854
1854
|
return interpretedArguments(spec, args, emptyRegistered).some(
|
|
1855
|
-
(arg) => Array.isArray(arg) && typeof arg[0] === "string" && Object.hasOwn(spec.options, arg[0]) && typeof _optionalChain([spec, 'access', _248 => _248.options, 'access', _249 => _249[arg[0]], 'optionalAccess', _250 => _250.parser]) === "string" &&
|
|
1855
|
+
(arg) => Array.isArray(arg) && typeof arg[0] === "string" && Object.hasOwn(spec.options, arg[0]) && typeof _optionalChain([spec, 'access', _248 => _248.options, 'access', _249 => _249[arg[0]], 'optionalAccess', _250 => _250.parser]) === "string" && _chunkRWKMVYO5cjs.isBooleanCallback.call(void 0, spec.options[arg[0]].parser)
|
|
1856
1856
|
);
|
|
1857
1857
|
}
|
|
1858
1858
|
function commandUsesBooleanBinary(command, args, emptyRegistered = true) {
|
|
@@ -1862,7 +1862,7 @@ function commandUsesBooleanBinary(command, args, emptyRegistered = true) {
|
|
|
1862
1862
|
return commandUsesBooleanBinary(dispatched.command, dispatched.args, emptyRegistered);
|
|
1863
1863
|
}
|
|
1864
1864
|
return interpretedArguments(spec, args, emptyRegistered).some(
|
|
1865
|
-
(arg) => Array.isArray(arg) && typeof arg[0] === "string" && Object.hasOwn(spec.options, arg[0]) && typeof _optionalChain([spec, 'access', _251 => _251.options, 'access', _252 => _252[arg[0]], 'optionalAccess', _253 => _253.parser]) === "string" &&
|
|
1865
|
+
(arg) => Array.isArray(arg) && typeof arg[0] === "string" && Object.hasOwn(spec.options, arg[0]) && typeof _optionalChain([spec, 'access', _251 => _251.options, 'access', _252 => _252[arg[0]], 'optionalAccess', _253 => _253.parser]) === "string" && _chunkRWKMVYO5cjs.isBooleanCallback.call(void 0, spec.options[arg[0]].parser) && typeof arg[1] === "string" && /^[ \t\r\n\v\f]*[+-]?0[bB]/.test(arg[1])
|
|
1866
1866
|
);
|
|
1867
1867
|
}
|
|
1868
1868
|
function commandBooleanFeatures(command, args, emptyRegistered = true) {
|
|
@@ -1906,7 +1906,7 @@ function commandFilenameTokens(command, args, firstPassEmpty = true) {
|
|
|
1906
1906
|
const words = commandShapeArguments(command, args, true).slice(spec.argv.length);
|
|
1907
1907
|
initialParserPass(spec, words, firstPassEmpty, spec.parserExit, collect);
|
|
1908
1908
|
} catch (error) {
|
|
1909
|
-
if (!(error instanceof
|
|
1909
|
+
if (!(error instanceof _chunkRWKMVYO5cjs.GitArgumentError && updates.some(
|
|
1910
1910
|
(update) => typeof update.value === "string" && update.value.startsWith(":(optional)")
|
|
1911
1911
|
))) {
|
|
1912
1912
|
throw error;
|
|
@@ -1986,7 +1986,7 @@ function pickaxeEmptyRejected(result) {
|
|
|
1986
1986
|
var StrictCommandRunner = class {
|
|
1987
1987
|
|
|
1988
1988
|
constructor(runner) {
|
|
1989
|
-
this.runner =
|
|
1989
|
+
this.runner = _chunkRWKMVYO5cjs.cliRunnerInternals.call(void 0, runner);
|
|
1990
1990
|
}
|
|
1991
1991
|
/** Validate argv, observe only relevant native parser traits, and execute the original ordered words. */
|
|
1992
1992
|
async runCommand(context, command, args, inRepository, opts) {
|
|
@@ -1994,7 +1994,7 @@ var StrictCommandRunner = class {
|
|
|
1994
1994
|
}
|
|
1995
1995
|
/** Preserve the existing native ABI pipeline while selecting filename state independently. */
|
|
1996
1996
|
async runCommandWithFilename(context, command, args, inRepository, opts, filename, validateOnly = false) {
|
|
1997
|
-
|
|
1997
|
+
_chunkRWKMVYO5cjs.validateIO.call(void 0, opts);
|
|
1998
1998
|
validateArgvStrings(args);
|
|
1999
1999
|
const binary = _optionalChain([opts, 'optionalAccess', _263 => _263.stdout]) === "bytes";
|
|
2000
2000
|
const build = (name, tokens, repository, selectedAbi, grammar, launch) => commandArguments(
|
|
@@ -2002,8 +2002,8 @@ var StrictCommandRunner = class {
|
|
|
2002
2002
|
tokens,
|
|
2003
2003
|
repository,
|
|
2004
2004
|
command === "whatchanged" || command === "pack-redundant" ? {
|
|
2005
|
-
longBits:
|
|
2006
|
-
sizeTBits:
|
|
2005
|
+
longBits: _chunkRWKMVYO5cjs.nativeCLongBits.call(void 0, _process2.default.platform, _process2.default.arch),
|
|
2006
|
+
sizeTBits: _chunkRWKMVYO5cjs.nativeSizeTBits.call(void 0, _process2.default.arch),
|
|
2007
2007
|
...selectedAbi,
|
|
2008
2008
|
...filename,
|
|
2009
2009
|
// Preserve the selected executable's version-dependent deprecation
|
|
@@ -2108,7 +2108,7 @@ var StrictCommandRunner = class {
|
|
|
2108
2108
|
});
|
|
2109
2109
|
return true;
|
|
2110
2110
|
} catch (error) {
|
|
2111
|
-
if (!(error instanceof
|
|
2111
|
+
if (!(error instanceof _chunkRWKMVYO5cjs.GitArgumentError)) {
|
|
2112
2112
|
throw error;
|
|
2113
2113
|
}
|
|
2114
2114
|
return false;
|
|
@@ -2352,8 +2352,8 @@ var StrictCommandRunner = class {
|
|
|
2352
2352
|
}
|
|
2353
2353
|
}
|
|
2354
2354
|
let abi = lsTreeModes === void 0 && readTreeExclude === void 0 && repackMaxPackSize === void 0 && firstPassEmpty === void 0 && depthAtoiBits === void 0 && submoduleInitAlias === void 0 && emptyPickaxeRejected === void 0 ? void 0 : {
|
|
2355
|
-
longBits:
|
|
2356
|
-
sizeTBits:
|
|
2355
|
+
longBits: _chunkRWKMVYO5cjs.nativeCLongBits.call(void 0, _process2.default.platform, _process2.default.arch),
|
|
2356
|
+
sizeTBits: _chunkRWKMVYO5cjs.nativeSizeTBits.call(void 0, _process2.default.arch),
|
|
2357
2357
|
firstPassEmpty,
|
|
2358
2358
|
repackMaxPackSize,
|
|
2359
2359
|
readTreeExclude,
|
|
@@ -2438,7 +2438,7 @@ var StrictCommandRunner = class {
|
|
|
2438
2438
|
argv: build(command, args, inRepository, candidateAbi)
|
|
2439
2439
|
});
|
|
2440
2440
|
} catch (error) {
|
|
2441
|
-
if (!(error instanceof
|
|
2441
|
+
if (!(error instanceof _chunkRWKMVYO5cjs.GitArgumentError)) {
|
|
2442
2442
|
throw error;
|
|
2443
2443
|
}
|
|
2444
2444
|
firstError ??= error;
|
|
@@ -2695,13 +2695,13 @@ var StrictCommandRunner = class {
|
|
|
2695
2695
|
if ([...groups.values()].some((group) => group.size !== 2)) {
|
|
2696
2696
|
const probe = await this.runner.probe(
|
|
2697
2697
|
context,
|
|
2698
|
-
[...
|
|
2698
|
+
[..._chunkRWKMVYO5cjs.OBJECT_FILTER_CHAR_PROBE],
|
|
2699
2699
|
probeOptions
|
|
2700
2700
|
);
|
|
2701
2701
|
if (probe.aborted) {
|
|
2702
2702
|
return { ...probe, stdout: binary ? new Uint8Array(0) : probe.stdout };
|
|
2703
2703
|
}
|
|
2704
|
-
const observed =
|
|
2704
|
+
const observed = _chunkRWKMVYO5cjs.objectFilterUnsignedChar.call(void 0, probe);
|
|
2705
2705
|
if (observed === void 0) {
|
|
2706
2706
|
return await execute(valid[0].argv);
|
|
2707
2707
|
}
|
|
@@ -2736,13 +2736,13 @@ var StrictCommandRunner = class {
|
|
|
2736
2736
|
}
|
|
2737
2737
|
const probe = await this.runner.probe(
|
|
2738
2738
|
context,
|
|
2739
|
-
[...
|
|
2739
|
+
[..._chunkRWKMVYO5cjs.DECIMAL_CALLBACK_PROBES[callback]],
|
|
2740
2740
|
probeOptions
|
|
2741
2741
|
);
|
|
2742
2742
|
if (probe.aborted) {
|
|
2743
2743
|
return { ...probe, stdout: binary ? new Uint8Array(0) : probe.stdout };
|
|
2744
2744
|
}
|
|
2745
|
-
const family =
|
|
2745
|
+
const family = _chunkRWKMVYO5cjs.decimalCallbackFamily.call(void 0, callback, probe);
|
|
2746
2746
|
if (!family) {
|
|
2747
2747
|
return await execute(charValid[0].argv);
|
|
2748
2748
|
}
|
|
@@ -2852,7 +2852,7 @@ var StrictCommandRunner = class {
|
|
|
2852
2852
|
if (commandUsesDecimalCallback(command, traitArgs, firstPassEmpty) || commandUsesCompoundDecimal(command, traitArgs, firstPassEmpty)) {
|
|
2853
2853
|
return await execute(selectedValid[0].argv);
|
|
2854
2854
|
}
|
|
2855
|
-
throw new (0,
|
|
2855
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)(
|
|
2856
2856
|
"Cannot determine integer widths of the selected Git executable"
|
|
2857
2857
|
);
|
|
2858
2858
|
}
|
|
@@ -2889,13 +2889,13 @@ var StrictCommandRunner = class {
|
|
|
2889
2889
|
if (needsEmptyProfile) {
|
|
2890
2890
|
const profile = await this.runner.probe(
|
|
2891
2891
|
context,
|
|
2892
|
-
[...
|
|
2892
|
+
[..._chunkRWKMVYO5cjs.OBJECT_FILTER_EMPTY_PROBE],
|
|
2893
2893
|
probeOptions
|
|
2894
2894
|
);
|
|
2895
2895
|
if (profile.aborted) {
|
|
2896
2896
|
return { ...profile, stdout: binary ? new Uint8Array(0) : profile.stdout };
|
|
2897
2897
|
}
|
|
2898
|
-
const observed =
|
|
2898
|
+
const observed = _chunkRWKMVYO5cjs.objectFilterCombineEmptyComponents.call(void 0, profile);
|
|
2899
2899
|
if (observed === void 0) {
|
|
2900
2900
|
return await execute(build(command, args, inRepository, abi));
|
|
2901
2901
|
}
|
|
@@ -2917,12 +2917,12 @@ function strictCommandRunner(runner) {
|
|
|
2917
2917
|
|
|
2918
2918
|
// src/strict/index.ts
|
|
2919
2919
|
function strict(target) {
|
|
2920
|
-
const host =
|
|
2920
|
+
const host = _chunkRWKMVYO5cjs.commandHostOf.call(void 0, target);
|
|
2921
2921
|
if (host === void 0) {
|
|
2922
|
-
throw new (0,
|
|
2922
|
+
throw new (0, _chunkRWKMVYO5cjs.GitArgumentError)("strict() expects a Git client or repository created by type-git");
|
|
2923
2923
|
}
|
|
2924
2924
|
const command = async (name, args, opts) => {
|
|
2925
|
-
const current = _nullishCoalesce(
|
|
2925
|
+
const current = _nullishCoalesce(_chunkRWKMVYO5cjs.commandHostOf.call(void 0, target), () => ( host));
|
|
2926
2926
|
return await strictCommandRunner(current.runner).runCommand(
|
|
2927
2927
|
current.context,
|
|
2928
2928
|
name,
|