@digipair/skill-git 0.136.3 → 0.136.4

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/index.esm.js CHANGED
@@ -1,8 +1,8 @@
1
+ import { Buffer as Buffer$1 } from 'node:buffer';
1
2
  import require$$0$1 from 'fs';
2
3
  import require$$0 from 'tty';
3
4
  import require$$1 from 'util';
4
5
  import { spawn } from 'child_process';
5
- import { normalize } from 'node:path';
6
6
  import { EventEmitter } from 'node:events';
7
7
 
8
8
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -1119,1449 +1119,64 @@ var debug = /*@__PURE__*/getDefaultExportFromCjs(srcExports);
1119
1119
  __export(src$1);
1120
1120
  } (dist$1));
1121
1121
 
1122
- function _instanceof$1(left, right) {
1123
- if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
1124
- return !!right[Symbol.hasInstance](left);
1125
- } else {
1126
- return left instanceof right;
1127
- }
1128
- }
1129
- var t = /* @__PURE__ */ new WeakMap();
1130
- function c$1() {
1131
- for(var _len = arguments.length, n = new Array(_len), _key = 0; _key < _len; _key++){
1132
- n[_key] = arguments[_key];
1133
- }
1134
- var e = new String(n);
1135
- return t.set(e, n), e;
1136
- }
1137
- function r(n) {
1138
- return _instanceof$1(n, String) && t.has(n);
1139
- }
1140
- function o(n) {
1141
- var _t_get;
1142
- return (_t_get = t.get(n)) !== null && _t_get !== void 0 ? _t_get : [];
1143
- }
1144
-
1145
- var dist = {};
1146
-
1147
- Object.defineProperty(dist, "__esModule", {
1148
- value: true
1149
- });
1150
- var createDeferred = dist.createDeferred = deferred_1 = dist.deferred = void 0;
1151
- /**
1152
- * Creates a new `DeferredPromise`
1153
- *
1154
- * ```typescript
1155
- import {deferred} from '@kwsites/promise-deferred`;
1156
- ```
1157
- */ function deferred() {
1158
- var done;
1159
- var fail;
1160
- var status = 'pending';
1161
- var promise = new Promise(function(_done, _fail) {
1162
- done = _done;
1163
- fail = _fail;
1164
- });
1165
- return {
1166
- promise: promise,
1167
- done: function done1(result) {
1168
- if (status === 'pending') {
1169
- status = 'resolved';
1170
- done(result);
1171
- }
1172
- },
1173
- fail: function fail1(error) {
1174
- if (status === 'pending') {
1175
- status = 'rejected';
1176
- fail(error);
1177
- }
1178
- },
1179
- get fulfilled () {
1180
- return status !== 'pending';
1181
- },
1182
- get status () {
1183
- return status;
1184
- }
1185
- };
1186
- }
1187
- var deferred_1 = dist.deferred = deferred;
1188
- /**
1189
- * Alias of the exported `deferred` function, to help consumers wanting to use `deferred` as the
1190
- * local variable name rather than the factory import name, without needing to rename on import.
1191
- *
1192
- * ```typescript
1193
- import {createDeferred} from '@kwsites/promise-deferred`;
1194
- ```
1195
- */ createDeferred = dist.createDeferred = deferred;
1196
- /**
1197
- * Default export allows use as:
1198
- *
1199
- * ```typescript
1200
- import deferred from '@kwsites/promise-deferred`;
1201
- ```
1202
- */ dist.default = deferred;
1203
-
1204
- function _array_like_to_array$1(arr, len) {
1205
- if (len == null || len > arr.length) len = arr.length;
1206
- for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
1207
- return arr2;
1208
- }
1209
- function _array_with_holes$1(arr) {
1210
- if (Array.isArray(arr)) return arr;
1211
- }
1212
- function _array_without_holes$1(arr) {
1213
- if (Array.isArray(arr)) return _array_like_to_array$1(arr);
1214
- }
1215
- function _define_property$1(obj, key, value) {
1216
- if (key in obj) {
1217
- Object.defineProperty(obj, key, {
1218
- value: value,
1219
- enumerable: true,
1220
- configurable: true,
1221
- writable: true
1222
- });
1223
- } else {
1224
- obj[key] = value;
1225
- }
1226
- return obj;
1227
- }
1228
- function _iterable_to_array$1(iter) {
1229
- if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
1230
- }
1231
- function _iterable_to_array_limit$1(arr, i) {
1232
- var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
1233
- if (_i == null) return;
1234
- var _arr = [];
1235
- var _n = true;
1236
- var _d = false;
1237
- var _s, _e;
1238
- try {
1239
- for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
1240
- _arr.push(_s.value);
1241
- if (i && _arr.length === i) break;
1242
- }
1243
- } catch (err) {
1244
- _d = true;
1245
- _e = err;
1246
- } finally{
1247
- try {
1248
- if (!_n && _i["return"] != null) _i["return"]();
1249
- } finally{
1250
- if (_d) throw _e;
1251
- }
1252
- }
1253
- return _arr;
1254
- }
1255
- function _non_iterable_rest$1() {
1256
- throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1257
- }
1258
- function _non_iterable_spread$1() {
1259
- throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1260
- }
1261
- function _object_spread$1(target) {
1262
- for(var i = 1; i < arguments.length; i++){
1263
- var source = arguments[i] != null ? arguments[i] : {};
1264
- var ownKeys = Object.keys(source);
1265
- if (typeof Object.getOwnPropertySymbols === "function") {
1266
- ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
1267
- return Object.getOwnPropertyDescriptor(source, sym).enumerable;
1268
- }));
1269
- }
1270
- ownKeys.forEach(function(key) {
1271
- _define_property$1(target, key, source[key]);
1272
- });
1273
- }
1274
- return target;
1275
- }
1276
- function ownKeys$1(object, enumerableOnly) {
1277
- var keys = Object.keys(object);
1278
- if (Object.getOwnPropertySymbols) {
1279
- var symbols = Object.getOwnPropertySymbols(object);
1280
- keys.push.apply(keys, symbols);
1281
- }
1282
- return keys;
1283
- }
1284
- function _object_spread_props$1(target, source) {
1285
- source = source != null ? source : {};
1286
- if (Object.getOwnPropertyDescriptors) {
1287
- Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
1288
- } else {
1289
- ownKeys$1(Object(source)).forEach(function(key) {
1290
- Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
1291
- });
1292
- }
1293
- return target;
1294
- }
1295
- function _sliced_to_array$1(arr, i) {
1296
- return _array_with_holes$1(arr) || _iterable_to_array_limit$1(arr, i) || _unsupported_iterable_to_array$1(arr, i) || _non_iterable_rest$1();
1297
- }
1298
- function _to_consumable_array$1(arr) {
1299
- return _array_without_holes$1(arr) || _iterable_to_array$1(arr) || _unsupported_iterable_to_array$1(arr) || _non_iterable_spread$1();
1300
- }
1301
- function _unsupported_iterable_to_array$1(o, minLen) {
1302
- if (!o) return;
1303
- if (typeof o === "string") return _array_like_to_array$1(o, minLen);
1304
- var n = Object.prototype.toString.call(o).slice(8, -1);
1305
- if (n === "Object" && o.constructor) n = o.constructor.name;
1306
- if (n === "Map" || n === "Set") return Array.from(n);
1307
- if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array$1(o, minLen);
1308
- }
1309
- function _ts_generator$1(thisArg, body) {
1310
- var f, y, t, g, _ = {
1311
- label: 0,
1312
- sent: function() {
1313
- if (t[0] & 1) throw t[1];
1314
- return t[1];
1315
- },
1316
- trys: [],
1317
- ops: []
1318
- };
1319
- return g = {
1320
- next: verb(0),
1321
- "throw": verb(1),
1322
- "return": verb(2)
1323
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
1324
- return this;
1325
- }), g;
1326
- function verb(n) {
1327
- return function(v) {
1328
- return step([
1329
- n,
1330
- v
1331
- ]);
1332
- };
1333
- }
1334
- function step(op) {
1335
- if (f) throw new TypeError("Generator is already executing.");
1336
- while(_)try {
1337
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
1338
- if (y = 0, t) op = [
1339
- op[0] & 2,
1340
- t.value
1341
- ];
1342
- switch(op[0]){
1343
- case 0:
1344
- case 1:
1345
- t = op;
1346
- break;
1347
- case 4:
1348
- _.label++;
1349
- return {
1350
- value: op[1],
1351
- done: false
1352
- };
1353
- case 5:
1354
- _.label++;
1355
- y = op[1];
1356
- op = [
1357
- 0
1358
- ];
1359
- continue;
1360
- case 7:
1361
- op = _.ops.pop();
1362
- _.trys.pop();
1363
- continue;
1364
- default:
1365
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
1366
- _ = 0;
1367
- continue;
1368
- }
1369
- if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
1370
- _.label = op[1];
1371
- break;
1372
- }
1373
- if (op[0] === 6 && _.label < t[1]) {
1374
- _.label = t[1];
1375
- t = op;
1376
- break;
1377
- }
1378
- if (t && _.label < t[2]) {
1379
- _.label = t[2];
1380
- _.ops.push(op);
1381
- break;
1382
- }
1383
- if (t[2]) _.ops.pop();
1384
- _.trys.pop();
1385
- continue;
1386
- }
1387
- op = body.call(thisArg, _);
1388
- } catch (e) {
1389
- op = [
1390
- 6,
1391
- e
1392
- ];
1393
- y = 0;
1394
- } finally{
1395
- f = t = 0;
1396
- }
1397
- if (op[0] & 5) throw op[1];
1398
- return {
1399
- value: op[0] ? op[1] : void 0,
1400
- done: true
1401
- };
1402
- }
1403
- }
1404
- function U(e, t) {
1405
- var n, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, o, _tmp, err;
1406
- return _ts_generator$1(this, function(_state) {
1407
- switch(_state.label){
1408
- case 0:
1409
- n = t === "global";
1410
- _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
1411
- _state.label = 1;
1412
- case 1:
1413
- _state.trys.push([
1414
- 1,
1415
- 7,
1416
- 8,
1417
- 9
1418
- ]);
1419
- _iterator = e[Symbol.iterator]();
1420
- _state.label = 2;
1421
- case 2:
1422
- if (!!(_iteratorNormalCompletion = (_step = _iterator.next()).done)) return [
1423
- 3,
1424
- 6
1425
- ];
1426
- o = _step.value;
1427
- _tmp = o.isGlobal === n;
1428
- if (!_tmp) return [
1429
- 3,
1430
- 4
1431
- ];
1432
- return [
1433
- 4,
1434
- o
1435
- ];
1436
- case 3:
1437
- _tmp = _state.sent();
1438
- _state.label = 4;
1439
- case 4:
1440
- _state.label = 5;
1441
- case 5:
1442
- _iteratorNormalCompletion = true;
1443
- return [
1444
- 3,
1445
- 2
1446
- ];
1447
- case 6:
1448
- return [
1449
- 3,
1450
- 9
1451
- ];
1452
- case 7:
1453
- err = _state.sent();
1454
- _didIteratorError = true;
1455
- _iteratorError = err;
1456
- return [
1457
- 3,
1458
- 9
1459
- ];
1460
- case 8:
1461
- try {
1462
- if (!_iteratorNormalCompletion && _iterator.return != null) {
1463
- _iterator.return();
1464
- }
1465
- } finally{
1466
- if (_didIteratorError) {
1467
- throw _iteratorError;
1468
- }
1469
- }
1470
- return [
1471
- 7
1472
- ];
1473
- case 9:
1474
- return [
1475
- 2
1476
- ];
1477
- }
1478
- });
1479
- }
1480
- var k = /* @__PURE__ */ new Set([
1481
- "--add",
1482
- "--edit",
1483
- "--remove-section",
1484
- "--rename-section",
1485
- "--replace-all",
1486
- "--unset",
1487
- "--unset-all",
1488
- "-e"
1489
- ]), S = /* @__PURE__ */ new Set([
1490
- "--get",
1491
- "--get-all",
1492
- "--get-color",
1493
- "--get-colorbool",
1494
- "--get-regexp",
1495
- "--get-urlmatch",
1496
- "--list",
1497
- "-l"
1498
- ]), P = /* @__PURE__ */ new Set([
1499
- "edit",
1500
- "remove-section",
1501
- "rename-section",
1502
- "set",
1503
- "unset"
1504
- ]), E = /* @__PURE__ */ new Set([
1505
- "get",
1506
- "get-color",
1507
- "get-colorbool",
1508
- "list"
1509
- ]);
1510
- function F(e, t) {
1511
- var _t_at;
1512
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
1513
- try {
1514
- for(var _iterator = U(e, "task")[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
1515
- var _step_value = _step.value, o = _step_value.name;
1516
- if (k.has(o)) return p(!0, t);
1517
- if (S.has(o)) return p(!1, t);
1518
- }
1519
- } catch (err) {
1520
- _didIteratorError = true;
1521
- _iteratorError = err;
1522
- } finally{
1523
- try {
1524
- if (!_iteratorNormalCompletion && _iterator.return != null) {
1525
- _iterator.return();
1526
- }
1527
- } finally{
1528
- if (_didIteratorError) {
1529
- throw _iteratorError;
1530
- }
1531
- }
1532
- }
1533
- var n = (_t_at = t.at(0)) === null || _t_at === void 0 ? void 0 : _t_at.toLowerCase();
1534
- return n === void 0 ? null : P.has(n) ? p(true, t.slice(1)) : E.has(n) ? p(false, t.slice(1)) : t.length === 1 ? p(false, t) : p(true, t);
1535
- }
1536
- function p() {
1537
- var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false, t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
1538
- var _t_at;
1539
- var n = (_t_at = t.at(0)) === null || _t_at === void 0 ? void 0 : _t_at.toLowerCase();
1540
- return n === void 0 ? null : {
1541
- isWrite: e,
1542
- isRead: !e,
1543
- key: n,
1544
- value: t.at(1)
1545
- };
1546
- }
1547
- function A(e, t) {
1548
- return t.isWrite && t.value !== void 0 ? {
1549
- key: t.key,
1550
- value: t.value,
1551
- scope: e
1552
- } : {
1553
- key: t.key,
1554
- scope: e
1555
- };
1556
- }
1557
- function M(e) {
1558
- var t = (e === null || e === void 0 ? void 0 : e.indexOf("=")) || -1;
1559
- return !e || t < 0 ? null : {
1560
- key: e.slice(0, t).trim().toLowerCase(),
1561
- value: e.slice(t + 1)
1562
- };
1563
- }
1564
- function N(e) {
1565
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
1566
- try {
1567
- for(var _iterator = U(e, "task")[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
1568
- var _step_value = _step.value, t = _step_value.name;
1569
- switch(t){
1570
- case "--global":
1571
- return "global";
1572
- case "--system":
1573
- return "system";
1574
- case "--worktree":
1575
- return "worktree";
1576
- case "--local":
1577
- return "local";
1578
- case "--file":
1579
- case "-f":
1580
- return "file";
1581
- }
1582
- }
1583
- } catch (err) {
1584
- _didIteratorError = true;
1585
- _iteratorError = err;
1586
- } finally{
1587
- try {
1588
- if (!_iteratorNormalCompletion && _iterator.return != null) {
1589
- _iterator.return();
1590
- }
1591
- } finally{
1592
- if (_didIteratorError) {
1593
- throw _iteratorError;
1594
- }
1595
- }
1596
- }
1597
- return "local";
1598
- }
1599
- function G(param) {
1600
- var e = param.name;
1601
- if (e === "-c" || e === "--config") return "inline";
1602
- if (e === "--config-env") return "env";
1603
- }
1604
- function O(e) {
1605
- var _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, t, n, o, _tmp, err;
1606
- return _ts_generator$1(this, function(_state) {
1607
- switch(_state.label){
1608
- case 0:
1609
- _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
1610
- _state.label = 1;
1611
- case 1:
1612
- _state.trys.push([
1613
- 1,
1614
- 7,
1615
- 8,
1616
- 9
1617
- ]);
1618
- _iterator = e[Symbol.iterator]();
1619
- _state.label = 2;
1620
- case 2:
1621
- if (!!(_iteratorNormalCompletion = (_step = _iterator.next()).done)) return [
1622
- 3,
1623
- 6
1624
- ];
1625
- t = _step.value;
1626
- n = G(t), o = n && M(t.value);
1627
- _tmp = o;
1628
- if (!_tmp) return [
1629
- 3,
1630
- 4
1631
- ];
1632
- return [
1633
- 4,
1634
- _object_spread_props$1(_object_spread$1({}, o), {
1635
- scope: n
1636
- })
1637
- ];
1638
- case 3:
1639
- _tmp = _state.sent();
1640
- _state.label = 4;
1641
- case 4:
1642
- _state.label = 5;
1643
- case 5:
1644
- _iteratorNormalCompletion = true;
1645
- return [
1646
- 3,
1647
- 2
1648
- ];
1649
- case 6:
1650
- return [
1651
- 3,
1652
- 9
1653
- ];
1654
- case 7:
1655
- err = _state.sent();
1656
- _didIteratorError = true;
1657
- _iteratorError = err;
1658
- return [
1659
- 3,
1660
- 9
1661
- ];
1662
- case 8:
1663
- try {
1664
- if (!_iteratorNormalCompletion && _iterator.return != null) {
1665
- _iterator.return();
1666
- }
1667
- } finally{
1668
- if (_didIteratorError) {
1669
- throw _iteratorError;
1670
- }
1671
- }
1672
- return [
1673
- 7
1674
- ];
1675
- case 9:
1676
- return [
1677
- 2
1678
- ];
1679
- }
1680
- });
1681
- }
1682
- function L(e, t, n) {
1683
- var o = {
1684
- read: [],
1685
- write: _to_consumable_array$1(O(t))
1686
- };
1687
- return e === "config" && $(o, N(t), F(t, n)), o;
1688
- }
1689
- function $(e, t, n) {
1690
- if (n === null) return;
1691
- var o = A(t, n);
1692
- n.isWrite ? e.write.push(o) : e.read.push(o);
1693
- }
1694
- var x = {
1695
- short: /* @__PURE__ */ new Map([
1696
- [
1697
- "c",
1698
- true
1699
- ]
1700
- ])
1701
- }, D = {
1702
- short: new Map([
1703
- [
1704
- "C",
1705
- true
1706
- ],
1707
- // -C <path> change working directory
1708
- [
1709
- "P",
1710
- false
1711
- ],
1712
- // -P no pager (alias for --no-pager)
1713
- [
1714
- "h",
1715
- false
1716
- ],
1717
- // -h help
1718
- [
1719
- "p",
1720
- false
1721
- ],
1722
- // -p paginate
1723
- [
1724
- "v",
1725
- false
1726
- ]
1727
- ].concat(// -v version
1728
- _to_consumable_array$1(x.short.entries()))),
1729
- long: /* @__PURE__ */ new Set([
1730
- "attr-source",
1731
- "config-env",
1732
- "exec-path",
1733
- "git-dir",
1734
- "list-cmds",
1735
- "namespace",
1736
- "super-prefix",
1737
- "work-tree"
1738
- ])
1739
- }, R = {
1740
- clone: {
1741
- short: /* @__PURE__ */ new Map([
1742
- [
1743
- "b",
1744
- true
1745
- ],
1746
- // -b <branch>
1747
- [
1748
- "j",
1749
- true
1750
- ],
1751
- // -j <n> parallel jobs
1752
- [
1753
- "l",
1754
- false
1755
- ],
1756
- // -l local
1757
- [
1758
- "n",
1759
- false
1760
- ],
1761
- // -n no-checkout
1762
- [
1763
- "o",
1764
- true
1765
- ],
1766
- // -o <name> remote name
1767
- [
1768
- "q",
1769
- false
1770
- ],
1771
- // -q quiet
1772
- [
1773
- "s",
1774
- false
1775
- ],
1776
- // -s shared
1777
- [
1778
- "u",
1779
- true
1780
- ]
1781
- ]),
1782
- long: /* @__PURE__ */ new Set([
1783
- "branch",
1784
- "config",
1785
- "jobs",
1786
- "origin",
1787
- "upload-pack",
1788
- "u",
1789
- "template"
1790
- ])
1791
- },
1792
- commit: {
1793
- short: /* @__PURE__ */ new Map([
1794
- [
1795
- "C",
1796
- true
1797
- ],
1798
- // -C <commit> reuse message
1799
- [
1800
- "F",
1801
- true
1802
- ],
1803
- // -F <file> read message from file
1804
- [
1805
- "c",
1806
- true
1807
- ],
1808
- // -c <commit> reedit message
1809
- [
1810
- "m",
1811
- true
1812
- ],
1813
- // -m <msg>
1814
- [
1815
- "t",
1816
- true
1817
- ]
1818
- ]),
1819
- long: /* @__PURE__ */ new Set([
1820
- "file",
1821
- "message",
1822
- "reedit-message",
1823
- "reuse-message",
1824
- "template"
1825
- ])
1826
- },
1827
- config: {
1828
- short: /* @__PURE__ */ new Map([
1829
- [
1830
- "e",
1831
- false
1832
- ],
1833
- // -e open editor
1834
- [
1835
- "f",
1836
- true
1837
- ],
1838
- // -f <file>
1839
- [
1840
- "l",
1841
- false
1842
- ]
1843
- ]),
1844
- long: /* @__PURE__ */ new Set([
1845
- "blob",
1846
- "comment",
1847
- "default",
1848
- "file",
1849
- "type",
1850
- "value"
1851
- ])
1852
- },
1853
- fetch: {
1854
- short: /* @__PURE__ */ new Map(),
1855
- long: /* @__PURE__ */ new Set([
1856
- "upload-pack"
1857
- ])
1858
- },
1859
- init: {
1860
- short: /* @__PURE__ */ new Map(),
1861
- long: /* @__PURE__ */ new Set([
1862
- "template"
1863
- ])
1864
- },
1865
- pull: {
1866
- short: /* @__PURE__ */ new Map(),
1867
- long: /* @__PURE__ */ new Set([
1868
- "upload-pack"
1869
- ])
1870
- },
1871
- push: {
1872
- short: /* @__PURE__ */ new Map(),
1873
- long: /* @__PURE__ */ new Set([
1874
- "exec",
1875
- "receive-pack"
1876
- ])
1877
- }
1878
- }, T = {
1879
- short: /* @__PURE__ */ new Map(),
1880
- long: /* @__PURE__ */ new Set()
1881
- };
1882
- function I(e) {
1883
- var _R_;
1884
- var t = (_R_ = R[e !== null && e !== void 0 ? e : ""]) !== null && _R_ !== void 0 ? _R_ : T;
1885
- return {
1886
- short: new Map(_to_consumable_array$1(x.short.entries()).concat(_to_consumable_array$1(t.short.entries()))),
1887
- long: t.long
1888
- };
1889
- }
1890
- function b(e) {
1891
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : D;
1892
- if (e.startsWith("--")) {
1893
- var n = e.indexOf("=");
1894
- if (n > 2) return [
1895
- {
1896
- name: e.slice(0, n),
1897
- value: e.slice(n + 1),
1898
- needsNext: false
1899
- }
1900
- ];
1901
- var o = e.slice(2);
1902
- return [
1903
- {
1904
- name: e,
1905
- needsNext: t.long.has(o)
1906
- }
1907
- ];
1908
- }
1909
- if (e.length === 2) {
1910
- var n1 = e.charAt(1), o1 = t.short.get(n1);
1911
- return [
1912
- {
1913
- name: e,
1914
- needsNext: o1 === true
1915
- }
1916
- ];
1917
- }
1918
- return W(e, t.short);
1919
- }
1920
- function W(e, t) {
1921
- var n = e.slice(1).split(""), o = [];
1922
- for(var s = 0; s < n.length; s++){
1923
- var r = n[s], l = t.get(r);
1924
- if (l === void 0) return [
1925
- {
1926
- name: e,
1927
- needsNext: false
1928
- }
1929
- ];
1930
- if (l) {
1931
- var a = n.slice(s + 1).join("");
1932
- if (a && !_to_consumable_array$1(a).every(function(w) {
1933
- return t.has(w);
1934
- })) return o.push({
1935
- name: "-".concat(r),
1936
- value: a,
1937
- needsNext: false
1938
- }), o;
1939
- }
1940
- o.push({
1941
- name: "-".concat(r),
1942
- needsNext: l
1943
- });
1944
- }
1945
- return o;
1946
- }
1947
- function j(e) {
1948
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
1949
- var n = 0;
1950
- for(; n < e.length;){
1951
- var o = String(e[n]);
1952
- if (!o.startsWith("-") || o.length < 2) break;
1953
- var s = b(o);
1954
- var r = n + 1;
1955
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
1956
- try {
1957
- for(var _iterator = s[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
1958
- var l = _step.value;
1959
- var a = {
1960
- name: l.name,
1961
- value: l.value,
1962
- absorbedNext: !1,
1963
- isGlobal: !0
1964
- };
1965
- l.needsNext && a.value === void 0 && r < e.length && (a.value = String(e[r]), a.absorbedNext = !0, r++), t.push(a);
1966
- }
1967
- } catch (err) {
1968
- _didIteratorError = true;
1969
- _iteratorError = err;
1970
- } finally{
1971
- try {
1972
- if (!_iteratorNormalCompletion && _iterator.return != null) {
1973
- _iterator.return();
1974
- }
1975
- } finally{
1976
- if (_didIteratorError) {
1977
- throw _iteratorError;
1978
- }
1979
- }
1980
- }
1981
- n = r;
1982
- }
1983
- return {
1984
- flags: t,
1985
- taskIndex: n
1986
- };
1987
- }
1988
- function B(e, t) {
1989
- var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
1990
- var o$1 = I(t), s = [], r$1 = [];
1991
- var l = 0;
1992
- for(; l < e.length;){
1993
- var a = e[l];
1994
- if (r(a)) {
1995
- var _r;
1996
- (_r = r$1).push.apply(_r, _to_consumable_array$1(o(a))), l++;
1997
- continue;
1998
- }
1999
- var f = String(a);
2000
- if (f === "--") {
2001
- for(var g = l + 1; g < e.length; g++){
2002
- var _r1;
2003
- var u = e[g];
2004
- r(u) ? (_r1 = r$1).push.apply(_r1, _to_consumable_array$1(o(u))) : r$1.push(String(u));
2005
- }
2006
- break;
2007
- }
2008
- if (!f.startsWith("-") || f.length < 2) {
2009
- s.push(f), l++;
2010
- continue;
2011
- }
2012
- var w = b(f, o$1);
2013
- var d = l + 1;
2014
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
2015
- try {
2016
- for(var _iterator = w[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
2017
- var g1 = _step.value;
2018
- var u1 = {
2019
- name: g1.name,
2020
- value: g1.value,
2021
- absorbedNext: !1,
2022
- isGlobal: !1
2023
- };
2024
- g1.needsNext && u1.value === void 0 && d < e.length && !r(e[d]) && (u1.value = String(e[d]), u1.absorbedNext = !0, d++), n.push(u1);
2025
- }
2026
- } catch (err) {
2027
- _didIteratorError = true;
2028
- _iteratorError = err;
2029
- } finally{
2030
- try {
2031
- if (!_iteratorNormalCompletion && _iterator.return != null) {
2032
- _iterator.return();
2033
- }
2034
- } finally{
2035
- if (_didIteratorError) {
2036
- throw _iteratorError;
2037
- }
2038
- }
2039
- }
2040
- l = d;
2041
- }
2042
- return {
2043
- flags: n,
2044
- positionals: s,
2045
- pathspecs: r$1
2046
- };
2047
- }
2048
- function V(param) {
2049
- var e, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1, _iterator, _step, t, _iterator1, _step1, n, o, _tmp, err, err;
2050
- return _ts_generator$1(this, function(_state) {
2051
- switch(_state.label){
2052
- case 0:
2053
- e = param.write;
2054
- _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined, _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
2055
- _state.label = 1;
2056
- case 1:
2057
- _state.trys.push([
2058
- 1,
2059
- 13,
2060
- 14,
2061
- 15
2062
- ]);
2063
- _iterator = e[Symbol.iterator]();
2064
- _state.label = 2;
2065
- case 2:
2066
- if (!!(_iteratorNormalCompletion1 = (_step = _iterator.next()).done)) return [
2067
- 3,
2068
- 12
2069
- ];
2070
- t = _step.value;
2071
- _state.label = 3;
2072
- case 3:
2073
- _state.trys.push([
2074
- 3,
2075
- 9,
2076
- 10,
2077
- 11
2078
- ]);
2079
- _iterator1 = q[Symbol.iterator]();
2080
- _state.label = 4;
2081
- case 4:
2082
- if (!!(_iteratorNormalCompletion = (_step1 = _iterator1.next()).done)) return [
2083
- 3,
2084
- 8
2085
- ];
2086
- n = _step1.value;
2087
- o = n(t.key);
2088
- _tmp = o;
2089
- if (!_tmp) return [
2090
- 3,
2091
- 6
2092
- ];
2093
- return [
2094
- 4,
2095
- o
2096
- ];
2097
- case 5:
2098
- _tmp = _state.sent();
2099
- _state.label = 6;
2100
- case 6:
2101
- _state.label = 7;
2102
- case 7:
2103
- _iteratorNormalCompletion = true;
2104
- return [
2105
- 3,
2106
- 4
2107
- ];
2108
- case 8:
2109
- return [
2110
- 3,
2111
- 11
2112
- ];
2113
- case 9:
2114
- err = _state.sent();
2115
- _didIteratorError = true;
2116
- _iteratorError = err;
2117
- return [
2118
- 3,
2119
- 11
2120
- ];
2121
- case 10:
2122
- try {
2123
- if (!_iteratorNormalCompletion && _iterator1.return != null) {
2124
- _iterator1.return();
2125
- }
2126
- } finally{
2127
- if (_didIteratorError) {
2128
- throw _iteratorError;
2129
- }
2130
- }
2131
- return [
2132
- 7
2133
- ];
2134
- case 11:
2135
- _iteratorNormalCompletion1 = true;
2136
- return [
2137
- 3,
2138
- 2
2139
- ];
2140
- case 12:
2141
- return [
2142
- 3,
2143
- 15
2144
- ];
2145
- case 13:
2146
- err = _state.sent();
2147
- _didIteratorError1 = true;
2148
- _iteratorError1 = err;
2149
- return [
2150
- 3,
2151
- 15
2152
- ];
2153
- case 14:
2154
- try {
2155
- if (!_iteratorNormalCompletion1 && _iterator.return != null) {
2156
- _iterator.return();
2157
- }
2158
- } finally{
2159
- if (_didIteratorError1) {
2160
- throw _iteratorError1;
2161
- }
2162
- }
2163
- return [
2164
- 7
2165
- ];
2166
- case 15:
2167
- return [
2168
- 2
2169
- ];
2170
- }
2171
- });
2172
- }
2173
- function c(e, t) {
2174
- var n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : String(e);
2175
- var o = typeof e == "string" ? new RegExp("\\s*".concat(e.toLowerCase())) : e;
2176
- return function(r) {
2177
- if (o.test(r)) return {
2178
- category: t,
2179
- message: "Configuring ".concat(n, " is not permitted without enabling ").concat(t)
2180
- };
2181
- };
2182
- }
2183
- function i(e, t) {
2184
- var n = new RegExp("\\s*".concat(e.toLowerCase().replace(/\./g, "(..+)?.")));
2185
- return c(n, t, e);
2186
- }
2187
- var q = [
2188
- c("alias", "allowUnsafeAlias"),
2189
- c("core.askPass", "allowUnsafeAskPass"),
2190
- c("core.editor", "allowUnsafeEditor"),
2191
- c("core.fsmonitor", "allowUnsafeFsMonitor"),
2192
- c("core.gitProxy", "allowUnsafeGitProxy"),
2193
- c("core.hooksPath", "allowUnsafeHooksPath"),
2194
- c("core.pager", "allowUnsafePager"),
2195
- c("core.sshCommand", "allowUnsafeSshCommand"),
2196
- i("credential.helper", "allowUnsafeCredentialHelper"),
2197
- i("diff.command", "allowUnsafeDiffExternal"),
2198
- c("diff.external", "allowUnsafeDiffExternal"),
2199
- i("diff.textconv", "allowUnsafeDiffTextConv"),
2200
- i("filter.clean", "allowUnsafeFilter"),
2201
- i("filter.smudge", "allowUnsafeFilter"),
2202
- i("gpg.program", "allowUnsafeGpgProgram"),
2203
- c("init.templateDir", "allowUnsafeTemplateDir"),
2204
- i("merge.driver", "allowUnsafeMergeDriver"),
2205
- i("mergetool.path", "allowUnsafeMergeDriver"),
2206
- i("mergetool.cmd", "allowUnsafeMergeDriver"),
2207
- i("protocol.allow", "allowUnsafeProtocolOverride"),
2208
- i("remote.receivepack", "allowUnsafePack"),
2209
- i("remote.uploadpack", "allowUnsafePack"),
2210
- c("sequence.editor", "allowUnsafeEditor")
2211
- ];
2212
- function K(e, t) {
2213
- var _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1, _iterator, _step, n, _iterator1, _step1, o, s, _tmp, err, err;
2214
- return _ts_generator$1(this, function(_state) {
2215
- switch(_state.label){
2216
- case 0:
2217
- _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined, _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
2218
- _state.label = 1;
2219
- case 1:
2220
- _state.trys.push([
2221
- 1,
2222
- 13,
2223
- 14,
2224
- 15
2225
- ]);
2226
- _iterator = t[Symbol.iterator]();
2227
- _state.label = 2;
2228
- case 2:
2229
- if (!!(_iteratorNormalCompletion1 = (_step = _iterator.next()).done)) return [
2230
- 3,
2231
- 12
2232
- ];
2233
- n = _step.value;
2234
- _state.label = 3;
2235
- case 3:
2236
- _state.trys.push([
2237
- 3,
2238
- 9,
2239
- 10,
2240
- 11
2241
- ]);
2242
- _iterator1 = H[Symbol.iterator]();
2243
- _state.label = 4;
2244
- case 4:
2245
- if (!!(_iteratorNormalCompletion = (_step1 = _iterator1.next()).done)) return [
2246
- 3,
2247
- 8
2248
- ];
2249
- o = _step1.value;
2250
- s = o(e, n.name);
2251
- _tmp = s;
2252
- if (!_tmp) return [
2253
- 3,
2254
- 6
2255
- ];
2256
- return [
2257
- 4,
2258
- s
2259
- ];
2260
- case 5:
2261
- _tmp = _state.sent();
2262
- _state.label = 6;
2263
- case 6:
2264
- _state.label = 7;
2265
- case 7:
2266
- _iteratorNormalCompletion = true;
2267
- return [
2268
- 3,
2269
- 4
2270
- ];
2271
- case 8:
2272
- return [
2273
- 3,
2274
- 11
2275
- ];
2276
- case 9:
2277
- err = _state.sent();
2278
- _didIteratorError = true;
2279
- _iteratorError = err;
2280
- return [
2281
- 3,
2282
- 11
2283
- ];
2284
- case 10:
2285
- try {
2286
- if (!_iteratorNormalCompletion && _iterator1.return != null) {
2287
- _iterator1.return();
2288
- }
2289
- } finally{
2290
- if (_didIteratorError) {
2291
- throw _iteratorError;
2292
- }
2293
- }
2294
- return [
2295
- 7
2296
- ];
2297
- case 11:
2298
- _iteratorNormalCompletion1 = true;
2299
- return [
2300
- 3,
2301
- 2
2302
- ];
2303
- case 12:
2304
- return [
2305
- 3,
2306
- 15
2307
- ];
2308
- case 13:
2309
- err = _state.sent();
2310
- _didIteratorError1 = true;
2311
- _iteratorError1 = err;
2312
- return [
2313
- 3,
2314
- 15
2315
- ];
2316
- case 14:
2317
- try {
2318
- if (!_iteratorNormalCompletion1 && _iterator.return != null) {
2319
- _iterator.return();
2320
- }
2321
- } finally{
2322
- if (_didIteratorError1) {
2323
- throw _iteratorError1;
2324
- }
2325
- }
2326
- return [
2327
- 7
2328
- ];
2329
- case 15:
2330
- return [
2331
- 2
2332
- ];
2333
- }
2334
- });
2335
- }
2336
- function h(e, t, n) {
2337
- var o = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : String(t);
2338
- var s = typeof t == "string" ? new RegExp("\\s*".concat(t.toLowerCase())) : t, r = "Use of ".concat(e ? "".concat(e, " with option ") : "").concat(o, " is not permitted without enabling ").concat(n);
2339
- return function(a, f) {
2340
- if ((!e || a === e) && s.test(f)) return {
2341
- category: n,
2342
- message: r
2343
- };
2344
- };
2345
- }
2346
- var H = [
2347
- h(null, /--(upload|receive)-pack/, "allowUnsafePack", "--upload-pack or --receive-pack"),
2348
- h("clone", /^-\w*u/, "allowUnsafePack"),
2349
- h("clone", "--u", "allowUnsafePack"),
2350
- h("push", "--exec", "allowUnsafePack"),
2351
- h(null, "--template", "allowUnsafeTemplateDir")
2352
- ];
2353
- function C(e, t, n) {
2354
- return _to_consumable_array$1(K(e, t)).concat(_to_consumable_array$1(V(n)));
2355
- }
2356
- function Y() {
2357
- for(var _len = arguments.length, e = new Array(_len), _key = 0; _key < _len; _key++){
2358
- e[_key] = arguments[_key];
2359
- }
2360
- var _j = j(e), t = _j.flags, n = _j.taskIndex, o = n < e.length ? String(e[n]).toLowerCase() : null, s = o !== null ? e.slice(n + 1) : [], _B = B(s, o, t), r = _B.positionals, l = _B.pathspecs, a = L(o, t, r);
2361
- return {
2362
- task: o,
2363
- flags: t.map(J),
2364
- paths: l,
2365
- config: a,
2366
- vulnerabilities: z(C(o, t, a))
2367
- };
2368
- }
2369
- function z(e) {
2370
- return Object.defineProperty(e, "vulnerabilities", {
2371
- value: e
2372
- });
2373
- }
2374
- function J(param) {
2375
- var e = param.value, t = param.name;
2376
- return e !== void 0 ? {
2377
- name: t,
2378
- value: e
2379
- } : {
2380
- name: t
2381
- };
2382
- }
2383
- var y = {
2384
- editor: "allowUnsafeEditor",
2385
- git_askpass: "allowUnsafeAskPass",
2386
- git_config_global: "allowUnsafeConfigPaths",
2387
- git_config_system: "allowUnsafeConfigPaths",
2388
- git_config_count: "allowUnsafeConfigEnvCount",
2389
- git_config: "allowUnsafeConfigPaths",
2390
- git_editor: "allowUnsafeEditor",
2391
- git_exec_path: "allowUnsafeConfigPaths",
2392
- git_external_diff: "allowUnsafeDiffExternal",
2393
- git_pager: "allowUnsafePager",
2394
- git_proxy_command: "allowUnsafeGitProxy",
2395
- git_template_dir: "allowUnsafeTemplateDir",
2396
- git_sequence_editor: "allowUnsafeEditor",
2397
- git_ssh: "allowUnsafeSshCommand",
2398
- git_ssh_command: "allowUnsafeSshCommand",
2399
- pager: "allowUnsafePager",
2400
- prefix: "allowUnsafeConfigPaths",
2401
- ssh_askpass: "allowUnsafeAskPass"
2402
- };
2403
- function Q(e) {
2404
- var _e_git_config_count, t, n, o, s, _tmp;
2405
- return _ts_generator$1(this, function(_state) {
2406
- switch(_state.label){
2407
- case 0:
2408
- t = parseInt((_e_git_config_count = e.git_config_count) !== null && _e_git_config_count !== void 0 ? _e_git_config_count : "0", 10);
2409
- n = 0;
2410
- _state.label = 1;
2411
- case 1:
2412
- if (!(n < t)) return [
2413
- 3,
2414
- 5
2415
- ];
2416
- o = e["git_config_key_".concat(n)], s = e["git_config_value_".concat(n)];
2417
- _tmp = o !== void 0;
2418
- if (!_tmp) return [
2419
- 3,
2420
- 3
2421
- ];
2422
- return [
2423
- 4,
2424
- {
2425
- key: o.toLowerCase().trim(),
2426
- value: s,
2427
- scope: "env"
2428
- }
2429
- ];
2430
- case 2:
2431
- _tmp = _state.sent();
2432
- _state.label = 3;
2433
- case 3:
2434
- _state.label = 4;
2435
- case 4:
2436
- n++;
2437
- return [
2438
- 3,
2439
- 1
2440
- ];
2441
- case 5:
2442
- return [
2443
- 2
2444
- ];
2445
- }
2446
- });
2447
- }
2448
- function X(e) {
2449
- var _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, t, n, err;
2450
- return _ts_generator$1(this, function(_state) {
2451
- switch(_state.label){
2452
- case 0:
2453
- _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
2454
- _state.label = 1;
2455
- case 1:
2456
- _state.trys.push([
2457
- 1,
2458
- 6,
2459
- 7,
2460
- 8
2461
- ]);
2462
- _iterator = Object.keys(e)[Symbol.iterator]();
2463
- _state.label = 2;
2464
- case 2:
2465
- if (!!(_iteratorNormalCompletion = (_step = _iterator.next()).done)) return [
2466
- 3,
2467
- 5
2468
- ];
2469
- t = _step.value;
2470
- if (!_(t)) return [
2471
- 3,
2472
- 4
2473
- ];
2474
- n = y[t];
2475
- return [
2476
- 4,
2477
- {
2478
- category: n,
2479
- message: 'Use of "'.concat(t.toUpperCase(), '" is not permitted without enabling ').concat(n)
2480
- }
2481
- ];
2482
- case 3:
2483
- _state.sent();
2484
- _state.label = 4;
2485
- case 4:
2486
- _iteratorNormalCompletion = true;
2487
- return [
2488
- 3,
2489
- 2
2490
- ];
2491
- case 5:
2492
- return [
2493
- 3,
2494
- 8
2495
- ];
2496
- case 6:
2497
- err = _state.sent();
2498
- _didIteratorError = true;
2499
- _iteratorError = err;
2500
- return [
2501
- 3,
2502
- 8
2503
- ];
2504
- case 7:
2505
- try {
2506
- if (!_iteratorNormalCompletion && _iterator.return != null) {
2507
- _iterator.return();
2508
- }
2509
- } finally{
2510
- if (_didIteratorError) {
2511
- throw _iteratorError;
2512
- }
2513
- }
2514
- return [
2515
- 7
2516
- ];
2517
- case 8:
2518
- return [
2519
- 2
2520
- ];
2521
- }
1122
+ var dist = {};
1123
+
1124
+ Object.defineProperty(dist, "__esModule", {
1125
+ value: true
1126
+ });
1127
+ var createDeferred = dist.createDeferred = deferred_1 = dist.deferred = void 0;
1128
+ /**
1129
+ * Creates a new `DeferredPromise`
1130
+ *
1131
+ * ```typescript
1132
+ import {deferred} from '@kwsites/promise-deferred`;
1133
+ ```
1134
+ */ function deferred() {
1135
+ var done;
1136
+ var fail;
1137
+ var status = 'pending';
1138
+ var promise = new Promise(function(_done, _fail) {
1139
+ done = _done;
1140
+ fail = _fail;
2522
1141
  });
2523
- }
2524
- function _(e) {
2525
- return Object.hasOwn(y, e);
2526
- }
2527
- function Z(e) {
2528
- var t = {};
2529
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
2530
- try {
2531
- for(var _iterator = Object.entries(e)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
2532
- var _step_value = _sliced_to_array$1(_step.value, 2), n = _step_value[0], o = _step_value[1];
2533
- var s = n.toLowerCase().trim();
2534
- (_(s) || s.startsWith("git")) && (t[s] = String(o));
2535
- }
2536
- } catch (err) {
2537
- _didIteratorError = true;
2538
- _iteratorError = err;
2539
- } finally{
2540
- try {
2541
- if (!_iteratorNormalCompletion && _iterator.return != null) {
2542
- _iterator.return();
1142
+ return {
1143
+ promise: promise,
1144
+ done: function done1(result) {
1145
+ if (status === 'pending') {
1146
+ status = 'resolved';
1147
+ done(result);
2543
1148
  }
2544
- } finally{
2545
- if (_didIteratorError) {
2546
- throw _iteratorError;
1149
+ },
1150
+ fail: function fail1(error) {
1151
+ if (status === 'pending') {
1152
+ status = 'rejected';
1153
+ fail(error);
2547
1154
  }
1155
+ },
1156
+ get fulfilled () {
1157
+ return status !== 'pending';
1158
+ },
1159
+ get status () {
1160
+ return status;
2548
1161
  }
2549
- }
2550
- return t;
2551
- }
2552
- function ee(e) {
2553
- var t = Z(e), n = {
2554
- read: [],
2555
- write: _to_consumable_array$1(Q(t))
2556
- }, o = _to_consumable_array$1(X(t)).concat(_to_consumable_array$1(C(null, [], n)));
2557
- return {
2558
- config: n,
2559
- vulnerabilities: o
2560
1162
  };
2561
1163
  }
2562
- function ne(e, t) {
2563
- return _to_consumable_array$1(Y.apply(void 0, _to_consumable_array$1(e)).vulnerabilities).concat(_to_consumable_array$1(ee(t).vulnerabilities));
2564
- }
1164
+ var deferred_1 = dist.deferred = deferred;
1165
+ /**
1166
+ * Alias of the exported `deferred` function, to help consumers wanting to use `deferred` as the
1167
+ * local variable name rather than the factory import name, without needing to rename on import.
1168
+ *
1169
+ * ```typescript
1170
+ import {createDeferred} from '@kwsites/promise-deferred`;
1171
+ ```
1172
+ */ createDeferred = dist.createDeferred = deferred;
1173
+ /**
1174
+ * Default export allows use as:
1175
+ *
1176
+ * ```typescript
1177
+ import deferred from '@kwsites/promise-deferred`;
1178
+ ```
1179
+ */ dist.default = deferred;
2565
1180
 
2566
1181
  function _array_like_to_array(arr, len) {
2567
1182
  if (len == null || len > arr.length) len = arr.length;
@@ -3011,6 +1626,27 @@ var __toCommonJS = function(mod) {
3011
1626
  value: true
3012
1627
  }), mod);
3013
1628
  };
1629
+ // src/lib/args/pathspec.ts
1630
+ function pathspec() {
1631
+ for(var _len = arguments.length, paths = new Array(_len), _key = 0; _key < _len; _key++){
1632
+ paths[_key] = arguments[_key];
1633
+ }
1634
+ var key = new String(paths);
1635
+ cache.set(key, paths);
1636
+ return key;
1637
+ }
1638
+ function isPathSpec(path) {
1639
+ return _instanceof(path, String) && cache.has(path);
1640
+ }
1641
+ function toPaths(pathSpec) {
1642
+ return cache.get(pathSpec) || [];
1643
+ }
1644
+ var cache;
1645
+ var init_pathspec = __esm({
1646
+ "src/lib/args/pathspec.ts": function() {
1647
+ cache = /* @__PURE__ */ new WeakMap();
1648
+ }
1649
+ });
3014
1650
  // src/lib/errors/git-error.ts
3015
1651
  var GitError;
3016
1652
  var init_git_error = __esm({
@@ -3098,7 +1734,7 @@ function last(input) {
3098
1734
  }
3099
1735
  }
3100
1736
  function isArrayLike(input) {
3101
- return filterHasLength(input);
1737
+ return !!(input && typeof input.length === "number");
3102
1738
  }
3103
1739
  function toLinesWithContent() {
3104
1740
  var input = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "", trimmed2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true, separator = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "\n";
@@ -3156,9 +1792,7 @@ function asCamelCase(str) {
3156
1792
  });
3157
1793
  }
3158
1794
  function asStringArray(source) {
3159
- return asArray(source).map(function(item) {
3160
- return _instanceof(item, String) ? item : String(item);
3161
- });
1795
+ return asArray(source).map(String);
3162
1796
  }
3163
1797
  function asNumber(source) {
3164
1798
  var onNaN = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
@@ -3166,7 +1800,7 @@ function asNumber(source) {
3166
1800
  return onNaN;
3167
1801
  }
3168
1802
  var num = parseInt(source, 10);
3169
- return Number.isNaN(num) ? onNaN : num;
1803
+ return isNaN(num) ? onNaN : num;
3170
1804
  }
3171
1805
  function prefixedArray(input, prefix) {
3172
1806
  var output = [];
@@ -3176,16 +1810,15 @@ function prefixedArray(input, prefix) {
3176
1810
  return output;
3177
1811
  }
3178
1812
  function bufferToString(input) {
3179
- return (Array.isArray(input) ? Buffer.concat(input) : input).toString("utf-8");
1813
+ return (Array.isArray(input) ? Buffer$1.concat(input) : input).toString("utf-8");
3180
1814
  }
3181
1815
  function pick(source, properties) {
3182
- var out = {};
3183
- properties.forEach(function(key) {
3184
- if (source[key] !== void 0) {
3185
- out[key] = source[key];
3186
- }
3187
- });
3188
- return out;
1816
+ var _Object;
1817
+ return (_Object = Object).assign.apply(_Object, [
1818
+ {}
1819
+ ].concat(_to_consumable_array(properties.map(function(property) {
1820
+ return property in source ? _define_property({}, property, source[property]) : {};
1821
+ }))));
3189
1822
  }
3190
1823
  function delay() {
3191
1824
  var duration = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
@@ -3202,12 +1835,12 @@ function orVoid(input) {
3202
1835
  var NULL, NOOP, objectToString;
3203
1836
  var init_util = __esm({
3204
1837
  "src/lib/utils/util.ts": function() {
3205
- init_argument_filters();
3206
1838
  NULL = "\0";
3207
1839
  NOOP = function() {};
3208
1840
  objectToString = Object.prototype.toString.call.bind(Object.prototype.toString);
3209
1841
  }
3210
1842
  });
1843
+ // src/lib/utils/argument-filters.ts
3211
1844
  function filterType(input, filter, def) {
3212
1845
  if (filter(input)) {
3213
1846
  return input;
@@ -3215,7 +1848,7 @@ function filterType(input, filter, def) {
3215
1848
  return arguments.length > 2 ? def : void 0;
3216
1849
  }
3217
1850
  function filterPrimitives(input, omit) {
3218
- var type = r(input) ? "string" : typeof input === "undefined" ? "undefined" : _type_of(input);
1851
+ var type = isPathSpec(input) ? "string" : typeof input === "undefined" ? "undefined" : _type_of(input);
3219
1852
  return /number|string|boolean/.test(type) && (!omit || !omit.includes(type));
3220
1853
  }
3221
1854
  function filterPlainObject(input) {
@@ -3224,18 +1857,19 @@ function filterPlainObject(input) {
3224
1857
  function filterFunction(input) {
3225
1858
  return typeof input === "function";
3226
1859
  }
3227
- var filterArray, filterNumber, filterString, filterStringOrStringArray, filterHasLength;
1860
+ var filterArray, filterString, filterStringArray, filterStringOrStringArray, filterHasLength;
3228
1861
  var init_argument_filters = __esm({
3229
1862
  "src/lib/utils/argument-filters.ts": function() {
3230
1863
  init_util();
1864
+ init_pathspec();
3231
1865
  filterArray = function(input) {
3232
1866
  return Array.isArray(input);
3233
1867
  };
3234
- filterNumber = function(input) {
3235
- return typeof input === "number";
3236
- };
3237
1868
  filterString = function(input) {
3238
- return typeof input === "string" || r(input);
1869
+ return typeof input === "string";
1870
+ };
1871
+ filterStringArray = function(input) {
1872
+ return Array.isArray(input) && input.every(filterString);
3239
1873
  };
3240
1874
  filterStringOrStringArray = function(input) {
3241
1875
  return filterString(input) || Array.isArray(input) && input.every(filterString);
@@ -3244,7 +1878,7 @@ var init_argument_filters = __esm({
3244
1878
  if (input == null || "number|boolean|function".includes(typeof input === "undefined" ? "undefined" : _type_of(input))) {
3245
1879
  return false;
3246
1880
  }
3247
- return typeof input.length === "number";
1881
+ return Array.isArray(input) || typeof input === "string" || typeof input.length === "number";
3248
1882
  };
3249
1883
  }
3250
1884
  });
@@ -3284,9 +1918,6 @@ var init_git_output_streams = __esm({
3284
1918
  }
3285
1919
  });
3286
1920
  // src/lib/utils/line-parser.ts
3287
- function useMatchesDefault() {
3288
- throw new Error("LineParser:useMatches not implemented");
3289
- }
3290
1921
  var LineParser, RemoteLineParser;
3291
1922
  var init_line_parser = __esm({
3292
1923
  "src/lib/utils/line-parser.ts": function() {
@@ -3295,7 +1926,6 @@ var init_line_parser = __esm({
3295
1926
  var _this = this;
3296
1927
  _class_call_check(this, LineParser);
3297
1928
  this.matches = [];
3298
- this.useMatches = useMatchesDefault;
3299
1929
  this.parse = function(line, target) {
3300
1930
  _this.resetMatches();
3301
1931
  if (!_this._regExp.every(function(reg, index) {
@@ -3313,6 +1943,13 @@ var init_line_parser = __esm({
3313
1943
  }
3314
1944
  }
3315
1945
  _create_class(LineParser, [
1946
+ {
1947
+ // @ts-ignore
1948
+ key: "useMatches",
1949
+ value: function useMatches(target, match) {
1950
+ throw new Error("LineParser:useMatches not implemented");
1951
+ }
1952
+ },
3316
1953
  {
3317
1954
  key: "resetMatches",
3318
1955
  value: function resetMatches() {
@@ -3401,6 +2038,7 @@ var init_simple_git_options = __esm({
3401
2038
  };
3402
2039
  }
3403
2040
  });
2041
+ // src/lib/utils/task-options.ts
3404
2042
  function appendTaskOptions(options) {
3405
2043
  var commands = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : [];
3406
2044
  if (!filterPlainObject(options)) {
@@ -3408,7 +2046,7 @@ function appendTaskOptions(options) {
3408
2046
  }
3409
2047
  return Object.keys(options).reduce(function(commands2, key) {
3410
2048
  var value = options[key];
3411
- if (r(value)) {
2049
+ if (isPathSpec(value)) {
3412
2050
  commands2.push(value);
3413
2051
  } else if (filterPrimitives(value, [
3414
2052
  "boolean"
@@ -3463,7 +2101,7 @@ function getTrailingOptions(args) {
3463
2101
  }
3464
2102
  function trailingArrayArgument(args) {
3465
2103
  var hasTrailingCallback = typeof last(args) === "function";
3466
- return asStringArray(filterType(last(args, hasTrailingCallback ? 1 : 0), filterArray, []));
2104
+ return filterType(last(args, hasTrailingCallback ? 1 : 0), filterArray, []);
3467
2105
  }
3468
2106
  function trailingOptionsArgument(args) {
3469
2107
  var hasTrailingCallback = filterFunction(last(args));
@@ -3478,6 +2116,7 @@ var init_task_options = __esm({
3478
2116
  "src/lib/utils/task-options.ts": function() {
3479
2117
  init_argument_filters();
3480
2118
  init_util();
2119
+ init_pathspec();
3481
2120
  }
3482
2121
  });
3483
2122
  // src/lib/utils/task-parser.ts
@@ -3572,9 +2211,6 @@ __export(utils_exports, {
3572
2211
  filterHasLength: function() {
3573
2212
  return filterHasLength;
3574
2213
  },
3575
- filterNumber: function() {
3576
- return filterNumber;
3577
- },
3578
2214
  filterPlainObject: function() {
3579
2215
  return filterPlainObject;
3580
2216
  },
@@ -3584,6 +2220,9 @@ __export(utils_exports, {
3584
2220
  filterString: function() {
3585
2221
  return filterString;
3586
2222
  },
2223
+ filterStringArray: function() {
2224
+ return filterStringArray;
2225
+ },
3587
2226
  filterStringOrStringArray: function() {
3588
2227
  return filterStringOrStringArray;
3589
2228
  },
@@ -4105,7 +2744,7 @@ var init_ConfigList = __esm({
4105
2744
  key: "addValue",
4106
2745
  value: function addValue(file, key, value) {
4107
2746
  var values = this.addFile(file);
4108
- if (!Object.hasOwn(values, key)) {
2747
+ if (!values.hasOwnProperty(key)) {
4109
2748
  values[key] = value;
4110
2749
  } else if (Array.isArray(values[key])) {
4111
2750
  values[key].push(value);
@@ -4125,7 +2764,7 @@ var init_ConfigList = __esm({
4125
2764
  });
4126
2765
  // src/lib/tasks/config.ts
4127
2766
  function asConfigScope(scope, fallback) {
4128
- if (typeof scope === "string" && Object.hasOwn(GitConfigScope, scope)) {
2767
+ if (typeof scope === "string" && GitConfigScope.hasOwnProperty(scope)) {
4129
2768
  return scope;
4130
2769
  }
4131
2770
  return fallback;
@@ -4464,12 +3103,11 @@ function getResetMode(mode) {
4464
3103
  return;
4465
3104
  }
4466
3105
  function isValidResetMode(mode) {
4467
- return typeof mode === "string" && validResetModes.includes(mode);
3106
+ return ResetModes.includes(mode);
4468
3107
  }
4469
- var ResetMode, validResetModes;
3108
+ var ResetMode, ResetModes;
4470
3109
  var init_reset = __esm({
4471
3110
  "src/lib/tasks/reset.ts": function() {
4472
- init_utils();
4473
3111
  init_task();
4474
3112
  ResetMode = /* @__PURE__ */ function(ResetMode2) {
4475
3113
  ResetMode2["MIXED"] = "mixed";
@@ -4479,7 +3117,7 @@ var init_reset = __esm({
4479
3117
  ResetMode2["KEEP"] = "keep";
4480
3118
  return ResetMode2;
4481
3119
  }(ResetMode || {});
4482
- validResetModes = asStringArray(Object.values(ResetMode));
3120
+ ResetModes = Array.from(Object.values(ResetMode));
4483
3121
  }
4484
3122
  });
4485
3123
  function createLog() {
@@ -4818,9 +3456,7 @@ var init_git_executor_chain = __esm({
4818
3456
  switch(_state.label){
4819
3457
  case 0:
4820
3458
  binary = _this._plugins.exec("spawn.binary", "", pluginContext(task, task.commands));
4821
- args = _this._plugins.exec("spawn.args", _to_consumable_array(task.commands), _object_spread_props(_object_spread({}, pluginContext(task, task.commands)), {
4822
- env: _object_spread({}, _this.env)
4823
- }));
3459
+ args = _this._plugins.exec("spawn.args", _to_consumable_array(task.commands), pluginContext(task, task.commands));
4824
3460
  return [
4825
3461
  4,
4826
3462
  _this.gitResponse(task, binary, args, _this.outputHandler, logger.step("SPAWN"))
@@ -5140,7 +3776,7 @@ var init_count_objects = __esm({
5140
3776
  parser2 = new LineParser(/([a-z-]+): (\d+)$/, function(result, param) {
5141
3777
  var _param = _sliced_to_array(param, 2), key = _param[0], value = _param[1];
5142
3778
  var property = asCamelCase(key);
5143
- if (Object.hasOwn(result, property)) {
3779
+ if (result.hasOwnProperty(property)) {
5144
3780
  result[property] = asNumber(value);
5145
3781
  }
5146
3782
  });
@@ -5223,7 +3859,7 @@ function commit_default() {
5223
3859
  rest[_key - 1] = arguments[_key];
5224
3860
  }
5225
3861
  var next = trailingFunctionArgument(arguments);
5226
- var task = rejectDeprecatedSignatures(message) || commitTask(asArray(message), asArray(filterType(rest[0], filterStringOrStringArray, [])), _to_consumable_array(asStringArray(filterType(rest[1], filterArray, []))).concat(_to_consumable_array(getTrailingOptions(arguments, 0, true))));
3862
+ var task = rejectDeprecatedSignatures(message) || commitTask(asArray(message), asArray(filterType(rest[0], filterStringOrStringArray, [])), _to_consumable_array(filterType(rest[1], filterArray, [])).concat(_to_consumable_array(getTrailingOptions(arguments, 0, true))));
5227
3863
  return this._runTask(task, next);
5228
3864
  }
5229
3865
  };
@@ -5560,6 +4196,7 @@ var init_diff = __esm({
5560
4196
  init_task();
5561
4197
  }
5562
4198
  });
4199
+ // src/lib/tasks/log.ts
5563
4200
  function prettyFormat(format, splitter) {
5564
4201
  var fields = [];
5565
4202
  var formatStr = [];
@@ -5606,7 +4243,7 @@ function parseLogOptions() {
5606
4243
  suffix.push("".concat(opt.from || "").concat(rangeOperator).concat(opt.to || ""));
5607
4244
  }
5608
4245
  if (filterString(opt.file)) {
5609
- command.push("--follow", c$1(opt.file));
4246
+ command.push("--follow", pathspec(opt.file));
5610
4247
  }
5611
4248
  appendTaskOptions(userOptions(opt), command);
5612
4249
  return {
@@ -5632,7 +4269,7 @@ function log_default() {
5632
4269
  rest[_key] = arguments[_key];
5633
4270
  }
5634
4271
  var next = trailingFunctionArgument(arguments);
5635
- var options = parseLogOptions(trailingOptionsArgument(arguments), asStringArray(filterType(arguments[0], filterArray, [])));
4272
+ var options = parseLogOptions(trailingOptionsArgument(arguments), filterType(arguments[0], filterArray));
5636
4273
  var task = rejectDeprecatedSignatures.apply(void 0, _to_consumable_array(rest)) || validateLogFormatConfig(options.commands) || createLogTask(options);
5637
4274
  return this._runTask(task, next);
5638
4275
  }
@@ -5648,6 +4285,7 @@ var excludeOptions;
5648
4285
  var init_log = __esm({
5649
4286
  "src/lib/tasks/log.ts": function() {
5650
4287
  init_log_format();
4288
+ init_pathspec();
5651
4289
  init_parse_list_log_summary();
5652
4290
  init_utils();
5653
4291
  init_task();
@@ -6185,7 +4823,7 @@ function conflicts(indexX) {
6185
4823
  }
6186
4824
  return indexY.map(function(y) {
6187
4825
  return parser3(indexX, y, function(result, file) {
6188
- return result.conflicted.push(file);
4826
+ return append(result.conflicted, file);
6189
4827
  });
6190
4828
  });
6191
4829
  }
@@ -6193,9 +4831,9 @@ function splitLine(result, lineStr) {
6193
4831
  var trimmed2 = lineStr.trim();
6194
4832
  switch(" "){
6195
4833
  case trimmed2.charAt(2):
6196
- return data(trimmed2.charAt(0), trimmed2.charAt(1), trimmed2.slice(3));
4834
+ return data(trimmed2.charAt(0), trimmed2.charAt(1), trimmed2.substr(3));
6197
4835
  case trimmed2.charAt(1):
6198
- return data(" " /* NONE */ , trimmed2.charAt(0), trimmed2.slice(2));
4836
+ return data(" " /* NONE */ , trimmed2.charAt(0), trimmed2.substr(2));
6199
4837
  default:
6200
4838
  return;
6201
4839
  }
@@ -6238,48 +4876,42 @@ var init_StatusSummary = __esm({
6238
4876
  };
6239
4877
  parsers6 = new Map([
6240
4878
  parser3(" " /* NONE */ , "A" /* ADDED */ , function(result, file) {
6241
- return result.created.push(file);
4879
+ return append(result.created, file);
6242
4880
  }),
6243
4881
  parser3(" " /* NONE */ , "D" /* DELETED */ , function(result, file) {
6244
- return result.deleted.push(file);
4882
+ return append(result.deleted, file);
6245
4883
  }),
6246
4884
  parser3(" " /* NONE */ , "M" /* MODIFIED */ , function(result, file) {
6247
- return result.modified.push(file);
4885
+ return append(result.modified, file);
6248
4886
  }),
6249
4887
  parser3("A" /* ADDED */ , " " /* NONE */ , function(result, file) {
6250
- result.created.push(file);
6251
- result.staged.push(file);
4888
+ return append(result.created, file) && append(result.staged, file);
6252
4889
  }),
6253
4890
  parser3("A" /* ADDED */ , "M" /* MODIFIED */ , function(result, file) {
6254
- result.created.push(file);
6255
- result.staged.push(file);
6256
- result.modified.push(file);
4891
+ return append(result.created, file) && append(result.staged, file) && append(result.modified, file);
6257
4892
  }),
6258
4893
  parser3("D" /* DELETED */ , " " /* NONE */ , function(result, file) {
6259
- result.deleted.push(file);
6260
- result.staged.push(file);
4894
+ return append(result.deleted, file) && append(result.staged, file);
6261
4895
  }),
6262
4896
  parser3("M" /* MODIFIED */ , " " /* NONE */ , function(result, file) {
6263
- result.modified.push(file);
6264
- result.staged.push(file);
4897
+ return append(result.modified, file) && append(result.staged, file);
6265
4898
  }),
6266
4899
  parser3("M" /* MODIFIED */ , "M" /* MODIFIED */ , function(result, file) {
6267
- result.modified.push(file);
6268
- result.staged.push(file);
4900
+ return append(result.modified, file) && append(result.staged, file);
6269
4901
  }),
6270
4902
  parser3("R" /* RENAMED */ , " " /* NONE */ , function(result, file) {
6271
- result.renamed.push(renamedFile(file));
4903
+ append(result.renamed, renamedFile(file));
6272
4904
  }),
6273
4905
  parser3("R" /* RENAMED */ , "M" /* MODIFIED */ , function(result, file) {
6274
4906
  var renamed = renamedFile(file);
6275
- result.renamed.push(renamed);
6276
- result.modified.push(renamed.to);
4907
+ append(result.renamed, renamed);
4908
+ append(result.modified, renamed.to);
6277
4909
  }),
6278
4910
  parser3("!" /* IGNORED */ , "!" /* IGNORED */ , function(_result, _file) {
6279
- (_result.ignored = _result.ignored || []).push(_file);
4911
+ append(_result.ignored = _result.ignored || [], _file);
6280
4912
  }),
6281
4913
  parser3("?" /* UNTRACKED */ , "?" /* UNTRACKED */ , function(result, file) {
6282
- return result.not_added.push(file);
4914
+ return append(result.not_added, file);
6283
4915
  })
6284
4916
  ].concat(_to_consumable_array(conflicts("A" /* ADDED */ , "A" /* ADDED */ , "U" /* UNMERGED */ )), _to_consumable_array(conflicts("D" /* DELETED */ , "D" /* DELETED */ , "U" /* UNMERGED */ )), _to_consumable_array(conflicts("U" /* UNMERGED */ , "A" /* ADDED */ , "D" /* DELETED */ , "U" /* UNMERGED */ )), [
6285
4917
  [
@@ -6289,19 +4921,18 @@ var init_StatusSummary = __esm({
6289
4921
  var behindReg = /behind (\d+)/;
6290
4922
  var currentReg = /^(.+?(?=(?:\.{3}|\s|$)))/;
6291
4923
  var trackingReg = /\.{3}(\S*)/;
6292
- var onEmptyBranchReg = /\son\s(\S+?)(?=\.{3}|$)/;
6293
- var regexResult = aheadReg.exec(line);
4924
+ var onEmptyBranchReg = /\son\s([\S]+)$/;
4925
+ var regexResult;
4926
+ regexResult = aheadReg.exec(line);
6294
4927
  result.ahead = regexResult && +regexResult[1] || 0;
6295
4928
  regexResult = behindReg.exec(line);
6296
4929
  result.behind = regexResult && +regexResult[1] || 0;
6297
4930
  regexResult = currentReg.exec(line);
6298
- result.current = filterType(regexResult === null || regexResult === void 0 ? void 0 : regexResult[1], filterString, null);
4931
+ result.current = regexResult && regexResult[1];
6299
4932
  regexResult = trackingReg.exec(line);
6300
- result.tracking = filterType(regexResult === null || regexResult === void 0 ? void 0 : regexResult[1], filterString, null);
4933
+ result.tracking = regexResult && regexResult[1];
6301
4934
  regexResult = onEmptyBranchReg.exec(line);
6302
- if (regexResult) {
6303
- result.current = filterType(regexResult === null || regexResult === void 0 ? void 0 : regexResult[1], filterString, result.current);
6304
- }
4935
+ result.current = regexResult && regexResult[1] || result.current;
6305
4936
  result.detached = /\(no branch\)/.test(line);
6306
4937
  }
6307
4938
  ]
@@ -6414,58 +5045,6 @@ var init_version = __esm({
6414
5045
  ];
6415
5046
  }
6416
5047
  });
6417
- function createCloneTask(api, task, repoPath) {
6418
- for(var _len = arguments.length, args = new Array(_len > 3 ? _len - 3 : 0), _key = 3; _key < _len; _key++){
6419
- args[_key - 3] = arguments[_key];
6420
- }
6421
- if (!filterString(repoPath)) {
6422
- return configurationErrorTask("git.".concat(api, "() requires a string 'repoPath'"));
6423
- }
6424
- return task(repoPath, filterType(args[0], filterString), getTrailingOptions(arguments));
6425
- }
6426
- function clone_default() {
6427
- return {
6428
- clone: function clone(repo) {
6429
- for(var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
6430
- rest[_key - 1] = arguments[_key];
6431
- }
6432
- return this._runTask(createCloneTask.apply(void 0, [
6433
- "clone",
6434
- cloneTask,
6435
- filterType(repo, filterString)
6436
- ].concat(_to_consumable_array(rest))), trailingFunctionArgument(arguments));
6437
- },
6438
- mirror: function mirror(repo) {
6439
- for(var _len = arguments.length, rest = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
6440
- rest[_key - 1] = arguments[_key];
6441
- }
6442
- return this._runTask(createCloneTask.apply(void 0, [
6443
- "mirror",
6444
- cloneMirrorTask,
6445
- filterType(repo, filterString)
6446
- ].concat(_to_consumable_array(rest))), trailingFunctionArgument(arguments));
6447
- }
6448
- };
6449
- }
6450
- var cloneTask, cloneMirrorTask;
6451
- var init_clone = __esm({
6452
- "src/lib/tasks/clone.ts": function() {
6453
- init_task();
6454
- init_utils();
6455
- cloneTask = function(repo, directory, customArgs) {
6456
- var commands = [
6457
- "clone"
6458
- ].concat(_to_consumable_array(customArgs));
6459
- filterString(repo) && commands.push(c$1(repo));
6460
- filterString(directory) && commands.push(c$1(directory));
6461
- return straightThroughStringTask(commands);
6462
- };
6463
- cloneMirrorTask = function(repo, directory, customArgs) {
6464
- append(customArgs, "--mirror");
6465
- return cloneTask(repo, directory, customArgs);
6466
- };
6467
- }
6468
- });
6469
5048
  // src/lib/simple-git-api.ts
6470
5049
  var simple_git_api_exports = {};
6471
5050
  __export(simple_git_api_exports, {
@@ -6494,7 +5073,6 @@ var init_simple_git_api = __esm({
6494
5073
  init_task();
6495
5074
  init_version();
6496
5075
  init_utils();
6497
- init_clone();
6498
5076
  SimpleGitApi = /*#__PURE__*/ function() {
6499
5077
  function SimpleGitApi(_executor) {
6500
5078
  _class_call_check(this, SimpleGitApi);
@@ -6607,7 +5185,7 @@ var init_simple_git_api = __esm({
6607
5185
  ]);
6608
5186
  return SimpleGitApi;
6609
5187
  }();
6610
- Object.assign(SimpleGitApi.prototype, checkout_default(), clone_default(), commit_default(), config_default(), count_objects_default(), first_commit_default(), grep_default(), log_default(), show_default(), version_default());
5188
+ Object.assign(SimpleGitApi.prototype, checkout_default(), commit_default(), config_default(), count_objects_default(), first_commit_default(), grep_default(), log_default(), show_default(), version_default());
6611
5189
  }
6612
5190
  });
6613
5191
  // src/lib/runners/scheduler.ts
@@ -6804,12 +5382,9 @@ function branchStatus(input) {
6804
5382
  return input ? input.charAt(0) : "";
6805
5383
  }
6806
5384
  function parseBranchSummary(stdOut) {
6807
- var currentOnly = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
6808
- return parseStringResponse(new BranchSummaryResult(), currentOnly ? [
6809
- currentBranchParser
6810
- ] : parsers9, stdOut);
5385
+ return parseStringResponse(new BranchSummaryResult(), parsers9, stdOut);
6811
5386
  }
6812
- var parsers9, currentBranchParser;
5387
+ var parsers9;
6813
5388
  var init_parse_branch = __esm({
6814
5389
  "src/lib/parsers/parse-branch.ts": function() {
6815
5390
  init_BranchSummary();
@@ -6824,10 +5399,6 @@ var init_parse_branch = __esm({
6824
5399
  result.push(branchStatus(current), false, name, commit, label);
6825
5400
  })
6826
5401
  ];
6827
- currentBranchParser = new LineParser(RegExp("^(\\S+)$", "s"), function(result, param) {
6828
- var _param = _sliced_to_array(param, 1), name = _param[0];
6829
- result.push("*" /* CURRENT */ , false, name, "", "");
6830
- });
6831
5402
  }
6832
5403
  });
6833
5404
  // src/lib/tasks/branch.ts
@@ -6861,7 +5432,6 @@ function containsDeleteBranchCommand(commands) {
6861
5432
  }
6862
5433
  function branchTask(customArgs) {
6863
5434
  var isDelete = containsDeleteBranchCommand(customArgs);
6864
- var isCurrentOnly = customArgs.includes("--show-current");
6865
5435
  var commands = [
6866
5436
  "branch"
6867
5437
  ].concat(_to_consumable_array(customArgs));
@@ -6878,20 +5448,19 @@ function branchTask(customArgs) {
6878
5448
  if (isDelete) {
6879
5449
  return parseBranchDeletions(stdOut, stdErr).all[0];
6880
5450
  }
6881
- return parseBranchSummary(stdOut, isCurrentOnly);
5451
+ return parseBranchSummary(stdOut);
6882
5452
  }
6883
5453
  };
6884
5454
  }
6885
5455
  function branchLocalTask() {
5456
+ var parser4 = parseBranchSummary;
6886
5457
  return {
6887
5458
  format: "utf-8",
6888
5459
  commands: [
6889
5460
  "branch",
6890
5461
  "-v"
6891
5462
  ],
6892
- parser: function parser(stdOut) {
6893
- return parseBranchSummary(stdOut);
6894
- }
5463
+ parser: parser4
6895
5464
  };
6896
5465
  }
6897
5466
  function deleteBranchesTask(branches) {
@@ -6946,15 +5515,16 @@ var init_branch = __esm({
6946
5515
  init_utils();
6947
5516
  }
6948
5517
  });
6949
- function toPath(input) {
6950
- var path = input.trim().replace(/^["']|["']$/g, "");
6951
- return path && normalize(path);
6952
- }
5518
+ // src/lib/responses/CheckIgnore.ts
6953
5519
  var parseCheckIgnore;
6954
5520
  var init_CheckIgnore = __esm({
6955
5521
  "src/lib/responses/CheckIgnore.ts": function() {
6956
5522
  parseCheckIgnore = function(text) {
6957
- return text.split(/\n/g).map(toPath).filter(Boolean);
5523
+ return text.split(/\n/g).map(function(line) {
5524
+ return line.trim();
5525
+ }).filter(function(file) {
5526
+ return !!file;
5527
+ });
6958
5528
  };
6959
5529
  }
6960
5530
  });
@@ -6979,6 +5549,41 @@ var init_check_ignore = __esm({
6979
5549
  init_CheckIgnore();
6980
5550
  }
6981
5551
  });
5552
+ // src/lib/tasks/clone.ts
5553
+ var clone_exports = {};
5554
+ __export(clone_exports, {
5555
+ cloneMirrorTask: function() {
5556
+ return cloneMirrorTask;
5557
+ },
5558
+ cloneTask: function() {
5559
+ return cloneTask;
5560
+ }
5561
+ });
5562
+ function disallowedCommand(command) {
5563
+ return /^--upload-pack(=|$)/.test(command);
5564
+ }
5565
+ function cloneTask(repo, directory, customArgs) {
5566
+ var commands = [
5567
+ "clone"
5568
+ ].concat(_to_consumable_array(customArgs));
5569
+ filterString(repo) && commands.push(repo);
5570
+ filterString(directory) && commands.push(directory);
5571
+ var banned = commands.find(disallowedCommand);
5572
+ if (banned) {
5573
+ return configurationErrorTask("git.fetch: potential exploit argument blocked.");
5574
+ }
5575
+ return straightThroughStringTask(commands);
5576
+ }
5577
+ function cloneMirrorTask(repo, directory, customArgs) {
5578
+ append(customArgs, "--mirror");
5579
+ return cloneTask(repo, directory, customArgs);
5580
+ }
5581
+ var init_clone = __esm({
5582
+ "src/lib/tasks/clone.ts": function() {
5583
+ init_task();
5584
+ init_utils();
5585
+ }
5586
+ });
6982
5587
  // src/lib/parsers/parse-fetch.ts
6983
5588
  function parseFetchResult(stdOut, stdErr) {
6984
5589
  var result = {
@@ -7042,7 +5647,7 @@ __export(fetch_exports, {
7042
5647
  return fetchTask;
7043
5648
  }
7044
5649
  });
7045
- function disallowedCommand(command) {
5650
+ function disallowedCommand2(command) {
7046
5651
  return /^--upload-pack(=|$)/.test(command);
7047
5652
  }
7048
5653
  function fetchTask(remote, branch, customArgs) {
@@ -7052,7 +5657,7 @@ function fetchTask(remote, branch, customArgs) {
7052
5657
  if (remote && branch) {
7053
5658
  commands.push(remote, branch);
7054
5659
  }
7055
- var banned = commands.find(disallowedCommand);
5660
+ var banned = commands.find(disallowedCommand2);
7056
5661
  if (banned) {
7057
5662
  return configurationErrorTask("git.fetch: potential exploit argument blocked.");
7058
5663
  }
@@ -7165,7 +5770,7 @@ function parseGetRemotesVerbose(text) {
7165
5770
  var remotes = {};
7166
5771
  forEach(text, function(param) {
7167
5772
  var _param = _sliced_to_array(param, 3), name = _param[0], url = _param[1], purpose = _param[2];
7168
- if (!Object.hasOwn(remotes, name)) {
5773
+ if (!remotes.hasOwnProperty(name)) {
7169
5774
  remotes[name] = {
7170
5775
  name: name,
7171
5776
  refs: {
@@ -7334,8 +5939,8 @@ var init_sub_module = __esm({
7334
5939
  });
7335
5940
  // src/lib/responses/TagList.ts
7336
5941
  function singleSorted(a, b) {
7337
- var aIsNum = Number.isNaN(a);
7338
- var bIsNum = Number.isNaN(b);
5942
+ var aIsNum = isNaN(a);
5943
+ var bIsNum = isNaN(b);
7339
5944
  if (aIsNum !== bIsNum) {
7340
5945
  return aIsNum ? 1 : -1;
7341
5946
  }
@@ -7458,24 +6063,25 @@ var require_git = __commonJS({
7458
6063
  var _ref = (init_git_executor(), __toCommonJS(git_executor_exports)), GitExecutor2 = _ref.GitExecutor;
7459
6064
  var _ref1 = (init_simple_git_api(), __toCommonJS(simple_git_api_exports)), SimpleGitApi2 = _ref1.SimpleGitApi;
7460
6065
  var _ref2 = (init_scheduler(), __toCommonJS(scheduler_exports)), Scheduler2 = _ref2.Scheduler;
7461
- var _ref3 = (init_task(), __toCommonJS(task_exports)), adhocExecTask2 = _ref3.adhocExecTask, configurationErrorTask2 = _ref3.configurationErrorTask;
6066
+ var _ref3 = (init_task(), __toCommonJS(task_exports)), configurationErrorTask2 = _ref3.configurationErrorTask;
7462
6067
  var _ref4 = (init_utils(), __toCommonJS(utils_exports)), asArray2 = _ref4.asArray, filterArray2 = _ref4.filterArray, filterPrimitives2 = _ref4.filterPrimitives, filterString2 = _ref4.filterString, filterStringOrStringArray2 = _ref4.filterStringOrStringArray, filterType2 = _ref4.filterType, getTrailingOptions2 = _ref4.getTrailingOptions, trailingFunctionArgument2 = _ref4.trailingFunctionArgument, trailingOptionsArgument2 = _ref4.trailingOptionsArgument;
7463
6068
  var _ref5 = (init_apply_patch(), __toCommonJS(apply_patch_exports)), applyPatchTask2 = _ref5.applyPatchTask;
7464
6069
  var _ref6 = (init_branch(), __toCommonJS(branch_exports)), branchTask2 = _ref6.branchTask, branchLocalTask2 = _ref6.branchLocalTask, deleteBranchesTask2 = _ref6.deleteBranchesTask, deleteBranchTask2 = _ref6.deleteBranchTask;
7465
6070
  var _ref7 = (init_check_ignore(), __toCommonJS(check_ignore_exports)), checkIgnoreTask2 = _ref7.checkIgnoreTask;
7466
6071
  var _ref8 = (init_check_is_repo(), __toCommonJS(check_is_repo_exports)), checkIsRepoTask2 = _ref8.checkIsRepoTask;
7467
- var _ref9 = (init_clean(), __toCommonJS(clean_exports)), cleanWithOptionsTask2 = _ref9.cleanWithOptionsTask, isCleanOptionsArray2 = _ref9.isCleanOptionsArray;
7468
- var _ref10 = (init_diff(), __toCommonJS(diff_exports)), diffSummaryTask2 = _ref10.diffSummaryTask;
7469
- var _ref11 = (init_fetch(), __toCommonJS(fetch_exports)), fetchTask2 = _ref11.fetchTask;
7470
- var _ref12 = (init_move(), __toCommonJS(move_exports)), moveTask2 = _ref12.moveTask;
7471
- var _ref13 = (init_pull(), __toCommonJS(pull_exports)), pullTask2 = _ref13.pullTask;
7472
- var _ref14 = (init_push(), __toCommonJS(push_exports)), pushTagsTask2 = _ref14.pushTagsTask;
7473
- var _ref15 = (init_remote(), __toCommonJS(remote_exports)), addRemoteTask2 = _ref15.addRemoteTask, getRemotesTask2 = _ref15.getRemotesTask, listRemotesTask2 = _ref15.listRemotesTask, remoteTask2 = _ref15.remoteTask, removeRemoteTask2 = _ref15.removeRemoteTask;
7474
- var _ref16 = (init_reset(), __toCommonJS(reset_exports)), getResetMode2 = _ref16.getResetMode, resetTask2 = _ref16.resetTask;
7475
- var _ref17 = (init_stash_list(), __toCommonJS(stash_list_exports)), stashListTask2 = _ref17.stashListTask;
7476
- var _ref18 = (init_sub_module(), __toCommonJS(sub_module_exports)), addSubModuleTask2 = _ref18.addSubModuleTask, initSubModuleTask2 = _ref18.initSubModuleTask, subModuleTask2 = _ref18.subModuleTask, updateSubModuleTask2 = _ref18.updateSubModuleTask;
7477
- var _ref19 = (init_tag(), __toCommonJS(tag_exports)), addAnnotatedTagTask2 = _ref19.addAnnotatedTagTask, addTagTask2 = _ref19.addTagTask, tagListTask2 = _ref19.tagListTask;
7478
- var _ref20 = (init_task(), __toCommonJS(task_exports)), straightThroughBufferTask2 = _ref20.straightThroughBufferTask, straightThroughStringTask2 = _ref20.straightThroughStringTask;
6072
+ var _ref9 = (init_clone(), __toCommonJS(clone_exports)), cloneTask2 = _ref9.cloneTask, cloneMirrorTask2 = _ref9.cloneMirrorTask;
6073
+ var _ref10 = (init_clean(), __toCommonJS(clean_exports)), cleanWithOptionsTask2 = _ref10.cleanWithOptionsTask, isCleanOptionsArray2 = _ref10.isCleanOptionsArray;
6074
+ var _ref11 = (init_diff(), __toCommonJS(diff_exports)), diffSummaryTask2 = _ref11.diffSummaryTask;
6075
+ var _ref12 = (init_fetch(), __toCommonJS(fetch_exports)), fetchTask2 = _ref12.fetchTask;
6076
+ var _ref13 = (init_move(), __toCommonJS(move_exports)), moveTask2 = _ref13.moveTask;
6077
+ var _ref14 = (init_pull(), __toCommonJS(pull_exports)), pullTask2 = _ref14.pullTask;
6078
+ var _ref15 = (init_push(), __toCommonJS(push_exports)), pushTagsTask2 = _ref15.pushTagsTask;
6079
+ var _ref16 = (init_remote(), __toCommonJS(remote_exports)), addRemoteTask2 = _ref16.addRemoteTask, getRemotesTask2 = _ref16.getRemotesTask, listRemotesTask2 = _ref16.listRemotesTask, remoteTask2 = _ref16.remoteTask, removeRemoteTask2 = _ref16.removeRemoteTask;
6080
+ var _ref17 = (init_reset(), __toCommonJS(reset_exports)), getResetMode2 = _ref17.getResetMode, resetTask2 = _ref17.resetTask;
6081
+ var _ref18 = (init_stash_list(), __toCommonJS(stash_list_exports)), stashListTask2 = _ref18.stashListTask;
6082
+ var _ref19 = (init_sub_module(), __toCommonJS(sub_module_exports)), addSubModuleTask2 = _ref19.addSubModuleTask, initSubModuleTask2 = _ref19.initSubModuleTask, subModuleTask2 = _ref19.subModuleTask, updateSubModuleTask2 = _ref19.updateSubModuleTask;
6083
+ var _ref20 = (init_tag(), __toCommonJS(tag_exports)), addAnnotatedTagTask2 = _ref20.addAnnotatedTagTask, addTagTask2 = _ref20.addTagTask, tagListTask2 = _ref20.tagListTask;
6084
+ var _ref21 = (init_task(), __toCommonJS(task_exports)), straightThroughBufferTask2 = _ref21.straightThroughBufferTask, straightThroughStringTask2 = _ref21.straightThroughStringTask;
7479
6085
  function Git2(options, plugins) {
7480
6086
  this._plugins = plugins;
7481
6087
  this._executor = new GitExecutor2(options.baseDir, new Scheduler2(options.maxConcurrentProcesses), plugins);
@@ -7497,6 +6103,24 @@ var require_git = __commonJS({
7497
6103
  Git2.prototype.stashList = function(options) {
7498
6104
  return this._runTask(stashListTask2(trailingOptionsArgument2(arguments) || {}, filterArray2(options) && options || []), trailingFunctionArgument2(arguments));
7499
6105
  };
6106
+ function createCloneTask(api, task, repoPath, localPath) {
6107
+ if (typeof repoPath !== "string") {
6108
+ return configurationErrorTask2("git.".concat(api, "() requires a string 'repoPath'"));
6109
+ }
6110
+ return task(repoPath, filterType2(localPath, filterString2), getTrailingOptions2(arguments));
6111
+ }
6112
+ Git2.prototype.clone = function() {
6113
+ return this._runTask(createCloneTask.apply(void 0, [
6114
+ "clone",
6115
+ cloneTask2
6116
+ ].concat(Array.prototype.slice.call(arguments))), trailingFunctionArgument2(arguments));
6117
+ };
6118
+ Git2.prototype.mirror = function() {
6119
+ return this._runTask(createCloneTask.apply(void 0, [
6120
+ "mirror",
6121
+ cloneMirrorTask2
6122
+ ].concat(Array.prototype.slice.call(arguments))), trailingFunctionArgument2(arguments));
6123
+ };
7500
6124
  Git2.prototype.mv = function(from, to) {
7501
6125
  return this._runTask(moveTask2(from, to), trailingFunctionArgument2(arguments));
7502
6126
  };
@@ -7515,9 +6139,8 @@ var require_git = __commonJS({
7515
6139
  return this._runTask(fetchTask2(filterType2(remote, filterString2), filterType2(branch, filterString2), getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));
7516
6140
  };
7517
6141
  Git2.prototype.silent = function(silence) {
7518
- return this._runTask(adhocExecTask2(function() {
7519
- return console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed.");
7520
- }));
6142
+ console.warn("simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this will be an error in version 3");
6143
+ return this;
7521
6144
  };
7522
6145
  Git2.prototype.tags = function(options, then) {
7523
6146
  return this._runTask(tagListTask2(getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));
@@ -7693,9 +6316,7 @@ var require_git = __commonJS({
7693
6316
  return this._runTask(task);
7694
6317
  };
7695
6318
  Git2.prototype.clearQueue = function() {
7696
- return this._runTask(adhocExecTask2(function() {
7697
- return console.warn("simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead.");
7698
- }));
6319
+ return this;
7699
6320
  };
7700
6321
  Git2.prototype.checkIgnore = function(pathnames, then) {
7701
6322
  return this._runTask(checkIgnoreTask2(asArray2(filterType2(pathnames, filterStringOrStringArray2, []))), trailingFunctionArgument2(arguments));
@@ -7706,6 +6327,8 @@ var require_git = __commonJS({
7706
6327
  module.exports = Git2;
7707
6328
  }
7708
6329
  });
6330
+ // src/lib/api.ts
6331
+ init_pathspec();
7709
6332
  // src/lib/errors/git-construct-error.ts
7710
6333
  init_git_error();
7711
6334
  var GitConstructError = /*#__PURE__*/ function(GitError) {
@@ -7777,34 +6400,40 @@ function abortPlugin(signal) {
7777
6400
  onSpawnAfter
7778
6401
  ];
7779
6402
  }
6403
+ // src/lib/plugins/block-unsafe-operations-plugin.ts
6404
+ function isConfigSwitch(arg) {
6405
+ return typeof arg === "string" && arg.trim().toLowerCase() === "-c";
6406
+ }
6407
+ function preventProtocolOverride(arg, next) {
6408
+ if (!isConfigSwitch(arg)) {
6409
+ return;
6410
+ }
6411
+ if (!/^\s*protocol(.[a-z]+)?.allow/.test(next)) {
6412
+ return;
6413
+ }
6414
+ throw new GitPluginError(void 0, "unsafe", "Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol");
6415
+ }
6416
+ function preventUploadPack(arg, method) {
6417
+ if (/^\s*--(upload|receive)-pack/.test(arg)) {
6418
+ throw new GitPluginError(void 0, "unsafe", "Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack");
6419
+ }
6420
+ if (method === "clone" && /^\s*-u\b/.test(arg)) {
6421
+ throw new GitPluginError(void 0, "unsafe", "Use of clone with option -u is not permitted without enabling allowUnsafePack");
6422
+ }
6423
+ if (method === "push" && /^\s*--exec\b/.test(arg)) {
6424
+ throw new GitPluginError(void 0, "unsafe", "Use of push with option --exec is not permitted without enabling allowUnsafePack");
6425
+ }
6426
+ }
7780
6427
  function blockUnsafeOperationsPlugin() {
7781
- var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
6428
+ var _ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, _ref_allowUnsafeProtocolOverride = _ref.allowUnsafeProtocolOverride, allowUnsafeProtocolOverride = _ref_allowUnsafeProtocolOverride === void 0 ? false : _ref_allowUnsafeProtocolOverride, _ref_allowUnsafePack = _ref.allowUnsafePack, allowUnsafePack = _ref_allowUnsafePack === void 0 ? false : _ref_allowUnsafePack;
7782
6429
  return {
7783
6430
  type: "spawn.args",
7784
- action: function action(args, param) {
7785
- var env = param.env;
7786
- var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
7787
- try {
7788
- for(var _iterator = ne(args, env)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
7789
- var vulnerability = _step.value;
7790
- if (options[vulnerability.category] !== true) {
7791
- throw new GitPluginError(void 0, "unsafe", vulnerability.message);
7792
- }
7793
- }
7794
- } catch (err) {
7795
- _didIteratorError = true;
7796
- _iteratorError = err;
7797
- } finally{
7798
- try {
7799
- if (!_iteratorNormalCompletion && _iterator.return != null) {
7800
- _iterator.return();
7801
- }
7802
- } finally{
7803
- if (_didIteratorError) {
7804
- throw _iteratorError;
7805
- }
7806
- }
7807
- }
6431
+ action: function action(args, context) {
6432
+ args.forEach(function(current, index) {
6433
+ var next = index < args.length ? args[index + 1] : "";
6434
+ allowUnsafeProtocolOverride || preventProtocolOverride(current, next);
6435
+ allowUnsafePack || preventUploadPack(current, context.method);
6436
+ });
7808
6437
  return args;
7809
6438
  }
7810
6439
  };
@@ -7938,7 +6567,7 @@ init_utils();
7938
6567
  var WRONG_NUMBER_ERR = "Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings";
7939
6568
  var WRONG_CHARS_ERR = "Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option";
7940
6569
  function isBadArgument(arg) {
7941
- return !arg || !/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(arg);
6570
+ return !arg || !/^([a-z]:)?([a-z0-9/.\\_-]+)$/i.test(arg);
7942
6571
  }
7943
6572
  function toBinaryConfig(input, allowUnsafe) {
7944
6573
  if (input.length < 1 || input.length > 2) {
@@ -8192,6 +6821,8 @@ function timeoutPlugin(param) {
8192
6821
  };
8193
6822
  }
8194
6823
  }
6824
+ // src/lib/plugins/suffix-paths.plugin.ts
6825
+ init_pathspec();
8195
6826
  function suffixPathsPlugin() {
8196
6827
  return {
8197
6828
  type: "spawn.args",
@@ -8204,13 +6835,13 @@ function suffixPathsPlugin() {
8204
6835
  }
8205
6836
  for(var i = 0; i < data.length; i++){
8206
6837
  var param = data[i];
8207
- if (r(param)) {
8208
- append2(o(param));
6838
+ if (isPathSpec(param)) {
6839
+ append2(toPaths(param));
8209
6840
  continue;
8210
6841
  }
8211
6842
  if (param === "--") {
8212
6843
  append2(data.slice(i + 1).flatMap(function(item) {
8213
- return r(item) && o(item) || item;
6844
+ return isPathSpec(item) && toPaths(item) || item;
8214
6845
  }));
8215
6846
  break;
8216
6847
  }
@@ -8238,12 +6869,12 @@ function gitInstanceFactory(baseDir, options) {
8238
6869
  plugins.add(commandConfigPrefixingPlugin(config.config));
8239
6870
  }
8240
6871
  plugins.add(blockUnsafeOperationsPlugin(config.unsafe));
6872
+ plugins.add(suffixPathsPlugin());
8241
6873
  plugins.add(completionDetectionPlugin(config.completion));
8242
6874
  config.abort && plugins.add(abortPlugin(config.abort));
8243
6875
  config.progress && plugins.add(progressMonitorPlugin(config.progress));
8244
6876
  config.timeout && plugins.add(timeoutPlugin(config.timeout));
8245
6877
  config.spawnOptions && plugins.add(spawnOptionsPlugin(config.spawnOptions));
8246
- plugins.add(suffixPathsPlugin());
8247
6878
  plugins.add(errorDetectionPlugin(errorDetectionHandler(true)));
8248
6879
  config.errors && plugins.add(errorDetectionPlugin(config.errors));
8249
6880
  customBinaryPlugin(plugins, config.binary, (_config_unsafe = config.unsafe) === null || _config_unsafe === void 0 ? void 0 : _config_unsafe.allowUnsafeCustomBinary);