@bigbinary/neeto-audit-frontend 2.4.5 → 2.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import process$3 from 'node:process';
3
3
  import os from 'node:os';
4
4
  import tty from 'node:tty';
5
5
  import require$$1, { spawn, exec } from 'child_process';
6
- import require$$0$2, { EventEmitter as EventEmitter$1 } from 'events';
6
+ import require$$0$2, { EventEmitter as EventEmitter$2 } from 'events';
7
7
  import path$2 from 'path';
8
8
  import require$$3, { promises } from 'fs';
9
9
  import require$$4 from 'process';
@@ -12,6 +12,8 @@ import require$$0$3 from 'assert';
12
12
  import require$$1$1 from 'tty';
13
13
  import util$3 from 'util';
14
14
  import require$$0$4 from 'os';
15
+ import { normalize } from 'node:path';
16
+ import { EventEmitter as EventEmitter$1 } from 'node:events';
15
17
  import stream, { Readable } from 'stream';
16
18
  import require$$3$1 from 'http';
17
19
  import require$$4$1 from 'https';
@@ -10053,7 +10055,7 @@ function requireMs () {
10053
10055
  * @api public
10054
10056
  */
10055
10057
 
10056
- ms = function(val, options) {
10058
+ ms = function (val, options) {
10057
10059
  options = options || {};
10058
10060
  var type = typeof val;
10059
10061
  if (type === 'string' && val.length > 0) {
@@ -10366,24 +10368,62 @@ function requireCommon () {
10366
10368
  createDebug.names = [];
10367
10369
  createDebug.skips = [];
10368
10370
 
10369
- let i;
10370
- const split = (typeof namespaces === 'string' ? namespaces : '').split(/[\s,]+/);
10371
- const len = split.length;
10371
+ const split = (typeof namespaces === 'string' ? namespaces : '')
10372
+ .trim()
10373
+ .replace(/\s+/g, ',')
10374
+ .split(',')
10375
+ .filter(Boolean);
10372
10376
 
10373
- for (i = 0; i < len; i++) {
10374
- if (!split[i]) {
10375
- // ignore empty strings
10376
- continue;
10377
+ for (const ns of split) {
10378
+ if (ns[0] === '-') {
10379
+ createDebug.skips.push(ns.slice(1));
10380
+ } else {
10381
+ createDebug.names.push(ns);
10377
10382
  }
10383
+ }
10384
+ }
10378
10385
 
10379
- namespaces = split[i].replace(/\*/g, '.*?');
10380
-
10381
- if (namespaces[0] === '-') {
10382
- createDebug.skips.push(new RegExp('^' + namespaces.slice(1) + '$'));
10386
+ /**
10387
+ * Checks if the given string matches a namespace template, honoring
10388
+ * asterisks as wildcards.
10389
+ *
10390
+ * @param {String} search
10391
+ * @param {String} template
10392
+ * @return {Boolean}
10393
+ */
10394
+ function matchesTemplate(search, template) {
10395
+ let searchIndex = 0;
10396
+ let templateIndex = 0;
10397
+ let starIndex = -1;
10398
+ let matchIndex = 0;
10399
+
10400
+ while (searchIndex < search.length) {
10401
+ if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {
10402
+ // Match character or proceed with wildcard
10403
+ if (template[templateIndex] === '*') {
10404
+ starIndex = templateIndex;
10405
+ matchIndex = searchIndex;
10406
+ templateIndex++; // Skip the '*'
10407
+ } else {
10408
+ searchIndex++;
10409
+ templateIndex++;
10410
+ }
10411
+ } else if (starIndex !== -1) { // eslint-disable-line no-negated-condition
10412
+ // Backtrack to the last '*' and try to match more characters
10413
+ templateIndex = starIndex + 1;
10414
+ matchIndex++;
10415
+ searchIndex = matchIndex;
10383
10416
  } else {
10384
- createDebug.names.push(new RegExp('^' + namespaces + '$'));
10417
+ return false; // No match
10385
10418
  }
10386
10419
  }
10420
+
10421
+ // Handle trailing '*' in template
10422
+ while (templateIndex < template.length && template[templateIndex] === '*') {
10423
+ templateIndex++;
10424
+ }
10425
+
10426
+ return templateIndex === template.length;
10387
10427
  }
10388
10428
 
10389
10429
  /**
@@ -10394,8 +10434,8 @@ function requireCommon () {
10394
10434
  */
10395
10435
  function disable() {
10396
10436
  const namespaces = [
10397
- ...createDebug.names.map(toNamespace),
10398
- ...createDebug.skips.map(toNamespace).map(namespace => '-' + namespace)
10437
+ ...createDebug.names,
10438
+ ...createDebug.skips.map(namespace => '-' + namespace)
10399
10439
  ].join(',');
10400
10440
  createDebug.enable('');
10401
10441
  return namespaces;
@@ -10409,21 +10449,14 @@ function requireCommon () {
10409
10449
  * @api public
10410
10450
  */
10411
10451
  function enabled(name) {
10412
- if (name[name.length - 1] === '*') {
10413
- return true;
10414
- }
10415
-
10416
- let i;
10417
- let len;
10418
-
10419
- for (i = 0, len = createDebug.skips.length; i < len; i++) {
10420
- if (createDebug.skips[i].test(name)) {
10452
+ for (const skip of createDebug.skips) {
10453
+ if (matchesTemplate(name, skip)) {
10421
10454
  return false;
10422
10455
  }
10423
10456
  }
10424
10457
 
10425
- for (i = 0, len = createDebug.names.length; i < len; i++) {
10426
- if (createDebug.names[i].test(name)) {
10458
+ for (const ns of createDebug.names) {
10459
+ if (matchesTemplate(name, ns)) {
10427
10460
  return true;
10428
10461
  }
10429
10462
  }
@@ -10431,19 +10464,6 @@ function requireCommon () {
10431
10464
  return false;
10432
10465
  }
10433
10466
 
10434
- /**
10435
- * Convert regexp to namespace
10436
- *
10437
- * @param {RegExp} regxep
10438
- * @return {String} namespace
10439
- * @api private
10440
- */
10441
- function toNamespace(regexp) {
10442
- return regexp.toString()
10443
- .substring(2, regexp.toString().length - 2)
10444
- .replace(/\.\*\?$/, '*');
10445
- }
10446
-
10447
10467
  /**
10448
10468
  * Coerce `val`.
10449
10469
  *
@@ -10608,14 +10628,17 @@ function requireBrowser () {
10608
10628
  return false;
10609
10629
  }
10610
10630
 
10631
+ let m;
10632
+
10611
10633
  // Is webkit? http://stackoverflow.com/a/16459606/376773
10612
10634
  // document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
10635
+ // eslint-disable-next-line no-return-assign
10613
10636
  return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
10614
10637
  // Is firebug? http://stackoverflow.com/a/398120/376773
10615
10638
  (typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
10616
10639
  // Is firefox >= v31?
10617
10640
  // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
10618
- (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/) && parseInt(RegExp.$1, 10) >= 31) ||
10641
+ (typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) ||
10619
10642
  // Double check webkit in userAgent just in case we are in a worker
10620
10643
  (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
10621
10644
  }
@@ -10699,7 +10722,7 @@ function requireBrowser () {
10699
10722
  function load() {
10700
10723
  let r;
10701
10724
  try {
10702
- r = exports$1.storage.getItem('debug');
10725
+ r = exports$1.storage.getItem('debug') || exports$1.storage.getItem('DEBUG') ;
10703
10726
  } catch (error) {
10704
10727
  // Swallow
10705
10728
  // XXX (@Qix-) should we be logging these?
@@ -11127,11 +11150,11 @@ function requireNode () {
11127
11150
  }
11128
11151
 
11129
11152
  /**
11130
- * Invokes `util.format()` with the specified arguments and writes to stderr.
11153
+ * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.
11131
11154
  */
11132
11155
 
11133
11156
  function log(...args) {
11134
- return process.stderr.write(util.format(...args) + '\n');
11157
+ return process.stderr.write(util.formatWithOptions(exports$1.inspectOpts, ...args) + '\n');
11135
11158
  }
11136
11159
 
11137
11160
  /**
@@ -11285,6 +11308,18 @@ var debug$2 = /*@__PURE__*/getDefaultExportFromCjs(srcExports);
11285
11308
 
11286
11309
  } (dist$1));
11287
11310
 
11311
+ const t = /* @__PURE__ */ new WeakMap();
11312
+ function c$1(...n) {
11313
+ const e = new String(n);
11314
+ return t.set(e, n), e;
11315
+ }
11316
+ function r(n) {
11317
+ return n instanceof String && t.has(n);
11318
+ }
11319
+ function o(n) {
11320
+ return t.get(n) ?? [];
11321
+ }
11322
+
11288
11323
  var dist = {};
11289
11324
 
11290
11325
  Object.defineProperty(dist, "__esModule", { value: true });
@@ -11345,28 +11380,467 @@ createDeferred = dist.createDeferred = deferred;
11345
11380
  */
11346
11381
  dist.default = deferred;
11347
11382
 
11383
+ function* U(e, t) {
11384
+ const n = t === "global";
11385
+ for (const o of e)
11386
+ o.isGlobal === n && (yield o);
11387
+ }
11388
+ const k = /* @__PURE__ */ new Set([
11389
+ "--add",
11390
+ "--edit",
11391
+ "--remove-section",
11392
+ "--rename-section",
11393
+ "--replace-all",
11394
+ "--unset",
11395
+ "--unset-all",
11396
+ "-e"
11397
+ ]), S = /* @__PURE__ */ new Set([
11398
+ "--get",
11399
+ "--get-all",
11400
+ "--get-color",
11401
+ "--get-colorbool",
11402
+ "--get-regexp",
11403
+ "--get-urlmatch",
11404
+ "--list",
11405
+ "-l"
11406
+ ]), P = /* @__PURE__ */ new Set([
11407
+ "edit",
11408
+ "remove-section",
11409
+ "rename-section",
11410
+ "set",
11411
+ "unset"
11412
+ ]), E = /* @__PURE__ */ new Set(["get", "get-color", "get-colorbool", "list"]);
11413
+ function F(e, t) {
11414
+ for (const { name: o } of U(e, "task")) {
11415
+ if (k.has(o))
11416
+ return p(true, t);
11417
+ if (S.has(o))
11418
+ return p(false, t);
11419
+ }
11420
+ const n = t.at(0)?.toLowerCase();
11421
+ 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);
11422
+ }
11423
+ function p(e = false, t = []) {
11424
+ const n = t.at(0)?.toLowerCase();
11425
+ return n === void 0 ? null : {
11426
+ isWrite: e,
11427
+ isRead: !e,
11428
+ key: n,
11429
+ value: t.at(1)
11430
+ };
11431
+ }
11432
+ function A(e, t) {
11433
+ return t.isWrite && t.value !== void 0 ? { key: t.key, value: t.value, scope: e } : { key: t.key, scope: e };
11434
+ }
11435
+ function M(e) {
11436
+ const t = e?.indexOf("=") || -1;
11437
+ return !e || t < 0 ? null : {
11438
+ key: e.slice(0, t).trim().toLowerCase(),
11439
+ value: e.slice(t + 1)
11440
+ };
11441
+ }
11442
+ function N(e) {
11443
+ for (const { name: t } of U(e, "task"))
11444
+ switch (t) {
11445
+ case "--global":
11446
+ return "global";
11447
+ case "--system":
11448
+ return "system";
11449
+ case "--worktree":
11450
+ return "worktree";
11451
+ case "--local":
11452
+ return "local";
11453
+ case "--file":
11454
+ case "-f":
11455
+ return "file";
11456
+ }
11457
+ return "local";
11458
+ }
11459
+ function G$1({ name: e }) {
11460
+ if (e === "-c" || e === "--config")
11461
+ return "inline";
11462
+ if (e === "--config-env")
11463
+ return "env";
11464
+ }
11465
+ function* O(e) {
11466
+ for (const t of e) {
11467
+ const n = G$1(t), o = n && M(t.value);
11468
+ o && (yield {
11469
+ ...o,
11470
+ scope: n
11471
+ });
11472
+ }
11473
+ }
11474
+ function L(e, t, n) {
11475
+ const o = {
11476
+ read: [],
11477
+ write: [...O(t)]
11478
+ };
11479
+ return e === "config" && $(
11480
+ o,
11481
+ N(t),
11482
+ F(t, n)
11483
+ ), o;
11484
+ }
11485
+ function $(e, t, n) {
11486
+ if (n === null)
11487
+ return;
11488
+ const o = A(t, n);
11489
+ n.isWrite ? e.write.push(o) : e.read.push(o);
11490
+ }
11491
+ const x = {
11492
+ short: /* @__PURE__ */ new Map([
11493
+ ["c", true]
11494
+ // -c <k=v> set config key for this invocation
11495
+ ])
11496
+ }, D = {
11497
+ short: new Map([
11498
+ ["C", true],
11499
+ // -C <path> change working directory
11500
+ ["P", false],
11501
+ // -P no pager (alias for --no-pager)
11502
+ ["h", false],
11503
+ // -h help
11504
+ ["p", false],
11505
+ // -p paginate
11506
+ ["v", false],
11507
+ // -v version
11508
+ ...x.short.entries()
11509
+ ]),
11510
+ long: /* @__PURE__ */ new Set([
11511
+ "attr-source",
11512
+ "config-env",
11513
+ "exec-path",
11514
+ "git-dir",
11515
+ "list-cmds",
11516
+ "namespace",
11517
+ "super-prefix",
11518
+ "work-tree"
11519
+ ])
11520
+ }, R = {
11521
+ clone: {
11522
+ short: /* @__PURE__ */ new Map([
11523
+ ["b", true],
11524
+ // -b <branch>
11525
+ ["j", true],
11526
+ // -j <n> parallel jobs
11527
+ ["l", false],
11528
+ // -l local
11529
+ ["n", false],
11530
+ // -n no-checkout
11531
+ ["o", true],
11532
+ // -o <name> remote name
11533
+ ["q", false],
11534
+ // -q quiet
11535
+ ["s", false],
11536
+ // -s shared
11537
+ ["u", true]
11538
+ // -u <upload-pack>
11539
+ ]),
11540
+ long: /* @__PURE__ */ new Set(["branch", "config", "jobs", "origin", "upload-pack", "u", "template"])
11541
+ },
11542
+ commit: {
11543
+ short: /* @__PURE__ */ new Map([
11544
+ ["C", true],
11545
+ // -C <commit> reuse message
11546
+ ["F", true],
11547
+ // -F <file> read message from file
11548
+ ["c", true],
11549
+ // -c <commit> reedit message
11550
+ ["m", true],
11551
+ // -m <msg>
11552
+ ["t", true]
11553
+ // -t <template>
11554
+ ]),
11555
+ long: /* @__PURE__ */ new Set(["file", "message", "reedit-message", "reuse-message", "template"])
11556
+ },
11557
+ config: {
11558
+ short: /* @__PURE__ */ new Map([
11559
+ ["e", false],
11560
+ // -e open editor
11561
+ ["f", true],
11562
+ // -f <file>
11563
+ ["l", false]
11564
+ // -l list
11565
+ ]),
11566
+ long: /* @__PURE__ */ new Set(["blob", "comment", "default", "file", "type", "value"])
11567
+ },
11568
+ fetch: {
11569
+ short: /* @__PURE__ */ new Map(),
11570
+ long: /* @__PURE__ */ new Set(["upload-pack"])
11571
+ },
11572
+ init: {
11573
+ short: /* @__PURE__ */ new Map(),
11574
+ long: /* @__PURE__ */ new Set(["template"])
11575
+ },
11576
+ pull: {
11577
+ short: /* @__PURE__ */ new Map(),
11578
+ long: /* @__PURE__ */ new Set(["upload-pack"])
11579
+ },
11580
+ push: {
11581
+ short: /* @__PURE__ */ new Map(),
11582
+ long: /* @__PURE__ */ new Set(["exec", "receive-pack"])
11583
+ }
11584
+ }, T = { short: /* @__PURE__ */ new Map(), long: /* @__PURE__ */ new Set() };
11585
+ function I(e) {
11586
+ const t = R[e ?? ""] ?? T;
11587
+ return {
11588
+ short: new Map([...x.short.entries(), ...t.short.entries()]),
11589
+ long: t.long
11590
+ };
11591
+ }
11592
+ function b(e, t = D) {
11593
+ if (e.startsWith("--")) {
11594
+ const n = e.indexOf("=");
11595
+ if (n > 2)
11596
+ return [{ name: e.slice(0, n), value: e.slice(n + 1), needsNext: false }];
11597
+ const o = e.slice(2);
11598
+ return [{ name: e, needsNext: t.long.has(o) }];
11599
+ }
11600
+ if (e.length === 2) {
11601
+ const n = e.charAt(1), o = t.short.get(n);
11602
+ return [{ name: e, needsNext: o === true }];
11603
+ }
11604
+ return W(e, t.short);
11605
+ }
11606
+ function W(e, t) {
11607
+ const n = e.slice(1).split(""), o = [];
11608
+ for (let s = 0; s < n.length; s++) {
11609
+ const r = n[s], l = t.get(r);
11610
+ if (l === void 0)
11611
+ return [{ name: e, needsNext: false }];
11612
+ if (l) {
11613
+ const a = n.slice(s + 1).join("");
11614
+ if (a && ![...a].every((w) => t.has(w)))
11615
+ return o.push({ name: `-${r}`, value: a, needsNext: false }), o;
11616
+ }
11617
+ o.push({ name: `-${r}`, needsNext: l });
11618
+ }
11619
+ return o;
11620
+ }
11621
+ function j(e, t = []) {
11622
+ let n = 0;
11623
+ for (; n < e.length; ) {
11624
+ const o = String(e[n]);
11625
+ if (!o.startsWith("-") || o.length < 2) break;
11626
+ const s = b(o);
11627
+ let r = n + 1;
11628
+ for (const l of s) {
11629
+ const a = {
11630
+ name: l.name,
11631
+ value: l.value,
11632
+ absorbedNext: false,
11633
+ isGlobal: true
11634
+ };
11635
+ l.needsNext && a.value === void 0 && r < e.length && (a.value = String(e[r]), a.absorbedNext = true, r++), t.push(a);
11636
+ }
11637
+ n = r;
11638
+ }
11639
+ return { flags: t, taskIndex: n };
11640
+ }
11641
+ function B(e, t, n = []) {
11642
+ const o$1 = I(t), s = [], r$1 = [];
11643
+ let l = 0;
11644
+ for (; l < e.length; ) {
11645
+ const a = e[l];
11646
+ if (r(a)) {
11647
+ r$1.push(...o(a)), l++;
11648
+ continue;
11649
+ }
11650
+ const f = String(a);
11651
+ if (f === "--") {
11652
+ for (let g = l + 1; g < e.length; g++) {
11653
+ const u = e[g];
11654
+ r(u) ? r$1.push(...o(u)) : r$1.push(String(u));
11655
+ }
11656
+ break;
11657
+ }
11658
+ if (!f.startsWith("-") || f.length < 2) {
11659
+ s.push(f), l++;
11660
+ continue;
11661
+ }
11662
+ const w = b(f, o$1);
11663
+ let d = l + 1;
11664
+ for (const g of w) {
11665
+ const u = {
11666
+ name: g.name,
11667
+ value: g.value,
11668
+ absorbedNext: false,
11669
+ isGlobal: false
11670
+ };
11671
+ g.needsNext && u.value === void 0 && d < e.length && !r(e[d]) && (u.value = String(e[d]), u.absorbedNext = true, d++), n.push(u);
11672
+ }
11673
+ l = d;
11674
+ }
11675
+ return { flags: n, positionals: s, pathspecs: r$1 };
11676
+ }
11677
+ function* V({
11678
+ write: e
11679
+ }) {
11680
+ for (const t of e)
11681
+ for (const n of q) {
11682
+ const o = n(t.key);
11683
+ o && (yield o);
11684
+ }
11685
+ }
11686
+ function c(e, t, n = String(e)) {
11687
+ const o = typeof e == "string" ? new RegExp(`\\s*${e.toLowerCase()}`) : e;
11688
+ return function(r) {
11689
+ if (o.test(r))
11690
+ return {
11691
+ category: t,
11692
+ message: `Configuring ${n} is not permitted without enabling ${t}`
11693
+ };
11694
+ };
11695
+ }
11696
+ function i(e, t) {
11697
+ const n = new RegExp(`\\s*${e.toLowerCase().replace(/\./g, "(..+)?.")}`);
11698
+ return c(n, t, e);
11699
+ }
11700
+ const q = [
11701
+ c("alias", "allowUnsafeAlias"),
11702
+ c("core.askPass", "allowUnsafeAskPass"),
11703
+ c("core.editor", "allowUnsafeEditor"),
11704
+ c("core.fsmonitor", "allowUnsafeFsMonitor"),
11705
+ c("core.gitProxy", "allowUnsafeGitProxy"),
11706
+ c("core.hooksPath", "allowUnsafeHooksPath"),
11707
+ c("core.pager", "allowUnsafePager"),
11708
+ c("core.sshCommand", "allowUnsafeSshCommand"),
11709
+ i("credential.helper", "allowUnsafeCredentialHelper"),
11710
+ i("diff.command", "allowUnsafeDiffExternal"),
11711
+ c("diff.external", "allowUnsafeDiffExternal"),
11712
+ i("diff.textconv", "allowUnsafeDiffTextConv"),
11713
+ i("filter.clean", "allowUnsafeFilter"),
11714
+ i("filter.smudge", "allowUnsafeFilter"),
11715
+ i("gpg.program", "allowUnsafeGpgProgram"),
11716
+ c("init.templateDir", "allowUnsafeTemplateDir"),
11717
+ i("merge.driver", "allowUnsafeMergeDriver"),
11718
+ i("mergetool.path", "allowUnsafeMergeDriver"),
11719
+ i("mergetool.cmd", "allowUnsafeMergeDriver"),
11720
+ i("protocol.allow", "allowUnsafeProtocolOverride"),
11721
+ i("remote.receivepack", "allowUnsafePack"),
11722
+ i("remote.uploadpack", "allowUnsafePack"),
11723
+ c("sequence.editor", "allowUnsafeEditor")
11724
+ ];
11725
+ function* K(e, t) {
11726
+ for (const n of t)
11727
+ for (const o of H) {
11728
+ const s = o(e, n.name);
11729
+ s && (yield s);
11730
+ }
11731
+ }
11732
+ function h(e, t, n, o = String(t)) {
11733
+ const s = typeof t == "string" ? new RegExp(`\\s*${t.toLowerCase()}`) : t, r = `Use of ${e ? `${e} with option ` : ""}${o} is not permitted without enabling ${n}`;
11734
+ return function(a, f) {
11735
+ if ((!e || a === e) && s.test(f))
11736
+ return {
11737
+ category: n,
11738
+ message: r
11739
+ };
11740
+ };
11741
+ }
11742
+ const H = [
11743
+ h(
11744
+ null,
11745
+ /--(upload|receive)-pack/,
11746
+ "allowUnsafePack",
11747
+ "--upload-pack or --receive-pack"
11748
+ ),
11749
+ h("clone", /^-\w*u/, "allowUnsafePack"),
11750
+ h("clone", "--u", "allowUnsafePack"),
11751
+ h("push", "--exec", "allowUnsafePack"),
11752
+ h(null, "--template", "allowUnsafeTemplateDir")
11753
+ ];
11754
+ function C(e, t, n) {
11755
+ return [...K(e, t), ...V(n)];
11756
+ }
11757
+ function Y(...e) {
11758
+ const { flags: t, taskIndex: n } = j(e), o = n < e.length ? String(e[n]).toLowerCase() : null, s = o !== null ? e.slice(n + 1) : [], { positionals: r, pathspecs: l } = B(s, o, t), a = L(o, t, r);
11759
+ return {
11760
+ task: o,
11761
+ flags: t.map(J),
11762
+ paths: l,
11763
+ config: a,
11764
+ vulnerabilities: z(C(o, t, a))
11765
+ };
11766
+ }
11767
+ function z(e) {
11768
+ return Object.defineProperty(e, "vulnerabilities", {
11769
+ value: e
11770
+ });
11771
+ }
11772
+ function J({ value: e, name: t }) {
11773
+ return e !== void 0 ? { name: t, value: e } : { name: t };
11774
+ }
11775
+ const y = {
11776
+ editor: "allowUnsafeEditor",
11777
+ git_askpass: "allowUnsafeAskPass",
11778
+ git_config_global: "allowUnsafeConfigPaths",
11779
+ git_config_system: "allowUnsafeConfigPaths",
11780
+ git_config_count: "allowUnsafeConfigEnvCount",
11781
+ git_config: "allowUnsafeConfigPaths",
11782
+ git_editor: "allowUnsafeEditor",
11783
+ git_exec_path: "allowUnsafeConfigPaths",
11784
+ git_external_diff: "allowUnsafeDiffExternal",
11785
+ git_pager: "allowUnsafePager",
11786
+ git_proxy_command: "allowUnsafeGitProxy",
11787
+ git_template_dir: "allowUnsafeTemplateDir",
11788
+ git_sequence_editor: "allowUnsafeEditor",
11789
+ git_ssh: "allowUnsafeSshCommand",
11790
+ git_ssh_command: "allowUnsafeSshCommand",
11791
+ pager: "allowUnsafePager",
11792
+ prefix: "allowUnsafeConfigPaths",
11793
+ ssh_askpass: "allowUnsafeAskPass"
11794
+ };
11795
+ function* Q(e) {
11796
+ const t = parseInt(e.git_config_count ?? "0", 10);
11797
+ for (let n = 0; n < t; n++) {
11798
+ const o = e[`git_config_key_${n}`], s = e[`git_config_value_${n}`];
11799
+ o !== void 0 && (yield { key: o.toLowerCase().trim(), value: s, scope: "env" });
11800
+ }
11801
+ }
11802
+ function* X(e) {
11803
+ for (const t of Object.keys(e))
11804
+ if (_(t)) {
11805
+ const n = y[t];
11806
+ yield {
11807
+ category: n,
11808
+ message: `Use of "${t.toUpperCase()}" is not permitted without enabling ${n}`
11809
+ };
11810
+ }
11811
+ }
11812
+ function _(e) {
11813
+ return Object.hasOwn(y, e);
11814
+ }
11815
+ function Z(e) {
11816
+ const t = {};
11817
+ for (const [n, o] of Object.entries(e)) {
11818
+ const s = n.toLowerCase().trim();
11819
+ (_(s) || s.startsWith("git")) && (t[s] = String(o));
11820
+ }
11821
+ return t;
11822
+ }
11823
+ function ee(e) {
11824
+ const t = Z(e), n = {
11825
+ read: [],
11826
+ write: [...Q(t)]
11827
+ }, o = [
11828
+ ...X(t),
11829
+ ...C(null, [], n)
11830
+ ];
11831
+ return {
11832
+ config: n,
11833
+ vulnerabilities: o
11834
+ };
11835
+ }
11836
+ function ne(e, t) {
11837
+ return [...Y(...e).vulnerabilities, ...ee(t).vulnerabilities];
11838
+ }
11839
+
11348
11840
  var __defProp = Object.defineProperty;
11349
- var __defProps = Object.defineProperties;
11350
11841
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
11351
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
11352
11842
  var __getOwnPropNames = Object.getOwnPropertyNames;
11353
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
11354
11843
  var __hasOwnProp = Object.prototype.hasOwnProperty;
11355
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
11356
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
11357
- var __spreadValues = (a, b) => {
11358
- for (var prop in b || (b = {}))
11359
- if (__hasOwnProp.call(b, prop))
11360
- __defNormalProp(a, prop, b[prop]);
11361
- if (__getOwnPropSymbols)
11362
- for (var prop of __getOwnPropSymbols(b)) {
11363
- if (__propIsEnum.call(b, prop))
11364
- __defNormalProp(a, prop, b[prop]);
11365
- }
11366
- return a;
11367
- };
11368
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
11369
- var __markAsModule = (target) => __defProp(target, "__esModule", { value: true });
11370
11844
  var __esm = (fn, res) => function __init() {
11371
11845
  return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
11372
11846
  };
@@ -11377,58 +11851,15 @@ var __export = (target, all) => {
11377
11851
  for (var name in all)
11378
11852
  __defProp(target, name, { get: all[name], enumerable: true });
11379
11853
  };
11380
- var __reExport = (target, module, copyDefault, desc) => {
11381
- if (module && typeof module === "object" || typeof module === "function") {
11382
- for (let key of __getOwnPropNames(module))
11383
- if (!__hasOwnProp.call(target, key) && (copyDefault))
11384
- __defProp(target, key, { get: () => module[key], enumerable: !(desc = __getOwnPropDesc(module, key)) || desc.enumerable });
11854
+ var __copyProps = (to, from, except, desc) => {
11855
+ if (from && typeof from === "object" || typeof from === "function") {
11856
+ for (let key of __getOwnPropNames(from))
11857
+ if (!__hasOwnProp.call(to, key) && key !== except)
11858
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
11385
11859
  }
11386
- return target;
11860
+ return to;
11387
11861
  };
11388
- var __toCommonJS = /* @__PURE__ */ ((cache2) => {
11389
- return (module, temp) => {
11390
- return cache2 && cache2.get(module) || (temp = __reExport(__markAsModule({}), module, 1), cache2 && cache2.set(module, temp), temp);
11391
- };
11392
- })(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0);
11393
- var __async = (__this, __arguments, generator) => {
11394
- return new Promise((resolve, reject) => {
11395
- var fulfilled = (value) => {
11396
- try {
11397
- step(generator.next(value));
11398
- } catch (e) {
11399
- reject(e);
11400
- }
11401
- };
11402
- var rejected = (value) => {
11403
- try {
11404
- step(generator.throw(value));
11405
- } catch (e) {
11406
- reject(e);
11407
- }
11408
- };
11409
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
11410
- step((generator = generator.apply(__this, __arguments)).next());
11411
- });
11412
- };
11413
-
11414
- // src/lib/args/pathspec.ts
11415
- function pathspec(...paths) {
11416
- const key = new String(paths);
11417
- cache.set(key, paths);
11418
- return key;
11419
- }
11420
- function isPathSpec(path) {
11421
- return path instanceof String && cache.has(path);
11422
- }
11423
- function toPaths(pathSpec) {
11424
- return cache.get(pathSpec) || [];
11425
- }
11426
- var cache;
11427
- var init_pathspec = __esm({
11428
- "src/lib/args/pathspec.ts"() {
11429
- cache = /* @__PURE__ */ new WeakMap();
11430
- }
11431
- });
11862
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
11432
11863
 
11433
11864
  // src/lib/errors/git-error.ts
11434
11865
  var GitError;
@@ -11471,7 +11902,10 @@ var init_task_configuration_error = __esm({
11471
11902
  }
11472
11903
  });
11473
11904
  function asFunction(source) {
11474
- return typeof source === "function" ? source : NOOP;
11905
+ if (typeof source !== "function") {
11906
+ return NOOP;
11907
+ }
11908
+ return source;
11475
11909
  }
11476
11910
  function isUserFunction(source) {
11477
11911
  return typeof source === "function" && source !== NOOP;
@@ -11492,7 +11926,7 @@ function last(input, offset = 0) {
11492
11926
  }
11493
11927
  }
11494
11928
  function isArrayLike(input) {
11495
- return !!(input && typeof input.length === "number");
11929
+ return filterHasLength(input);
11496
11930
  }
11497
11931
  function toLinesWithContent(input = "", trimmed2 = true, separator = "\n") {
11498
11932
  return input.split(separator).reduce((output, line) => {
@@ -11539,15 +11973,22 @@ function remove(target, item) {
11539
11973
  function asArray(source) {
11540
11974
  return Array.isArray(source) ? source : [source];
11541
11975
  }
11976
+ function asCamelCase(str) {
11977
+ return str.replace(/[\s-]+(.)/g, (_all, chr) => {
11978
+ return chr.toUpperCase();
11979
+ });
11980
+ }
11542
11981
  function asStringArray(source) {
11543
- return asArray(source).map(String);
11982
+ return asArray(source).map((item) => {
11983
+ return item instanceof String ? item : String(item);
11984
+ });
11544
11985
  }
11545
11986
  function asNumber(source, onNaN = 0) {
11546
11987
  if (source == null) {
11547
11988
  return onNaN;
11548
11989
  }
11549
11990
  const num = parseInt(source, 10);
11550
- return isNaN(num) ? onNaN : num;
11991
+ return Number.isNaN(num) ? onNaN : num;
11551
11992
  }
11552
11993
  function prefixedArray(input, prefix) {
11553
11994
  const output = [];
@@ -11560,7 +12001,13 @@ function bufferToString(input) {
11560
12001
  return (Array.isArray(input) ? Buffer.concat(input) : input).toString("utf-8");
11561
12002
  }
11562
12003
  function pick(source, properties) {
11563
- return Object.assign({}, ...properties.map((property) => property in source ? { [property]: source[property] } : {}));
12004
+ const out = {};
12005
+ properties.forEach((key) => {
12006
+ if (source[key] !== void 0) {
12007
+ out[key] = source[key];
12008
+ }
12009
+ });
12010
+ return out;
11564
12011
  }
11565
12012
  function delay(duration = 0) {
11566
12013
  return new Promise((done) => setTimeout(done, duration));
@@ -11574,14 +12021,13 @@ function orVoid(input) {
11574
12021
  var NULL, NOOP, objectToString;
11575
12022
  var init_util = __esm({
11576
12023
  "src/lib/utils/util.ts"() {
12024
+ init_argument_filters();
11577
12025
  NULL = "\0";
11578
12026
  NOOP = () => {
11579
12027
  };
11580
12028
  objectToString = Object.prototype.toString.call.bind(Object.prototype.toString);
11581
12029
  }
11582
12030
  });
11583
-
11584
- // src/lib/utils/argument-filters.ts
11585
12031
  function filterType(input, filter, def) {
11586
12032
  if (filter(input)) {
11587
12033
  return input;
@@ -11589,7 +12035,7 @@ function filterType(input, filter, def) {
11589
12035
  return arguments.length > 2 ? def : void 0;
11590
12036
  }
11591
12037
  function filterPrimitives(input, omit) {
11592
- const type = isPathSpec(input) ? "string" : typeof input;
12038
+ const type = r(input) ? "string" : typeof input;
11593
12039
  return /number|string|boolean/.test(type) && (!omit || !omit.includes(type));
11594
12040
  }
11595
12041
  function filterPlainObject(input) {
@@ -11598,19 +12044,18 @@ function filterPlainObject(input) {
11598
12044
  function filterFunction(input) {
11599
12045
  return typeof input === "function";
11600
12046
  }
11601
- var filterArray, filterString, filterStringArray, filterStringOrStringArray, filterHasLength;
12047
+ var filterArray, filterNumber, filterString, filterStringOrStringArray, filterHasLength;
11602
12048
  var init_argument_filters = __esm({
11603
12049
  "src/lib/utils/argument-filters.ts"() {
11604
12050
  init_util();
11605
- init_pathspec();
11606
12051
  filterArray = (input) => {
11607
12052
  return Array.isArray(input);
11608
12053
  };
11609
- filterString = (input) => {
11610
- return typeof input === "string";
12054
+ filterNumber = (input) => {
12055
+ return typeof input === "number";
11611
12056
  };
11612
- filterStringArray = (input) => {
11613
- return Array.isArray(input) && input.every(filterString);
12057
+ filterString = (input) => {
12058
+ return typeof input === "string" || r(input);
11614
12059
  };
11615
12060
  filterStringOrStringArray = (input) => {
11616
12061
  return filterString(input) || Array.isArray(input) && input.every(filterString);
@@ -11619,7 +12064,7 @@ var init_argument_filters = __esm({
11619
12064
  if (input == null || "number|boolean|function".includes(typeof input)) {
11620
12065
  return false;
11621
12066
  }
11622
- return Array.isArray(input) || typeof input === "string" || typeof input.length === "number";
12067
+ return typeof input.length === "number";
11623
12068
  };
11624
12069
  }
11625
12070
  });
@@ -11642,25 +12087,29 @@ var init_exit_codes = __esm({
11642
12087
  var GitOutputStreams;
11643
12088
  var init_git_output_streams = __esm({
11644
12089
  "src/lib/utils/git-output-streams.ts"() {
11645
- GitOutputStreams = class {
12090
+ GitOutputStreams = class _GitOutputStreams {
11646
12091
  constructor(stdOut, stdErr) {
11647
12092
  this.stdOut = stdOut;
11648
12093
  this.stdErr = stdErr;
11649
12094
  }
11650
12095
  asStrings() {
11651
- return new GitOutputStreams(this.stdOut.toString("utf8"), this.stdErr.toString("utf8"));
12096
+ return new _GitOutputStreams(this.stdOut.toString("utf8"), this.stdErr.toString("utf8"));
11652
12097
  }
11653
12098
  };
11654
12099
  }
11655
12100
  });
11656
12101
 
11657
12102
  // src/lib/utils/line-parser.ts
12103
+ function useMatchesDefault() {
12104
+ throw new Error(`LineParser:useMatches not implemented`);
12105
+ }
11658
12106
  var LineParser, RemoteLineParser;
11659
12107
  var init_line_parser = __esm({
11660
12108
  "src/lib/utils/line-parser.ts"() {
11661
12109
  LineParser = class {
11662
12110
  constructor(regExp, useMatches) {
11663
12111
  this.matches = [];
12112
+ this.useMatches = useMatchesDefault;
11664
12113
  this.parse = (line, target) => {
11665
12114
  this.resetMatches();
11666
12115
  if (!this._regExp.every((reg, index) => this.addMatch(reg, index, line(index)))) {
@@ -11673,9 +12122,6 @@ var init_line_parser = __esm({
11673
12122
  this.useMatches = useMatches;
11674
12123
  }
11675
12124
  }
11676
- useMatches(target, match) {
11677
- throw new Error(`LineParser:useMatches not implemented`);
11678
- }
11679
12125
  resetMatches() {
11680
12126
  this.matches.length = 0;
11681
12127
  }
@@ -11709,7 +12155,10 @@ var init_line_parser = __esm({
11709
12155
  // src/lib/utils/simple-git-options.ts
11710
12156
  function createInstanceConfig(...options) {
11711
12157
  const baseDir = process.cwd();
11712
- const config = Object.assign(__spreadValues({ baseDir }, defaultOptions), ...options.filter((o) => typeof o === "object" && o));
12158
+ const config = Object.assign(
12159
+ { baseDir, ...defaultOptions },
12160
+ ...options.filter((o) => typeof o === "object" && o)
12161
+ );
11713
12162
  config.baseDir = config.baseDir || baseDir;
11714
12163
  config.trimmed = config.trimmed === true;
11715
12164
  return config;
@@ -11725,18 +12174,22 @@ var init_simple_git_options = __esm({
11725
12174
  };
11726
12175
  }
11727
12176
  });
11728
-
11729
- // src/lib/utils/task-options.ts
11730
12177
  function appendTaskOptions(options, commands = []) {
11731
12178
  if (!filterPlainObject(options)) {
11732
12179
  return commands;
11733
12180
  }
11734
12181
  return Object.keys(options).reduce((commands2, key) => {
11735
12182
  const value = options[key];
11736
- if (isPathSpec(value)) {
12183
+ if (r(value)) {
11737
12184
  commands2.push(value);
11738
12185
  } else if (filterPrimitives(value, ["boolean"])) {
11739
12186
  commands2.push(key + "=" + value);
12187
+ } else if (Array.isArray(value)) {
12188
+ for (const v of value) {
12189
+ if (!filterPrimitives(v, ["string", "number"])) {
12190
+ commands2.push(key + "=" + v);
12191
+ }
12192
+ }
11740
12193
  } else {
11741
12194
  commands2.push(key);
11742
12195
  }
@@ -11758,7 +12211,7 @@ function getTrailingOptions(args, initialPrimitive = 0, objectOnly = false) {
11758
12211
  }
11759
12212
  function trailingArrayArgument(args) {
11760
12213
  const hasTrailingCallback = typeof last(args) === "function";
11761
- return filterType(last(args, hasTrailingCallback ? 1 : 0), filterArray, []);
12214
+ return asStringArray(filterType(last(args, hasTrailingCallback ? 1 : 0), filterArray, []));
11762
12215
  }
11763
12216
  function trailingOptionsArgument(args) {
11764
12217
  const hasTrailingCallback = filterFunction(last(args));
@@ -11772,13 +12225,12 @@ var init_task_options = __esm({
11772
12225
  "src/lib/utils/task-options.ts"() {
11773
12226
  init_argument_filters();
11774
12227
  init_util();
11775
- init_pathspec();
11776
12228
  }
11777
12229
  });
11778
12230
 
11779
12231
  // src/lib/utils/task-parser.ts
11780
- function callTaskParser(parser3, streams) {
11781
- return parser3(streams.stdOut, streams.stdErr);
12232
+ function callTaskParser(parser4, streams) {
12233
+ return parser4(streams.stdOut, streams.stdErr);
11782
12234
  }
11783
12235
  function parseStringResponse(result, parsers12, texts, trim = true) {
11784
12236
  asArray(texts).forEach((text) => {
@@ -11812,6 +12264,7 @@ __export(utils_exports, {
11812
12264
  append: () => append,
11813
12265
  appendTaskOptions: () => appendTaskOptions,
11814
12266
  asArray: () => asArray,
12267
+ asCamelCase: () => asCamelCase,
11815
12268
  asFunction: () => asFunction,
11816
12269
  asNumber: () => asNumber,
11817
12270
  asStringArray: () => asStringArray,
@@ -11822,10 +12275,10 @@ __export(utils_exports, {
11822
12275
  filterArray: () => filterArray,
11823
12276
  filterFunction: () => filterFunction,
11824
12277
  filterHasLength: () => filterHasLength,
12278
+ filterNumber: () => filterNumber,
11825
12279
  filterPlainObject: () => filterPlainObject,
11826
12280
  filterPrimitives: () => filterPrimitives,
11827
12281
  filterString: () => filterString,
11828
- filterStringArray: () => filterStringArray,
11829
12282
  filterStringOrStringArray: () => filterStringOrStringArray,
11830
12283
  filterType: () => filterType,
11831
12284
  first: () => first,
@@ -11967,11 +12420,11 @@ __export(task_exports, {
11967
12420
  straightThroughBufferTask: () => straightThroughBufferTask,
11968
12421
  straightThroughStringTask: () => straightThroughStringTask
11969
12422
  });
11970
- function adhocExecTask(parser3) {
12423
+ function adhocExecTask(parser4) {
11971
12424
  return {
11972
12425
  commands: EMPTY_COMMANDS,
11973
12426
  format: "empty",
11974
- parser: parser3
12427
+ parser: parser4
11975
12428
  };
11976
12429
  }
11977
12430
  function configurationErrorTask(error) {
@@ -12183,7 +12636,7 @@ var init_ConfigList = __esm({
12183
12636
  }
12184
12637
  addValue(file, key, value) {
12185
12638
  const values = this.addFile(file);
12186
- if (!values.hasOwnProperty(key)) {
12639
+ if (!Object.hasOwn(values, key)) {
12187
12640
  values[key] = value;
12188
12641
  } else if (Array.isArray(values[key])) {
12189
12642
  values[key].push(value);
@@ -12198,7 +12651,7 @@ var init_ConfigList = __esm({
12198
12651
 
12199
12652
  // src/lib/tasks/config.ts
12200
12653
  function asConfigScope(scope, fallback) {
12201
- if (typeof scope === "string" && GitConfigScope.hasOwnProperty(scope)) {
12654
+ if (typeof scope === "string" && Object.hasOwn(GitConfigScope, scope)) {
12202
12655
  return scope;
12203
12656
  }
12204
12657
  return fallback;
@@ -12246,13 +12699,27 @@ function listConfigTask(scope) {
12246
12699
  function config_default() {
12247
12700
  return {
12248
12701
  addConfig(key, value, ...rest) {
12249
- return this._runTask(addConfigTask(key, value, rest[0] === true, asConfigScope(rest[1], "local" /* local */)), trailingFunctionArgument(arguments));
12702
+ return this._runTask(
12703
+ addConfigTask(
12704
+ key,
12705
+ value,
12706
+ rest[0] === true,
12707
+ asConfigScope(rest[1], "local" /* local */)
12708
+ ),
12709
+ trailingFunctionArgument(arguments)
12710
+ );
12250
12711
  },
12251
12712
  getConfig(key, scope) {
12252
- return this._runTask(getConfigTask(key, asConfigScope(scope, void 0)), trailingFunctionArgument(arguments));
12713
+ return this._runTask(
12714
+ getConfigTask(key, asConfigScope(scope, void 0)),
12715
+ trailingFunctionArgument(arguments)
12716
+ );
12253
12717
  },
12254
12718
  listConfig(...rest) {
12255
- return this._runTask(listConfigTask(asConfigScope(rest[0], void 0)), trailingFunctionArgument(arguments));
12719
+ return this._runTask(
12720
+ listConfigTask(asConfigScope(rest[0], void 0)),
12721
+ trailingFunctionArgument(arguments)
12722
+ );
12256
12723
  }
12257
12724
  };
12258
12725
  }
@@ -12322,20 +12789,26 @@ function grep_default() {
12322
12789
  const options = getTrailingOptions(arguments);
12323
12790
  for (const option of disallowedOptions) {
12324
12791
  if (options.includes(option)) {
12325
- return this._runTask(configurationErrorTask(`git.grep: use of "${option}" is not supported.`), then);
12792
+ return this._runTask(
12793
+ configurationErrorTask(`git.grep: use of "${option}" is not supported.`),
12794
+ then
12795
+ );
12326
12796
  }
12327
12797
  }
12328
12798
  if (typeof searchTerm === "string") {
12329
12799
  searchTerm = grepQueryBuilder().param(searchTerm);
12330
12800
  }
12331
12801
  const commands = ["grep", "--null", "-n", "--full-name", ...options, ...searchTerm];
12332
- return this._runTask({
12333
- commands,
12334
- format: "utf-8",
12335
- parser(stdOut) {
12336
- return parseGrep(stdOut);
12337
- }
12338
- }, then);
12802
+ return this._runTask(
12803
+ {
12804
+ commands,
12805
+ format: "utf-8",
12806
+ parser(stdOut) {
12807
+ return parseGrep(stdOut);
12808
+ }
12809
+ },
12810
+ then
12811
+ );
12339
12812
  }
12340
12813
  };
12341
12814
  }
@@ -12394,11 +12867,12 @@ function getResetMode(mode) {
12394
12867
  return;
12395
12868
  }
12396
12869
  function isValidResetMode(mode) {
12397
- return ResetModes.includes(mode);
12870
+ return typeof mode === "string" && validResetModes.includes(mode);
12398
12871
  }
12399
- var ResetMode, ResetModes;
12872
+ var ResetMode, validResetModes;
12400
12873
  var init_reset = __esm({
12401
12874
  "src/lib/tasks/reset.ts"() {
12875
+ init_utils();
12402
12876
  init_task();
12403
12877
  ResetMode = /* @__PURE__ */ ((ResetMode2) => {
12404
12878
  ResetMode2["MIXED"] = "mixed";
@@ -12408,7 +12882,7 @@ var init_reset = __esm({
12408
12882
  ResetMode2["KEEP"] = "keep";
12409
12883
  return ResetMode2;
12410
12884
  })(ResetMode || {});
12411
- ResetModes = Array.from(Object.values(ResetMode));
12885
+ validResetModes = asStringArray(Object.values(ResetMode));
12412
12886
  }
12413
12887
  });
12414
12888
  function createLog() {
@@ -12445,7 +12919,10 @@ function createLogger(label, verbose, initialStep, infoDebugger = createLog()) {
12445
12919
  const key = childLoggerName(filterType(verbose, filterString), debugDebugger, infoDebugger);
12446
12920
  return step(initialStep);
12447
12921
  function sibling(name, initial) {
12448
- return append(spawned, createLogger(label, key.replace(/^[^:]+/, name), initial, infoDebugger));
12922
+ return append(
12923
+ spawned,
12924
+ createLogger(label, key.replace(/^[^:]+/, name), initial, infoDebugger)
12925
+ );
12449
12926
  }
12450
12927
  function step(phase) {
12451
12928
  const stepPrefix = phase && `[${phase}]` || "";
@@ -12473,12 +12950,12 @@ var init_git_logger = __esm({
12473
12950
  });
12474
12951
 
12475
12952
  // src/lib/runners/tasks-pending-queue.ts
12476
- var _TasksPendingQueue, TasksPendingQueue;
12953
+ var TasksPendingQueue;
12477
12954
  var init_tasks_pending_queue = __esm({
12478
12955
  "src/lib/runners/tasks-pending-queue.ts"() {
12479
12956
  init_git_error();
12480
12957
  init_git_logger();
12481
- _TasksPendingQueue = class {
12958
+ TasksPendingQueue = class _TasksPendingQueue {
12482
12959
  constructor(logLabel = "GitExecutor") {
12483
12960
  this.logLabel = logLabel;
12484
12961
  this._queue = /* @__PURE__ */ new Map();
@@ -12505,9 +12982,14 @@ var init_tasks_pending_queue = __esm({
12505
12982
  for (const [task, { logger }] of Array.from(this._queue.entries())) {
12506
12983
  if (task === err.task) {
12507
12984
  logger.info(`Failed %o`, err);
12508
- logger(`Fatal exception, any as-yet un-started tasks run through this executor will not be attempted`);
12985
+ logger(
12986
+ `Fatal exception, any as-yet un-started tasks run through this executor will not be attempted`
12987
+ );
12509
12988
  } else {
12510
- logger.info(`A fatal exception occurred in a previous task, the queue has been purged: %o`, err.message);
12989
+ logger.info(
12990
+ `A fatal exception occurred in a previous task, the queue has been purged: %o`,
12991
+ err.message
12992
+ );
12511
12993
  }
12512
12994
  this.complete(task);
12513
12995
  }
@@ -12532,9 +13014,10 @@ var init_tasks_pending_queue = __esm({
12532
13014
  static getName(name = "empty") {
12533
13015
  return `task:${name}:${++_TasksPendingQueue.counter}`;
12534
13016
  }
13017
+ static {
13018
+ this.counter = 0;
13019
+ }
12535
13020
  };
12536
- TasksPendingQueue = _TasksPendingQueue;
12537
- TasksPendingQueue.counter = 0;
12538
13021
  }
12539
13022
  });
12540
13023
  function pluginContext(task, commands) {
@@ -12571,9 +13054,6 @@ var init_git_executor_chain = __esm({
12571
13054
  this._chain = Promise.resolve();
12572
13055
  this._queue = new TasksPendingQueue();
12573
13056
  }
12574
- get binary() {
12575
- return this._executor.binary;
12576
- }
12577
13057
  get cwd() {
12578
13058
  return this._cwd || this._executor.cwd;
12579
13059
  }
@@ -12593,20 +13073,18 @@ var init_git_executor_chain = __esm({
12593
13073
  this._queue.push(task);
12594
13074
  return this._chain = this._chain.then(() => this.attemptTask(task));
12595
13075
  }
12596
- attemptTask(task) {
12597
- return __async(this, null, function* () {
12598
- const onScheduleComplete = yield this._scheduler.next();
12599
- const onQueueComplete = () => this._queue.complete(task);
12600
- try {
12601
- const { logger } = this._queue.attempt(task);
12602
- return yield isEmptyTask(task) ? this.attemptEmptyTask(task, logger) : this.attemptRemoteTask(task, logger);
12603
- } catch (e) {
12604
- throw this.onFatalException(task, e);
12605
- } finally {
12606
- onQueueComplete();
12607
- onScheduleComplete();
12608
- }
12609
- });
13076
+ async attemptTask(task) {
13077
+ const onScheduleComplete = await this._scheduler.next();
13078
+ const onQueueComplete = () => this._queue.complete(task);
13079
+ try {
13080
+ const { logger } = this._queue.attempt(task);
13081
+ return await (isEmptyTask(task) ? this.attemptEmptyTask(task, logger) : this.attemptRemoteTask(task, logger));
13082
+ } catch (e) {
13083
+ throw this.onFatalException(task, e);
13084
+ } finally {
13085
+ onQueueComplete();
13086
+ onScheduleComplete();
13087
+ }
12610
13088
  }
12611
13089
  onFatalException(task, e) {
12612
13090
  const gitError = e instanceof GitError ? Object.assign(e, { task }) : new GitError(task, e && String(e));
@@ -12614,108 +13092,147 @@ var init_git_executor_chain = __esm({
12614
13092
  this._queue.fatal(gitError);
12615
13093
  return gitError;
12616
13094
  }
12617
- attemptRemoteTask(task, logger) {
12618
- return __async(this, null, function* () {
12619
- const args = this._plugins.exec("spawn.args", [...task.commands], pluginContext(task, task.commands));
12620
- const raw = yield this.gitResponse(task, this.binary, args, this.outputHandler, logger.step("SPAWN"));
12621
- const outputStreams = yield this.handleTaskData(task, args, raw, logger.step("HANDLE"));
12622
- logger(`passing response to task's parser as a %s`, task.format);
12623
- if (isBufferTask(task)) {
12624
- return callTaskParser(task.parser, outputStreams);
12625
- }
12626
- return callTaskParser(task.parser, outputStreams.asStrings());
13095
+ async attemptRemoteTask(task, logger) {
13096
+ const binary = this._plugins.exec("spawn.binary", "", pluginContext(task, task.commands));
13097
+ const args = this._plugins.exec("spawn.args", [...task.commands], {
13098
+ ...pluginContext(task, task.commands),
13099
+ env: { ...this.env }
12627
13100
  });
13101
+ const raw = await this.gitResponse(
13102
+ task,
13103
+ binary,
13104
+ args,
13105
+ this.outputHandler,
13106
+ logger.step("SPAWN")
13107
+ );
13108
+ const outputStreams = await this.handleTaskData(task, args, raw, logger.step("HANDLE"));
13109
+ logger(`passing response to task's parser as a %s`, task.format);
13110
+ if (isBufferTask(task)) {
13111
+ return callTaskParser(task.parser, outputStreams);
13112
+ }
13113
+ return callTaskParser(task.parser, outputStreams.asStrings());
12628
13114
  }
12629
- attemptEmptyTask(task, logger) {
12630
- return __async(this, null, function* () {
12631
- logger(`empty task bypassing child process to call to task's parser`);
12632
- return task.parser(this);
12633
- });
13115
+ async attemptEmptyTask(task, logger) {
13116
+ logger(`empty task bypassing child process to call to task's parser`);
13117
+ return task.parser(this);
12634
13118
  }
12635
13119
  handleTaskData(task, args, result, logger) {
12636
13120
  const { exitCode, rejection, stdOut, stdErr } = result;
12637
13121
  return new Promise((done, fail) => {
12638
13122
  logger(`Preparing to handle process response exitCode=%d stdOut=`, exitCode);
12639
- const { error } = this._plugins.exec("task.error", { error: rejection }, __spreadValues(__spreadValues({}, pluginContext(task, args)), result));
13123
+ const { error } = this._plugins.exec(
13124
+ "task.error",
13125
+ { error: rejection },
13126
+ {
13127
+ ...pluginContext(task, args),
13128
+ ...result
13129
+ }
13130
+ );
12640
13131
  if (error && task.onError) {
12641
13132
  logger.info(`exitCode=%s handling with custom error handler`);
12642
- return task.onError(result, error, (newStdOut) => {
12643
- logger.info(`custom error handler treated as success`);
12644
- logger(`custom error returned a %s`, objectToString(newStdOut));
12645
- done(new GitOutputStreams(Array.isArray(newStdOut) ? Buffer.concat(newStdOut) : newStdOut, Buffer.concat(stdErr)));
12646
- }, fail);
13133
+ return task.onError(
13134
+ result,
13135
+ error,
13136
+ (newStdOut) => {
13137
+ logger.info(`custom error handler treated as success`);
13138
+ logger(`custom error returned a %s`, objectToString(newStdOut));
13139
+ done(
13140
+ new GitOutputStreams(
13141
+ Array.isArray(newStdOut) ? Buffer.concat(newStdOut) : newStdOut,
13142
+ Buffer.concat(stdErr)
13143
+ )
13144
+ );
13145
+ },
13146
+ fail
13147
+ );
12647
13148
  }
12648
13149
  if (error) {
12649
- logger.info(`handling as error: exitCode=%s stdErr=%s rejection=%o`, exitCode, stdErr.length, rejection);
13150
+ logger.info(
13151
+ `handling as error: exitCode=%s stdErr=%s rejection=%o`,
13152
+ exitCode,
13153
+ stdErr.length,
13154
+ rejection
13155
+ );
12650
13156
  return fail(error);
12651
13157
  }
12652
13158
  logger.info(`retrieving task output complete`);
12653
13159
  done(new GitOutputStreams(Buffer.concat(stdOut), Buffer.concat(stdErr)));
12654
13160
  });
12655
13161
  }
12656
- gitResponse(task, command, args, outputHandler, logger) {
12657
- return __async(this, null, function* () {
12658
- const outputLogger = logger.sibling("output");
12659
- const spawnOptions = this._plugins.exec("spawn.options", {
13162
+ async gitResponse(task, command, args, outputHandler, logger) {
13163
+ const outputLogger = logger.sibling("output");
13164
+ const spawnOptions = this._plugins.exec(
13165
+ "spawn.options",
13166
+ {
12660
13167
  cwd: this.cwd,
12661
13168
  env: this.env,
12662
13169
  windowsHide: true
12663
- }, pluginContext(task, task.commands));
12664
- return new Promise((done) => {
12665
- const stdOut = [];
12666
- const stdErr = [];
12667
- logger.info(`%s %o`, command, args);
12668
- logger("%O", spawnOptions);
12669
- let rejection = this._beforeSpawn(task, args);
12670
- if (rejection) {
12671
- return done({
13170
+ },
13171
+ pluginContext(task, task.commands)
13172
+ );
13173
+ return new Promise((done) => {
13174
+ const stdOut = [];
13175
+ const stdErr = [];
13176
+ logger.info(`%s %o`, command, args);
13177
+ logger("%O", spawnOptions);
13178
+ let rejection = this._beforeSpawn(task, args);
13179
+ if (rejection) {
13180
+ return done({
13181
+ stdOut,
13182
+ stdErr,
13183
+ exitCode: 9901,
13184
+ rejection
13185
+ });
13186
+ }
13187
+ this._plugins.exec("spawn.before", void 0, {
13188
+ ...pluginContext(task, args),
13189
+ kill(reason) {
13190
+ rejection = reason || rejection;
13191
+ }
13192
+ });
13193
+ const spawned = spawn(command, args, spawnOptions);
13194
+ spawned.stdout.on(
13195
+ "data",
13196
+ onDataReceived(stdOut, "stdOut", logger, outputLogger.step("stdOut"))
13197
+ );
13198
+ spawned.stderr.on(
13199
+ "data",
13200
+ onDataReceived(stdErr, "stdErr", logger, outputLogger.step("stdErr"))
13201
+ );
13202
+ spawned.on("error", onErrorReceived(stdErr, logger));
13203
+ if (outputHandler) {
13204
+ logger(`Passing child process stdOut/stdErr to custom outputHandler`);
13205
+ outputHandler(command, spawned.stdout, spawned.stderr, [...args]);
13206
+ }
13207
+ this._plugins.exec("spawn.after", void 0, {
13208
+ ...pluginContext(task, args),
13209
+ spawned,
13210
+ close(exitCode, reason) {
13211
+ done({
12672
13212
  stdOut,
12673
13213
  stdErr,
12674
- exitCode: 9901,
12675
- rejection
13214
+ exitCode,
13215
+ rejection: rejection || reason
12676
13216
  });
12677
- }
12678
- this._plugins.exec("spawn.before", void 0, __spreadProps(__spreadValues({}, pluginContext(task, args)), {
12679
- kill(reason) {
12680
- rejection = reason || rejection;
13217
+ },
13218
+ kill(reason) {
13219
+ if (spawned.killed) {
13220
+ return;
12681
13221
  }
12682
- }));
12683
- const spawned = spawn(command, args, spawnOptions);
12684
- spawned.stdout.on("data", onDataReceived(stdOut, "stdOut", logger, outputLogger.step("stdOut")));
12685
- spawned.stderr.on("data", onDataReceived(stdErr, "stdErr", logger, outputLogger.step("stdErr")));
12686
- spawned.on("error", onErrorReceived(stdErr, logger));
12687
- if (outputHandler) {
12688
- logger(`Passing child process stdOut/stdErr to custom outputHandler`);
12689
- outputHandler(command, spawned.stdout, spawned.stderr, [...args]);
13222
+ rejection = reason;
13223
+ spawned.kill("SIGINT");
12690
13224
  }
12691
- this._plugins.exec("spawn.after", void 0, __spreadProps(__spreadValues({}, pluginContext(task, args)), {
12692
- spawned,
12693
- close(exitCode, reason) {
12694
- done({
12695
- stdOut,
12696
- stdErr,
12697
- exitCode,
12698
- rejection: rejection || reason
12699
- });
12700
- },
12701
- kill(reason) {
12702
- if (spawned.killed) {
12703
- return;
12704
- }
12705
- rejection = reason;
12706
- spawned.kill("SIGINT");
12707
- }
12708
- }));
12709
13225
  });
12710
13226
  });
12711
13227
  }
12712
13228
  _beforeSpawn(task, args) {
12713
13229
  let rejection;
12714
- this._plugins.exec("spawn.before", void 0, __spreadProps(__spreadValues({}, pluginContext(task, args)), {
13230
+ this._plugins.exec("spawn.before", void 0, {
13231
+ ...pluginContext(task, args),
12715
13232
  kill(reason) {
12716
13233
  rejection = reason || rejection;
12717
13234
  }
12718
- }));
13235
+ });
12719
13236
  return rejection;
12720
13237
  }
12721
13238
  };
@@ -12732,8 +13249,7 @@ var init_git_executor = __esm({
12732
13249
  "src/lib/runners/git-executor.ts"() {
12733
13250
  init_git_executor_chain();
12734
13251
  GitExecutor = class {
12735
- constructor(binary = "git", cwd, _scheduler, _plugins) {
12736
- this.binary = binary;
13252
+ constructor(cwd, _scheduler, _plugins) {
12737
13253
  this.cwd = cwd;
12738
13254
  this._scheduler = _scheduler;
12739
13255
  this._plugins = _plugins;
@@ -12755,15 +13271,20 @@ function taskCallback(task, response, callback = NOOP) {
12755
13271
  callback(null, data);
12756
13272
  };
12757
13273
  const onError2 = (err) => {
12758
- if ((err == null ? void 0 : err.task) === task) {
12759
- callback(err instanceof GitResponseError ? addDeprecationNoticeToError(err) : err, void 0);
13274
+ if (err?.task === task) {
13275
+ callback(
13276
+ err instanceof GitResponseError ? addDeprecationNoticeToError(err) : err,
13277
+ void 0
13278
+ );
12760
13279
  }
12761
13280
  };
12762
13281
  response.then(onSuccess, onError2);
12763
13282
  }
12764
13283
  function addDeprecationNoticeToError(err) {
12765
13284
  let log = (name) => {
12766
- console.warn(`simple-git deprecation notice: accessing GitResponseError.${name} should be GitResponseError.git.${name}, this will no longer be available in version 3`);
13285
+ console.warn(
13286
+ `simple-git deprecation notice: accessing GitResponseError.${name} should be GitResponseError.git.${name}, this will no longer be available in version 3`
13287
+ );
12767
13288
  log = NOOP;
12768
13289
  };
12769
13290
  return Object.create(err, Object.getOwnPropertyNames(err.git).reduce(descriptorReducer, {}));
@@ -12816,13 +13337,22 @@ function checkoutTask(args) {
12816
13337
  function checkout_default() {
12817
13338
  return {
12818
13339
  checkout() {
12819
- return this._runTask(checkoutTask(getTrailingOptions(arguments, 1)), trailingFunctionArgument(arguments));
13340
+ return this._runTask(
13341
+ checkoutTask(getTrailingOptions(arguments, 1)),
13342
+ trailingFunctionArgument(arguments)
13343
+ );
12820
13344
  },
12821
13345
  checkoutBranch(branchName, startPoint) {
12822
- return this._runTask(checkoutTask(["-b", branchName, startPoint, ...getTrailingOptions(arguments)]), trailingFunctionArgument(arguments));
13346
+ return this._runTask(
13347
+ checkoutTask(["-b", branchName, startPoint, ...getTrailingOptions(arguments)]),
13348
+ trailingFunctionArgument(arguments)
13349
+ );
12823
13350
  },
12824
13351
  checkoutLocalBranch(branchName) {
12825
- return this._runTask(checkoutTask(["-b", branchName, ...getTrailingOptions(arguments)]), trailingFunctionArgument(arguments));
13352
+ return this._runTask(
13353
+ checkoutTask(["-b", branchName, ...getTrailingOptions(arguments)]),
13354
+ trailingFunctionArgument(arguments)
13355
+ );
12826
13356
  }
12827
13357
  };
12828
13358
  }
@@ -12833,6 +13363,48 @@ var init_checkout = __esm({
12833
13363
  }
12834
13364
  });
12835
13365
 
13366
+ // src/lib/tasks/count-objects.ts
13367
+ function countObjectsResponse() {
13368
+ return {
13369
+ count: 0,
13370
+ garbage: 0,
13371
+ inPack: 0,
13372
+ packs: 0,
13373
+ prunePackable: 0,
13374
+ size: 0,
13375
+ sizeGarbage: 0,
13376
+ sizePack: 0
13377
+ };
13378
+ }
13379
+ function count_objects_default() {
13380
+ return {
13381
+ countObjects() {
13382
+ return this._runTask({
13383
+ commands: ["count-objects", "--verbose"],
13384
+ format: "utf-8",
13385
+ parser(stdOut) {
13386
+ return parseStringResponse(countObjectsResponse(), [parser2], stdOut);
13387
+ }
13388
+ });
13389
+ }
13390
+ };
13391
+ }
13392
+ var parser2;
13393
+ var init_count_objects = __esm({
13394
+ "src/lib/tasks/count-objects.ts"() {
13395
+ init_utils();
13396
+ parser2 = new LineParser(
13397
+ /([a-z-]+): (\d+)$/,
13398
+ (result, [key, value]) => {
13399
+ const property = asCamelCase(key);
13400
+ if (Object.hasOwn(result, property)) {
13401
+ result[property] = asNumber(value);
13402
+ }
13403
+ }
13404
+ );
13405
+ }
13406
+ });
13407
+
12836
13408
  // src/lib/parsers/parse-commit.ts
12837
13409
  function parseCommitResult(stdOut) {
12838
13410
  const result = {
@@ -12869,20 +13441,26 @@ var init_parse_commit = __esm({
12869
13441
  name: parts.join("<").trim()
12870
13442
  };
12871
13443
  }),
12872
- new LineParser(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g, (result, [changes, insertions, deletions]) => {
12873
- result.summary.changes = parseInt(changes, 10) || 0;
12874
- result.summary.insertions = parseInt(insertions, 10) || 0;
12875
- result.summary.deletions = parseInt(deletions, 10) || 0;
12876
- }),
12877
- new LineParser(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/, (result, [changes, lines, direction]) => {
12878
- result.summary.changes = parseInt(changes, 10) || 0;
12879
- const count = parseInt(lines, 10) || 0;
12880
- if (direction === "-") {
12881
- result.summary.deletions = count;
12882
- } else if (direction === "+") {
12883
- result.summary.insertions = count;
13444
+ new LineParser(
13445
+ /(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g,
13446
+ (result, [changes, insertions, deletions]) => {
13447
+ result.summary.changes = parseInt(changes, 10) || 0;
13448
+ result.summary.insertions = parseInt(insertions, 10) || 0;
13449
+ result.summary.deletions = parseInt(deletions, 10) || 0;
12884
13450
  }
12885
- })
13451
+ ),
13452
+ new LineParser(
13453
+ /^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/,
13454
+ (result, [changes, lines, direction]) => {
13455
+ result.summary.changes = parseInt(changes, 10) || 0;
13456
+ const count = parseInt(lines, 10) || 0;
13457
+ if (direction === "-") {
13458
+ result.summary.deletions = count;
13459
+ } else if (direction === "+") {
13460
+ result.summary.insertions = count;
13461
+ }
13462
+ }
13463
+ )
12886
13464
  ];
12887
13465
  }
12888
13466
  });
@@ -12907,12 +13485,21 @@ function commit_default() {
12907
13485
  return {
12908
13486
  commit(message, ...rest) {
12909
13487
  const next = trailingFunctionArgument(arguments);
12910
- const task = rejectDeprecatedSignatures(message) || commitTask(asArray(message), asArray(filterType(rest[0], filterStringOrStringArray, [])), [...filterType(rest[1], filterArray, []), ...getTrailingOptions(arguments, 0, true)]);
13488
+ const task = rejectDeprecatedSignatures(message) || commitTask(
13489
+ asArray(message),
13490
+ asArray(filterType(rest[0], filterStringOrStringArray, [])),
13491
+ [
13492
+ ...asStringArray(filterType(rest[1], filterArray, [])),
13493
+ ...getTrailingOptions(arguments, 0, true)
13494
+ ]
13495
+ );
12911
13496
  return this._runTask(task, next);
12912
13497
  }
12913
13498
  };
12914
13499
  function rejectDeprecatedSignatures(message) {
12915
- return !filterStringOrStringArray(message) && configurationErrorTask(`git.commit: requires the commit message to be supplied as a string/string[]`);
13500
+ return !filterStringOrStringArray(message) && configurationErrorTask(
13501
+ `git.commit: requires the commit message to be supplied as a string/string[]`
13502
+ );
12916
13503
  }
12917
13504
  }
12918
13505
  var init_commit = __esm({
@@ -12927,7 +13514,10 @@ var init_commit = __esm({
12927
13514
  function first_commit_default() {
12928
13515
  return {
12929
13516
  firstCommit() {
12930
- return this._runTask(straightThroughStringTask(["rev-list", "--max-parents=0", "HEAD"], true), trailingFunctionArgument(arguments));
13517
+ return this._runTask(
13518
+ straightThroughStringTask(["rev-list", "--max-parents=0", "HEAD"], true),
13519
+ trailingFunctionArgument(arguments)
13520
+ );
12931
13521
  }
12932
13522
  };
12933
13523
  }
@@ -13051,8 +13641,8 @@ var init_DiffSummary = __esm({
13051
13641
 
13052
13642
  // src/lib/parsers/parse-diff-summary.ts
13053
13643
  function getDiffParser(format = "" /* NONE */) {
13054
- const parser3 = diffSummaryParsers[format];
13055
- return (stdOut) => parseStringResponse(new DiffSummary(), parser3, stdOut, false);
13644
+ const parser4 = diffSummaryParsers[format];
13645
+ return (stdOut) => parseStringResponse(new DiffSummary(), parser4, stdOut, false);
13056
13646
  }
13057
13647
  var statParser, numStatParser, nameOnlyParser, nameStatusParser, diffSummaryParsers;
13058
13648
  var init_parse_diff_summary = __esm({
@@ -13062,46 +13652,58 @@ var init_parse_diff_summary = __esm({
13062
13652
  init_diff_name_status();
13063
13653
  init_utils();
13064
13654
  statParser = [
13065
- new LineParser(/(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/, (result, [file, changes, alterations = ""]) => {
13066
- result.files.push({
13067
- file: file.trim(),
13068
- changes: asNumber(changes),
13069
- insertions: alterations.replace(/[^+]/g, "").length,
13070
- deletions: alterations.replace(/[^-]/g, "").length,
13071
- binary: false
13072
- });
13073
- }),
13074
- new LineParser(/(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/, (result, [file, before, after]) => {
13075
- result.files.push({
13076
- file: file.trim(),
13077
- before: asNumber(before),
13078
- after: asNumber(after),
13079
- binary: true
13080
- });
13081
- }),
13082
- new LineParser(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/, (result, [changed, summary]) => {
13083
- const inserted = /(\d+) i/.exec(summary);
13084
- const deleted = /(\d+) d/.exec(summary);
13085
- result.changed = asNumber(changed);
13086
- result.insertions = asNumber(inserted == null ? void 0 : inserted[1]);
13087
- result.deletions = asNumber(deleted == null ? void 0 : deleted[1]);
13088
- })
13655
+ new LineParser(
13656
+ /^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/,
13657
+ (result, [file, changes, alterations = ""]) => {
13658
+ result.files.push({
13659
+ file: file.trim(),
13660
+ changes: asNumber(changes),
13661
+ insertions: alterations.replace(/[^+]/g, "").length,
13662
+ deletions: alterations.replace(/[^-]/g, "").length,
13663
+ binary: false
13664
+ });
13665
+ }
13666
+ ),
13667
+ new LineParser(
13668
+ /^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/,
13669
+ (result, [file, before, after]) => {
13670
+ result.files.push({
13671
+ file: file.trim(),
13672
+ before: asNumber(before),
13673
+ after: asNumber(after),
13674
+ binary: true
13675
+ });
13676
+ }
13677
+ ),
13678
+ new LineParser(
13679
+ /(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/,
13680
+ (result, [changed, summary]) => {
13681
+ const inserted = /(\d+) i/.exec(summary);
13682
+ const deleted = /(\d+) d/.exec(summary);
13683
+ result.changed = asNumber(changed);
13684
+ result.insertions = asNumber(inserted?.[1]);
13685
+ result.deletions = asNumber(deleted?.[1]);
13686
+ }
13687
+ )
13089
13688
  ];
13090
13689
  numStatParser = [
13091
- new LineParser(/(\d+)\t(\d+)\t(.+)$/, (result, [changesInsert, changesDelete, file]) => {
13092
- const insertions = asNumber(changesInsert);
13093
- const deletions = asNumber(changesDelete);
13094
- result.changed++;
13095
- result.insertions += insertions;
13096
- result.deletions += deletions;
13097
- result.files.push({
13098
- file,
13099
- changes: insertions + deletions,
13100
- insertions,
13101
- deletions,
13102
- binary: false
13103
- });
13104
- }),
13690
+ new LineParser(
13691
+ /(\d+)\t(\d+)\t(.+)$/,
13692
+ (result, [changesInsert, changesDelete, file]) => {
13693
+ const insertions = asNumber(changesInsert);
13694
+ const deletions = asNumber(changesDelete);
13695
+ result.changed++;
13696
+ result.insertions += insertions;
13697
+ result.deletions += deletions;
13698
+ result.files.push({
13699
+ file,
13700
+ changes: insertions + deletions,
13701
+ insertions,
13702
+ deletions,
13703
+ binary: false
13704
+ });
13705
+ }
13706
+ ),
13105
13707
  new LineParser(/-\t-\t(.+)$/, (result, [file]) => {
13106
13708
  result.changed++;
13107
13709
  result.files.push({
@@ -13125,17 +13727,22 @@ var init_parse_diff_summary = __esm({
13125
13727
  })
13126
13728
  ];
13127
13729
  nameStatusParser = [
13128
- new LineParser(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/, (result, [status, _similarity, from, _to, to]) => {
13129
- result.changed++;
13130
- result.files.push({
13131
- file: to != null ? to : from,
13132
- changes: 0,
13133
- status: orVoid(isDiffNameStatus(status) && status),
13134
- insertions: 0,
13135
- deletions: 0,
13136
- binary: false
13137
- });
13138
- })
13730
+ new LineParser(
13731
+ /([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/,
13732
+ (result, [status, similarity, from, _to, to]) => {
13733
+ result.changed++;
13734
+ result.files.push({
13735
+ file: to ?? from,
13736
+ changes: 0,
13737
+ insertions: 0,
13738
+ deletions: 0,
13739
+ binary: false,
13740
+ status: orVoid(isDiffNameStatus(status) && status),
13741
+ from: orVoid(!!to && from !== to && from),
13742
+ similarity: asNumber(similarity)
13743
+ });
13744
+ }
13745
+ )
13139
13746
  ];
13140
13747
  diffSummaryParsers = {
13141
13748
  ["" /* NONE */]: statParser,
@@ -13149,17 +13756,24 @@ var init_parse_diff_summary = __esm({
13149
13756
 
13150
13757
  // src/lib/parsers/parse-list-log-summary.ts
13151
13758
  function lineBuilder(tokens, fields) {
13152
- return fields.reduce((line, field, index) => {
13153
- line[field] = tokens[index] || "";
13154
- return line;
13155
- }, /* @__PURE__ */ Object.create({ diff: null }));
13759
+ return fields.reduce(
13760
+ (line, field, index) => {
13761
+ line[field] = tokens[index] || "";
13762
+ return line;
13763
+ },
13764
+ /* @__PURE__ */ Object.create({ diff: null })
13765
+ );
13156
13766
  }
13157
13767
  function createListLogSummaryParser(splitter = SPLITTER, fields = defaultFieldNames, logFormat = "" /* NONE */) {
13158
13768
  const parseDiffResult = getDiffParser(logFormat);
13159
13769
  return function(stdOut) {
13160
- const all = toLinesWithContent(stdOut, true, START_BOUNDARY).map(function(item) {
13161
- const lineDetail = item.trim().split(COMMIT_BOUNDARY);
13162
- const listLogLine = lineBuilder(lineDetail[0].trim().split(splitter), fields);
13770
+ const all = toLinesWithContent(
13771
+ stdOut.trim(),
13772
+ false,
13773
+ START_BOUNDARY
13774
+ ).map(function(item) {
13775
+ const lineDetail = item.split(COMMIT_BOUNDARY);
13776
+ const listLogLine = lineBuilder(lineDetail[0].split(splitter), fields);
13163
13777
  if (lineDetail.length > 1 && !!lineDetail[1].trim()) {
13164
13778
  listLogLine.diff = parseDiffResult(lineDetail[1]);
13165
13779
  }
@@ -13208,10 +13822,14 @@ function diffSummaryTask(customArgs) {
13208
13822
  function validateLogFormatConfig(customArgs) {
13209
13823
  const flags = customArgs.filter(isLogFormat);
13210
13824
  if (flags.length > 1) {
13211
- return configurationErrorTask(`Summary flags are mutually exclusive - pick one of ${flags.join(",")}`);
13825
+ return configurationErrorTask(
13826
+ `Summary flags are mutually exclusive - pick one of ${flags.join(",")}`
13827
+ );
13212
13828
  }
13213
13829
  if (flags.length && customArgs.includes("-z")) {
13214
- return configurationErrorTask(`Summary flag ${flags} parsing is not compatible with null termination option '-z'`);
13830
+ return configurationErrorTask(
13831
+ `Summary flag ${flags} parsing is not compatible with null termination option '-z'`
13832
+ );
13215
13833
  }
13216
13834
  }
13217
13835
  var init_diff = __esm({
@@ -13221,8 +13839,6 @@ var init_diff = __esm({
13221
13839
  init_task();
13222
13840
  }
13223
13841
  });
13224
-
13225
- // src/lib/tasks/log.ts
13226
13842
  function prettyFormat(format, splitter) {
13227
13843
  const fields = [];
13228
13844
  const formatStr = [];
@@ -13242,7 +13858,7 @@ function userOptions(input) {
13242
13858
  }
13243
13859
  function parseLogOptions(opt = {}, customArgs = []) {
13244
13860
  const splitter = filterType(opt.splitter, filterString, SPLITTER);
13245
- const format = !filterPrimitives(opt.format) && opt.format ? opt.format : {
13861
+ const format = filterPlainObject(opt.format) ? opt.format : {
13246
13862
  hash: "%H",
13247
13863
  date: opt.strictDate === false ? "%ai" : "%aI",
13248
13864
  message: "%s",
@@ -13266,7 +13882,7 @@ function parseLogOptions(opt = {}, customArgs = []) {
13266
13882
  suffix.push(`${opt.from || ""}${rangeOperator}${opt.to || ""}`);
13267
13883
  }
13268
13884
  if (filterString(opt.file)) {
13269
- command.push("--follow", pathspec(opt.file));
13885
+ command.push("--follow", c$1(opt.file));
13270
13886
  }
13271
13887
  appendTaskOptions(userOptions(opt), command);
13272
13888
  return {
@@ -13276,18 +13892,21 @@ function parseLogOptions(opt = {}, customArgs = []) {
13276
13892
  };
13277
13893
  }
13278
13894
  function logTask(splitter, fields, customArgs) {
13279
- const parser3 = createListLogSummaryParser(splitter, fields, logFormatFromCommand(customArgs));
13895
+ const parser4 = createListLogSummaryParser(splitter, fields, logFormatFromCommand(customArgs));
13280
13896
  return {
13281
13897
  commands: ["log", ...customArgs],
13282
13898
  format: "utf-8",
13283
- parser: parser3
13899
+ parser: parser4
13284
13900
  };
13285
13901
  }
13286
13902
  function log_default() {
13287
13903
  return {
13288
13904
  log(...rest) {
13289
13905
  const next = trailingFunctionArgument(arguments);
13290
- const options = parseLogOptions(trailingOptionsArgument(arguments), filterType(arguments[0], filterArray));
13906
+ const options = parseLogOptions(
13907
+ trailingOptionsArgument(arguments),
13908
+ asStringArray(filterType(arguments[0], filterArray, []))
13909
+ );
13291
13910
  const task = rejectDeprecatedSignatures(...rest) || validateLogFormatConfig(options.commands) || createLogTask(options);
13292
13911
  return this._runTask(task, next);
13293
13912
  }
@@ -13296,14 +13915,15 @@ function log_default() {
13296
13915
  return logTask(options.splitter, options.fields, options.commands);
13297
13916
  }
13298
13917
  function rejectDeprecatedSignatures(from, to) {
13299
- return filterString(from) && filterString(to) && configurationErrorTask(`git.log(string, string) should be replaced with git.log({ from: string, to: string })`);
13918
+ return filterString(from) && filterString(to) && configurationErrorTask(
13919
+ `git.log(string, string) should be replaced with git.log({ from: string, to: string })`
13920
+ );
13300
13921
  }
13301
13922
  }
13302
13923
  var excludeOptions;
13303
13924
  var init_log = __esm({
13304
13925
  "src/lib/tasks/log.ts"() {
13305
13926
  init_log_format();
13306
- init_pathspec();
13307
13927
  init_parse_list_log_summary();
13308
13928
  init_utils();
13309
13929
  init_task();
@@ -13428,22 +14048,31 @@ var init_parse_remote_objects = __esm({
13428
14048
  "src/lib/parsers/parse-remote-objects.ts"() {
13429
14049
  init_utils();
13430
14050
  remoteMessagesObjectParsers = [
13431
- new RemoteLineParser(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i, (result, [action, count]) => {
13432
- const key = action.toLowerCase();
13433
- const enumeration = objectEnumerationResult(result.remoteMessages);
13434
- Object.assign(enumeration, { [key]: asNumber(count) });
13435
- }),
13436
- new RemoteLineParser(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i, (result, [action, count]) => {
13437
- const key = action.toLowerCase();
13438
- const enumeration = objectEnumerationResult(result.remoteMessages);
13439
- Object.assign(enumeration, { [key]: asNumber(count) });
13440
- }),
13441
- new RemoteLineParser(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i, (result, [total, reused, packReused]) => {
13442
- const objects = objectEnumerationResult(result.remoteMessages);
13443
- objects.total = asObjectCount(total);
13444
- objects.reused = asObjectCount(reused);
13445
- objects.packReused = asNumber(packReused);
13446
- })
14051
+ new RemoteLineParser(
14052
+ /^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i,
14053
+ (result, [action, count]) => {
14054
+ const key = action.toLowerCase();
14055
+ const enumeration = objectEnumerationResult(result.remoteMessages);
14056
+ Object.assign(enumeration, { [key]: asNumber(count) });
14057
+ }
14058
+ ),
14059
+ new RemoteLineParser(
14060
+ /^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i,
14061
+ (result, [action, count]) => {
14062
+ const key = action.toLowerCase();
14063
+ const enumeration = objectEnumerationResult(result.remoteMessages);
14064
+ Object.assign(enumeration, { [key]: asNumber(count) });
14065
+ }
14066
+ ),
14067
+ new RemoteLineParser(
14068
+ /total ([^,]+), reused ([^,]+), pack-reused (\d+)/i,
14069
+ (result, [total, reused, packReused]) => {
14070
+ const objects = objectEnumerationResult(result.remoteMessages);
14071
+ objects.total = asObjectCount(total);
14072
+ objects.reused = asObjectCount(reused);
14073
+ objects.packReused = asNumber(packReused);
14074
+ }
14075
+ )
13447
14076
  ];
13448
14077
  }
13449
14078
  });
@@ -13463,16 +14092,22 @@ var init_parse_remote_messages = __esm({
13463
14092
  return false;
13464
14093
  }),
13465
14094
  ...remoteMessagesObjectParsers,
13466
- new RemoteLineParser([/create a (?:pull|merge) request/i, /\s(https?:\/\/\S+)$/], (result, [pullRequestUrl]) => {
13467
- result.remoteMessages.pullRequestUrl = pullRequestUrl;
13468
- }),
13469
- new RemoteLineParser([/found (\d+) vulnerabilities.+\(([^)]+)\)/i, /\s(https?:\/\/\S+)$/], (result, [count, summary, url]) => {
13470
- result.remoteMessages.vulnerabilities = {
13471
- count: asNumber(count),
13472
- summary,
13473
- url
13474
- };
13475
- })
14095
+ new RemoteLineParser(
14096
+ [/create a (?:pull|merge) request/i, /\s(https?:\/\/\S+)$/],
14097
+ (result, [pullRequestUrl]) => {
14098
+ result.remoteMessages.pullRequestUrl = pullRequestUrl;
14099
+ }
14100
+ ),
14101
+ new RemoteLineParser(
14102
+ [/found (\d+) vulnerabilities.+\(([^)]+)\)/i, /\s(https?:\/\/\S+)$/],
14103
+ (result, [count, summary, url]) => {
14104
+ result.remoteMessages.vulnerabilities = {
14105
+ count: asNumber(count),
14106
+ summary,
14107
+ url
14108
+ };
14109
+ }
14110
+ )
13476
14111
  ];
13477
14112
  RemoteMessageSummary = class {
13478
14113
  constructor() {
@@ -13523,18 +14158,25 @@ var init_parse_pull = __esm({
13523
14158
  errorParsers = [
13524
14159
  new LineParser(/^from\s(.+)$/i, (result, [remote]) => void (result.remote = remote)),
13525
14160
  new LineParser(/^fatal:\s(.+)$/, (result, [message]) => void (result.message = message)),
13526
- new LineParser(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/, (result, [hashLocal, hashRemote, branchLocal, branchRemote]) => {
13527
- result.branch.local = branchLocal;
13528
- result.hash.local = hashLocal;
13529
- result.branch.remote = branchRemote;
13530
- result.hash.remote = hashRemote;
13531
- })
14161
+ new LineParser(
14162
+ /([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/,
14163
+ (result, [hashLocal, hashRemote, branchLocal, branchRemote]) => {
14164
+ result.branch.local = branchLocal;
14165
+ result.hash.local = hashLocal;
14166
+ result.branch.remote = branchRemote;
14167
+ result.hash.remote = hashRemote;
14168
+ }
14169
+ )
13532
14170
  ];
13533
14171
  parsePullDetail = (stdOut, stdErr) => {
13534
14172
  return parseStringResponse(new PullSummary(), parsers3, [stdOut, stdErr]);
13535
14173
  };
13536
14174
  parsePullResult = (stdOut, stdErr) => {
13537
- return Object.assign(new PullSummary(), parsePullDetail(stdOut, stdErr), parseRemoteMessages(stdOut, stdErr));
14175
+ return Object.assign(
14176
+ new PullSummary(),
14177
+ parsePullDetail(stdOut, stdErr),
14178
+ parseRemoteMessages(stdOut, stdErr)
14179
+ );
13538
14180
  };
13539
14181
  }
13540
14182
  });
@@ -13553,9 +14195,12 @@ var init_parse_merge = __esm({
13553
14195
  new LineParser(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/, (summary, [reason, file]) => {
13554
14196
  summary.conflicts.push(new MergeSummaryConflict(reason, file));
13555
14197
  }),
13556
- new LineParser(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/, (summary, [reason, file, deleteRef]) => {
13557
- summary.conflicts.push(new MergeSummaryConflict(reason, file, { deleteRef }));
13558
- }),
14198
+ new LineParser(
14199
+ /^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/,
14200
+ (summary, [reason, file, deleteRef]) => {
14201
+ summary.conflicts.push(new MergeSummaryConflict(reason, file, { deleteRef }));
14202
+ }
14203
+ ),
13559
14204
  new LineParser(/^CONFLICT\s+\((.+)\):/, (summary, [reason]) => {
13560
14205
  summary.conflicts.push(new MergeSummaryConflict(reason, null));
13561
14206
  }),
@@ -13622,37 +14267,48 @@ var init_parse_push = __esm({
13622
14267
  result.repo = repo;
13623
14268
  }),
13624
14269
  new LineParser(/^updating local tracking ref '(.+)'/, (result, [local]) => {
13625
- result.ref = __spreadProps(__spreadValues({}, result.ref || {}), {
14270
+ result.ref = {
14271
+ ...result.ref || {},
13626
14272
  local
13627
- });
14273
+ };
13628
14274
  }),
13629
14275
  new LineParser(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/, (result, [local, remote, type]) => {
13630
14276
  result.pushed.push(pushResultPushedItem(local, remote, type));
13631
14277
  }),
13632
- new LineParser(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/, (result, [local, remote, remoteName]) => {
13633
- result.branch = __spreadProps(__spreadValues({}, result.branch || {}), {
13634
- local,
13635
- remote,
13636
- remoteName
13637
- });
13638
- }),
13639
- new LineParser(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/, (result, [local, remote, from, to]) => {
13640
- result.update = {
13641
- head: {
14278
+ new LineParser(
14279
+ /^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/,
14280
+ (result, [local, remote, remoteName]) => {
14281
+ result.branch = {
14282
+ ...result.branch || {},
13642
14283
  local,
13643
- remote
13644
- },
13645
- hash: {
13646
- from,
13647
- to
13648
- }
13649
- };
13650
- })
14284
+ remote,
14285
+ remoteName
14286
+ };
14287
+ }
14288
+ ),
14289
+ new LineParser(
14290
+ /^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/,
14291
+ (result, [local, remote, from, to]) => {
14292
+ result.update = {
14293
+ head: {
14294
+ local,
14295
+ remote
14296
+ },
14297
+ hash: {
14298
+ from,
14299
+ to
14300
+ }
14301
+ };
14302
+ }
14303
+ )
13651
14304
  ];
13652
14305
  parsePushResult = (stdOut, stdErr) => {
13653
14306
  const pushDetail = parsePushDetail(stdOut, stdErr);
13654
14307
  const responseDetail = parseRemoteMessages(stdOut, stdErr);
13655
- return __spreadValues(__spreadValues({}, pushDetail), responseDetail);
14308
+ return {
14309
+ ...pushDetail,
14310
+ ...responseDetail
14311
+ };
13656
14312
  };
13657
14313
  parsePushDetail = (stdOut, stdErr) => {
13658
14314
  return parseStringResponse({ pushed: [] }, parsers5, [stdOut, stdErr]);
@@ -13702,11 +14358,17 @@ function show_default() {
13702
14358
  if (!commands.includes("--binary")) {
13703
14359
  commands.splice(1, 0, "--binary");
13704
14360
  }
13705
- return this._runTask(straightThroughBufferTask(commands), trailingFunctionArgument(arguments));
14361
+ return this._runTask(
14362
+ straightThroughBufferTask(commands),
14363
+ trailingFunctionArgument(arguments)
14364
+ );
13706
14365
  },
13707
14366
  show() {
13708
14367
  const commands = ["show", ...getTrailingOptions(arguments, 1)];
13709
- return this._runTask(straightThroughStringTask(commands), trailingFunctionArgument(arguments));
14368
+ return this._runTask(
14369
+ straightThroughStringTask(commands),
14370
+ trailingFunctionArgument(arguments)
14371
+ );
13710
14372
  }
13711
14373
  };
13712
14374
  }
@@ -13721,16 +14383,16 @@ var init_show = __esm({
13721
14383
  var fromPathRegex, FileStatusSummary;
13722
14384
  var init_FileStatusSummary = __esm({
13723
14385
  "src/lib/responses/FileStatusSummary.ts"() {
13724
- fromPathRegex = /^(.+) -> (.+)$/;
14386
+ fromPathRegex = /^(.+)\0(.+)$/;
13725
14387
  FileStatusSummary = class {
13726
14388
  constructor(path, index, working_dir) {
13727
14389
  this.path = path;
13728
14390
  this.index = index;
13729
14391
  this.working_dir = working_dir;
13730
- if (index + working_dir === "R") {
14392
+ if (index === "R" || working_dir === "R") {
13731
14393
  const detail = fromPathRegex.exec(path) || [null, path, path];
13732
- this.from = detail[1] || "";
13733
- this.path = detail[2] || "";
14394
+ this.from = detail[2] || "";
14395
+ this.path = detail[1] || "";
13734
14396
  }
13735
14397
  }
13736
14398
  };
@@ -13745,19 +14407,19 @@ function renamedFile(line) {
13745
14407
  to
13746
14408
  };
13747
14409
  }
13748
- function parser2(indexX, indexY, handler) {
14410
+ function parser3(indexX, indexY, handler) {
13749
14411
  return [`${indexX}${indexY}`, handler];
13750
14412
  }
13751
14413
  function conflicts(indexX, ...indexY) {
13752
- return indexY.map((y) => parser2(indexX, y, (result, file) => append(result.conflicted, file)));
14414
+ return indexY.map((y) => parser3(indexX, y, (result, file) => result.conflicted.push(file)));
13753
14415
  }
13754
14416
  function splitLine(result, lineStr) {
13755
14417
  const trimmed2 = lineStr.trim();
13756
14418
  switch (" ") {
13757
14419
  case trimmed2.charAt(2):
13758
- return data(trimmed2.charAt(0), trimmed2.charAt(1), trimmed2.substr(3));
14420
+ return data(trimmed2.charAt(0), trimmed2.charAt(1), trimmed2.slice(3));
13759
14421
  case trimmed2.charAt(1):
13760
- return data(" " /* NONE */, trimmed2.charAt(0), trimmed2.substr(2));
14422
+ return data(" " /* NONE */, trimmed2.charAt(0), trimmed2.slice(2));
13761
14423
  default:
13762
14424
  return;
13763
14425
  }
@@ -13768,7 +14430,7 @@ function splitLine(result, lineStr) {
13768
14430
  handler(result, path);
13769
14431
  }
13770
14432
  if (raw !== "##" && raw !== "!!") {
13771
- result.files.push(new FileStatusSummary(path.replace(/\0.+$/, ""), index, workingDir));
14433
+ result.files.push(new FileStatusSummary(path, index, workingDir));
13772
14434
  }
13773
14435
  }
13774
14436
  }
@@ -13799,29 +14461,70 @@ var init_StatusSummary = __esm({
13799
14461
  }
13800
14462
  };
13801
14463
  parsers6 = new Map([
13802
- parser2(" " /* NONE */, "A" /* ADDED */, (result, file) => append(result.created, file)),
13803
- parser2(" " /* NONE */, "D" /* DELETED */, (result, file) => append(result.deleted, file)),
13804
- parser2(" " /* NONE */, "M" /* MODIFIED */, (result, file) => append(result.modified, file)),
13805
- parser2("A" /* ADDED */, " " /* NONE */, (result, file) => append(result.created, file) && append(result.staged, file)),
13806
- parser2("A" /* ADDED */, "M" /* MODIFIED */, (result, file) => append(result.created, file) && append(result.staged, file) && append(result.modified, file)),
13807
- parser2("D" /* DELETED */, " " /* NONE */, (result, file) => append(result.deleted, file) && append(result.staged, file)),
13808
- parser2("M" /* MODIFIED */, " " /* NONE */, (result, file) => append(result.modified, file) && append(result.staged, file)),
13809
- parser2("M" /* MODIFIED */, "M" /* MODIFIED */, (result, file) => append(result.modified, file) && append(result.staged, file)),
13810
- parser2("R" /* RENAMED */, " " /* NONE */, (result, file) => {
13811
- append(result.renamed, renamedFile(file));
14464
+ parser3(
14465
+ " " /* NONE */,
14466
+ "A" /* ADDED */,
14467
+ (result, file) => result.created.push(file)
14468
+ ),
14469
+ parser3(
14470
+ " " /* NONE */,
14471
+ "D" /* DELETED */,
14472
+ (result, file) => result.deleted.push(file)
14473
+ ),
14474
+ parser3(
14475
+ " " /* NONE */,
14476
+ "M" /* MODIFIED */,
14477
+ (result, file) => result.modified.push(file)
14478
+ ),
14479
+ parser3("A" /* ADDED */, " " /* NONE */, (result, file) => {
14480
+ result.created.push(file);
14481
+ result.staged.push(file);
14482
+ }),
14483
+ parser3("A" /* ADDED */, "M" /* MODIFIED */, (result, file) => {
14484
+ result.created.push(file);
14485
+ result.staged.push(file);
14486
+ result.modified.push(file);
14487
+ }),
14488
+ parser3("D" /* DELETED */, " " /* NONE */, (result, file) => {
14489
+ result.deleted.push(file);
14490
+ result.staged.push(file);
14491
+ }),
14492
+ parser3("M" /* MODIFIED */, " " /* NONE */, (result, file) => {
14493
+ result.modified.push(file);
14494
+ result.staged.push(file);
13812
14495
  }),
13813
- parser2("R" /* RENAMED */, "M" /* MODIFIED */, (result, file) => {
14496
+ parser3("M" /* MODIFIED */, "M" /* MODIFIED */, (result, file) => {
14497
+ result.modified.push(file);
14498
+ result.staged.push(file);
14499
+ }),
14500
+ parser3("R" /* RENAMED */, " " /* NONE */, (result, file) => {
14501
+ result.renamed.push(renamedFile(file));
14502
+ }),
14503
+ parser3("R" /* RENAMED */, "M" /* MODIFIED */, (result, file) => {
13814
14504
  const renamed = renamedFile(file);
13815
- append(result.renamed, renamed);
13816
- append(result.modified, renamed.to);
14505
+ result.renamed.push(renamed);
14506
+ result.modified.push(renamed.to);
13817
14507
  }),
13818
- parser2("!" /* IGNORED */, "!" /* IGNORED */, (_result, _file) => {
13819
- append(_result.ignored = _result.ignored || [], _file);
14508
+ parser3("!" /* IGNORED */, "!" /* IGNORED */, (_result, _file) => {
14509
+ (_result.ignored = _result.ignored || []).push(_file);
13820
14510
  }),
13821
- parser2("?" /* UNTRACKED */, "?" /* UNTRACKED */, (result, file) => append(result.not_added, file)),
14511
+ parser3(
14512
+ "?" /* UNTRACKED */,
14513
+ "?" /* UNTRACKED */,
14514
+ (result, file) => result.not_added.push(file)
14515
+ ),
13822
14516
  ...conflicts("A" /* ADDED */, "A" /* ADDED */, "U" /* UNMERGED */),
13823
- ...conflicts("D" /* DELETED */, "D" /* DELETED */, "U" /* UNMERGED */),
13824
- ...conflicts("U" /* UNMERGED */, "A" /* ADDED */, "D" /* DELETED */, "U" /* UNMERGED */),
14517
+ ...conflicts(
14518
+ "D" /* DELETED */,
14519
+ "D" /* DELETED */,
14520
+ "U" /* UNMERGED */
14521
+ ),
14522
+ ...conflicts(
14523
+ "U" /* UNMERGED */,
14524
+ "A" /* ADDED */,
14525
+ "D" /* DELETED */,
14526
+ "U" /* UNMERGED */
14527
+ ),
13825
14528
  [
13826
14529
  "##",
13827
14530
  (result, line) => {
@@ -13829,18 +14532,19 @@ var init_StatusSummary = __esm({
13829
14532
  const behindReg = /behind (\d+)/;
13830
14533
  const currentReg = /^(.+?(?=(?:\.{3}|\s|$)))/;
13831
14534
  const trackingReg = /\.{3}(\S*)/;
13832
- const onEmptyBranchReg = /\son\s([\S]+)$/;
13833
- let regexResult;
13834
- regexResult = aheadReg.exec(line);
14535
+ const onEmptyBranchReg = /\son\s(\S+?)(?=\.{3}|$)/;
14536
+ let regexResult = aheadReg.exec(line);
13835
14537
  result.ahead = regexResult && +regexResult[1] || 0;
13836
14538
  regexResult = behindReg.exec(line);
13837
14539
  result.behind = regexResult && +regexResult[1] || 0;
13838
14540
  regexResult = currentReg.exec(line);
13839
- result.current = regexResult && regexResult[1];
14541
+ result.current = filterType(regexResult?.[1], filterString, null);
13840
14542
  regexResult = trackingReg.exec(line);
13841
- result.tracking = regexResult && regexResult[1];
14543
+ result.tracking = filterType(regexResult?.[1], filterString, null);
13842
14544
  regexResult = onEmptyBranchReg.exec(line);
13843
- result.current = regexResult && regexResult[1] || result.current;
14545
+ if (regexResult) {
14546
+ result.current = filterType(regexResult?.[1], filterString, result.current);
14547
+ }
13844
14548
  result.detached = /\(no branch\)/.test(line);
13845
14549
  }
13846
14550
  ]
@@ -13891,19 +14595,23 @@ var init_status = __esm({
13891
14595
 
13892
14596
  // src/lib/tasks/version.ts
13893
14597
  function versionResponse(major = 0, minor = 0, patch = 0, agent = "", installed = true) {
13894
- return Object.defineProperty({
13895
- major,
13896
- minor,
13897
- patch,
13898
- agent,
13899
- installed
13900
- }, "toString", {
13901
- value() {
13902
- return `${this.major}.${this.minor}.${this.patch}`;
14598
+ return Object.defineProperty(
14599
+ {
14600
+ major,
14601
+ minor,
14602
+ patch,
14603
+ agent,
14604
+ installed
13903
14605
  },
13904
- configurable: false,
13905
- enumerable: false
13906
- });
14606
+ "toString",
14607
+ {
14608
+ value() {
14609
+ return `${this.major}.${this.minor}.${this.patch}`;
14610
+ },
14611
+ configurable: false,
14612
+ enumerable: false
14613
+ }
14614
+ );
13907
14615
  }
13908
14616
  function notInstalledResponse() {
13909
14617
  return versionResponse(0, 0, 0, "", false);
@@ -13937,15 +14645,63 @@ var init_version = __esm({
13937
14645
  init_utils();
13938
14646
  NOT_INSTALLED = "installed=false";
13939
14647
  parsers7 = [
13940
- new LineParser(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/, (result, [major, minor, patch, agent = ""]) => {
13941
- Object.assign(result, versionResponse(asNumber(major), asNumber(minor), asNumber(patch), agent));
13942
- }),
13943
- new LineParser(/version (\d+)\.(\d+)\.(\D+)(.+)?$/, (result, [major, minor, patch, agent = ""]) => {
13944
- Object.assign(result, versionResponse(asNumber(major), asNumber(minor), patch, agent));
13945
- })
14648
+ new LineParser(
14649
+ /version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/,
14650
+ (result, [major, minor, patch, agent = ""]) => {
14651
+ Object.assign(
14652
+ result,
14653
+ versionResponse(asNumber(major), asNumber(minor), asNumber(patch), agent)
14654
+ );
14655
+ }
14656
+ ),
14657
+ new LineParser(
14658
+ /version (\d+)\.(\d+)\.(\D+)(.+)?$/,
14659
+ (result, [major, minor, patch, agent = ""]) => {
14660
+ Object.assign(result, versionResponse(asNumber(major), asNumber(minor), patch, agent));
14661
+ }
14662
+ )
13946
14663
  ];
13947
14664
  }
13948
14665
  });
14666
+ function createCloneTask(api, task, repoPath, ...args) {
14667
+ if (!filterString(repoPath)) {
14668
+ return configurationErrorTask(`git.${api}() requires a string 'repoPath'`);
14669
+ }
14670
+ return task(repoPath, filterType(args[0], filterString), getTrailingOptions(arguments));
14671
+ }
14672
+ function clone_default() {
14673
+ return {
14674
+ clone(repo, ...rest) {
14675
+ return this._runTask(
14676
+ createCloneTask("clone", cloneTask, filterType(repo, filterString), ...rest),
14677
+ trailingFunctionArgument(arguments)
14678
+ );
14679
+ },
14680
+ mirror(repo, ...rest) {
14681
+ return this._runTask(
14682
+ createCloneTask("mirror", cloneMirrorTask, filterType(repo, filterString), ...rest),
14683
+ trailingFunctionArgument(arguments)
14684
+ );
14685
+ }
14686
+ };
14687
+ }
14688
+ var cloneTask, cloneMirrorTask;
14689
+ var init_clone = __esm({
14690
+ "src/lib/tasks/clone.ts"() {
14691
+ init_task();
14692
+ init_utils();
14693
+ cloneTask = (repo, directory, customArgs) => {
14694
+ const commands = ["clone", ...customArgs];
14695
+ filterString(repo) && commands.push(c$1(repo));
14696
+ filterString(directory) && commands.push(c$1(directory));
14697
+ return straightThroughStringTask(commands);
14698
+ };
14699
+ cloneMirrorTask = (repo, directory, customArgs) => {
14700
+ append(customArgs, "--mirror");
14701
+ return cloneTask(repo, directory, customArgs);
14702
+ };
14703
+ }
14704
+ });
13949
14705
 
13950
14706
  // src/lib/simple-git-api.ts
13951
14707
  var simple_git_api_exports = {};
@@ -13958,6 +14714,7 @@ var init_simple_git_api = __esm({
13958
14714
  init_task_callback();
13959
14715
  init_change_working_directory();
13960
14716
  init_checkout();
14717
+ init_count_objects();
13961
14718
  init_commit();
13962
14719
  init_config();
13963
14720
  init_first_commit();
@@ -13972,6 +14729,7 @@ var init_simple_git_api = __esm({
13972
14729
  init_task();
13973
14730
  init_version();
13974
14731
  init_utils();
14732
+ init_clone();
13975
14733
  SimpleGitApi = class {
13976
14734
  constructor(_executor) {
13977
14735
  this._executor = _executor;
@@ -13989,52 +14747,101 @@ var init_simple_git_api = __esm({
13989
14747
  });
13990
14748
  }
13991
14749
  add(files) {
13992
- return this._runTask(straightThroughStringTask(["add", ...asArray(files)]), trailingFunctionArgument(arguments));
14750
+ return this._runTask(
14751
+ straightThroughStringTask(["add", ...asArray(files)]),
14752
+ trailingFunctionArgument(arguments)
14753
+ );
13993
14754
  }
13994
14755
  cwd(directory) {
13995
14756
  const next = trailingFunctionArgument(arguments);
13996
14757
  if (typeof directory === "string") {
13997
14758
  return this._runTask(changeWorkingDirectoryTask(directory, this._executor), next);
13998
14759
  }
13999
- if (typeof (directory == null ? void 0 : directory.path) === "string") {
14000
- return this._runTask(changeWorkingDirectoryTask(directory.path, directory.root && this._executor || void 0), next);
14760
+ if (typeof directory?.path === "string") {
14761
+ return this._runTask(
14762
+ changeWorkingDirectoryTask(
14763
+ directory.path,
14764
+ directory.root && this._executor || void 0
14765
+ ),
14766
+ next
14767
+ );
14001
14768
  }
14002
- return this._runTask(configurationErrorTask("Git.cwd: workingDirectory must be supplied as a string"), next);
14769
+ return this._runTask(
14770
+ configurationErrorTask("Git.cwd: workingDirectory must be supplied as a string"),
14771
+ next
14772
+ );
14003
14773
  }
14004
14774
  hashObject(path, write) {
14005
- return this._runTask(hashObjectTask(path, write === true), trailingFunctionArgument(arguments));
14775
+ return this._runTask(
14776
+ hashObjectTask(path, write === true),
14777
+ trailingFunctionArgument(arguments)
14778
+ );
14006
14779
  }
14007
14780
  init(bare) {
14008
- return this._runTask(initTask(bare === true, this._executor.cwd, getTrailingOptions(arguments)), trailingFunctionArgument(arguments));
14781
+ return this._runTask(
14782
+ initTask(bare === true, this._executor.cwd, getTrailingOptions(arguments)),
14783
+ trailingFunctionArgument(arguments)
14784
+ );
14009
14785
  }
14010
14786
  merge() {
14011
- return this._runTask(mergeTask(getTrailingOptions(arguments)), trailingFunctionArgument(arguments));
14787
+ return this._runTask(
14788
+ mergeTask(getTrailingOptions(arguments)),
14789
+ trailingFunctionArgument(arguments)
14790
+ );
14012
14791
  }
14013
14792
  mergeFromTo(remote, branch) {
14014
14793
  if (!(filterString(remote) && filterString(branch))) {
14015
- return this._runTask(configurationErrorTask(`Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings`));
14794
+ return this._runTask(
14795
+ configurationErrorTask(
14796
+ `Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings`
14797
+ )
14798
+ );
14016
14799
  }
14017
- return this._runTask(mergeTask([remote, branch, ...getTrailingOptions(arguments)]), trailingFunctionArgument(arguments, false));
14800
+ return this._runTask(
14801
+ mergeTask([remote, branch, ...getTrailingOptions(arguments)]),
14802
+ trailingFunctionArgument(arguments, false)
14803
+ );
14018
14804
  }
14019
14805
  outputHandler(handler) {
14020
14806
  this._executor.outputHandler = handler;
14021
14807
  return this;
14022
14808
  }
14023
14809
  push() {
14024
- const task = pushTask({
14025
- remote: filterType(arguments[0], filterString),
14026
- branch: filterType(arguments[1], filterString)
14027
- }, getTrailingOptions(arguments));
14810
+ const task = pushTask(
14811
+ {
14812
+ remote: filterType(arguments[0], filterString),
14813
+ branch: filterType(arguments[1], filterString)
14814
+ },
14815
+ getTrailingOptions(arguments)
14816
+ );
14028
14817
  return this._runTask(task, trailingFunctionArgument(arguments));
14029
14818
  }
14030
14819
  stash() {
14031
- return this._runTask(straightThroughStringTask(["stash", ...getTrailingOptions(arguments)]), trailingFunctionArgument(arguments));
14820
+ return this._runTask(
14821
+ straightThroughStringTask(["stash", ...getTrailingOptions(arguments)]),
14822
+ trailingFunctionArgument(arguments)
14823
+ );
14032
14824
  }
14033
14825
  status() {
14034
- return this._runTask(statusTask(getTrailingOptions(arguments)), trailingFunctionArgument(arguments));
14826
+ return this._runTask(
14827
+ statusTask(getTrailingOptions(arguments)),
14828
+ trailingFunctionArgument(arguments)
14829
+ );
14035
14830
  }
14036
14831
  };
14037
- Object.assign(SimpleGitApi.prototype, checkout_default(), commit_default(), config_default(), first_commit_default(), grep_default(), log_default(), show_default(), version_default());
14832
+ Object.assign(
14833
+ SimpleGitApi.prototype,
14834
+ checkout_default(),
14835
+ clone_default(),
14836
+ commit_default(),
14837
+ config_default(),
14838
+ count_objects_default(),
14839
+ first_commit_default(),
14840
+ grep_default(),
14841
+ log_default(),
14842
+ show_default(),
14843
+ version_default()
14844
+ );
14038
14845
  }
14039
14846
  });
14040
14847
 
@@ -14048,7 +14855,7 @@ var init_scheduler = __esm({
14048
14855
  "src/lib/runners/scheduler.ts"() {
14049
14856
  init_utils();
14050
14857
  init_git_logger();
14051
- createScheduledTask = (() => {
14858
+ createScheduledTask = /* @__PURE__ */ (() => {
14052
14859
  let id = 0;
14053
14860
  return () => {
14054
14861
  id++;
@@ -14070,7 +14877,12 @@ var init_scheduler = __esm({
14070
14877
  }
14071
14878
  schedule() {
14072
14879
  if (!this.pending.length || this.running.length >= this.concurrency) {
14073
- this.logger(`Schedule attempt ignored, pending=%s running=%s concurrency=%s`, this.pending.length, this.running.length, this.concurrency);
14880
+ this.logger(
14881
+ `Schedule attempt ignored, pending=%s running=%s concurrency=%s`,
14882
+ this.pending.length,
14883
+ this.running.length,
14884
+ this.concurrency
14885
+ );
14074
14886
  return;
14075
14887
  }
14076
14888
  const task = append(this.running, this.pending.shift());
@@ -14199,22 +15011,35 @@ var init_BranchSummary = __esm({
14199
15011
  function branchStatus(input) {
14200
15012
  return input ? input.charAt(0) : "";
14201
15013
  }
14202
- function parseBranchSummary(stdOut) {
14203
- return parseStringResponse(new BranchSummaryResult(), parsers9, stdOut);
15014
+ function parseBranchSummary(stdOut, currentOnly = false) {
15015
+ return parseStringResponse(
15016
+ new BranchSummaryResult(),
15017
+ currentOnly ? [currentBranchParser] : parsers9,
15018
+ stdOut
15019
+ );
14204
15020
  }
14205
- var parsers9;
15021
+ var parsers9, currentBranchParser;
14206
15022
  var init_parse_branch = __esm({
14207
15023
  "src/lib/parsers/parse-branch.ts"() {
14208
15024
  init_BranchSummary();
14209
15025
  init_utils();
14210
15026
  parsers9 = [
14211
- new LineParser(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/, (result, [current, name, commit, label]) => {
14212
- result.push(branchStatus(current), true, name, commit, label);
14213
- }),
14214
- new LineParser(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s, (result, [current, name, commit, label]) => {
14215
- result.push(branchStatus(current), false, name, commit, label);
14216
- })
15027
+ new LineParser(
15028
+ /^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/,
15029
+ (result, [current, name, commit, label]) => {
15030
+ result.push(branchStatus(current), true, name, commit, label);
15031
+ }
15032
+ ),
15033
+ new LineParser(
15034
+ /^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s,
15035
+ (result, [current, name, commit, label]) => {
15036
+ result.push(branchStatus(current), false, name, commit, label);
15037
+ }
15038
+ )
14217
15039
  ];
15040
+ currentBranchParser = new LineParser(/^(\S+)$/s, (result, [name]) => {
15041
+ result.push("*" /* CURRENT */, false, name, "", "");
15042
+ });
14218
15043
  }
14219
15044
  });
14220
15045
 
@@ -14233,6 +15058,7 @@ function containsDeleteBranchCommand(commands) {
14233
15058
  }
14234
15059
  function branchTask(customArgs) {
14235
15060
  const isDelete = containsDeleteBranchCommand(customArgs);
15061
+ const isCurrentOnly = customArgs.includes("--show-current");
14236
15062
  const commands = ["branch", ...customArgs];
14237
15063
  if (commands.length === 1) {
14238
15064
  commands.push("-a");
@@ -14247,16 +15073,17 @@ function branchTask(customArgs) {
14247
15073
  if (isDelete) {
14248
15074
  return parseBranchDeletions(stdOut, stdErr).all[0];
14249
15075
  }
14250
- return parseBranchSummary(stdOut);
15076
+ return parseBranchSummary(stdOut, isCurrentOnly);
14251
15077
  }
14252
15078
  };
14253
15079
  }
14254
15080
  function branchLocalTask() {
14255
- const parser3 = parseBranchSummary;
14256
15081
  return {
14257
15082
  format: "utf-8",
14258
15083
  commands: ["branch", "-v"],
14259
- parser: parser3
15084
+ parser(stdOut) {
15085
+ return parseBranchSummary(stdOut);
15086
+ }
14260
15087
  };
14261
15088
  }
14262
15089
  function deleteBranchesTask(branches, forceDelete = false) {
@@ -14285,7 +15112,10 @@ function deleteBranchTask(branch, forceDelete = false) {
14285
15112
  if (!hasBranchDeletionError(String(error), exitCode)) {
14286
15113
  return fail(error);
14287
15114
  }
14288
- throw new GitResponseError(task.parser(bufferToString(stdOut), bufferToString(stdErr)), String(error));
15115
+ throw new GitResponseError(
15116
+ task.parser(bufferToString(stdOut), bufferToString(stdErr)),
15117
+ String(error)
15118
+ );
14289
15119
  }
14290
15120
  };
14291
15121
  return task;
@@ -14298,13 +15128,15 @@ var init_branch = __esm({
14298
15128
  init_utils();
14299
15129
  }
14300
15130
  });
14301
-
14302
- // src/lib/responses/CheckIgnore.ts
15131
+ function toPath(input) {
15132
+ const path = input.trim().replace(/^["']|["']$/g, "");
15133
+ return path && normalize(path);
15134
+ }
14303
15135
  var parseCheckIgnore;
14304
15136
  var init_CheckIgnore = __esm({
14305
15137
  "src/lib/responses/CheckIgnore.ts"() {
14306
15138
  parseCheckIgnore = (text) => {
14307
- return text.split(/\n/g).map((line) => line.trim()).filter((file) => !!file);
15139
+ return text.split(/\n/g).map(toPath).filter(Boolean);
14308
15140
  };
14309
15141
  }
14310
15142
  });
@@ -14327,36 +15159,6 @@ var init_check_ignore = __esm({
14327
15159
  }
14328
15160
  });
14329
15161
 
14330
- // src/lib/tasks/clone.ts
14331
- var clone_exports = {};
14332
- __export(clone_exports, {
14333
- cloneMirrorTask: () => cloneMirrorTask,
14334
- cloneTask: () => cloneTask
14335
- });
14336
- function disallowedCommand(command) {
14337
- return /^--upload-pack(=|$)/.test(command);
14338
- }
14339
- function cloneTask(repo, directory, customArgs) {
14340
- const commands = ["clone", ...customArgs];
14341
- filterString(repo) && commands.push(repo);
14342
- filterString(directory) && commands.push(directory);
14343
- const banned = commands.find(disallowedCommand);
14344
- if (banned) {
14345
- return configurationErrorTask(`git.fetch: potential exploit argument blocked.`);
14346
- }
14347
- return straightThroughStringTask(commands);
14348
- }
14349
- function cloneMirrorTask(repo, directory, customArgs) {
14350
- append(customArgs, "--mirror");
14351
- return cloneTask(repo, directory, customArgs);
14352
- }
14353
- var init_clone = __esm({
14354
- "src/lib/tasks/clone.ts"() {
14355
- init_task();
14356
- init_utils();
14357
- }
14358
- });
14359
-
14360
15162
  // src/lib/parsers/parse-fetch.ts
14361
15163
  function parseFetchResult(stdOut, stdErr) {
14362
15164
  const result = {
@@ -14394,14 +15196,17 @@ var init_parse_fetch = __esm({
14394
15196
  tracking
14395
15197
  });
14396
15198
  }),
14397
- new LineParser(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/, (result, [from, to, name, tracking]) => {
14398
- result.updated.push({
14399
- name,
14400
- tracking,
14401
- to,
14402
- from
14403
- });
14404
- })
15199
+ new LineParser(
15200
+ /\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/,
15201
+ (result, [from, to, name, tracking]) => {
15202
+ result.updated.push({
15203
+ name,
15204
+ tracking,
15205
+ to,
15206
+ from
15207
+ });
15208
+ }
15209
+ )
14405
15210
  ];
14406
15211
  }
14407
15212
  });
@@ -14411,7 +15216,7 @@ var fetch_exports = {};
14411
15216
  __export(fetch_exports, {
14412
15217
  fetchTask: () => fetchTask
14413
15218
  });
14414
- function disallowedCommand2(command) {
15219
+ function disallowedCommand(command) {
14415
15220
  return /^--upload-pack(=|$)/.test(command);
14416
15221
  }
14417
15222
  function fetchTask(remote, branch, customArgs) {
@@ -14419,7 +15224,7 @@ function fetchTask(remote, branch, customArgs) {
14419
15224
  if (remote && branch) {
14420
15225
  commands.push(remote, branch);
14421
15226
  }
14422
- const banned = commands.find(disallowedCommand2);
15227
+ const banned = commands.find(disallowedCommand);
14423
15228
  if (banned) {
14424
15229
  return configurationErrorTask(`git.fetch: potential exploit argument blocked.`);
14425
15230
  }
@@ -14488,7 +15293,10 @@ function pullTask(remote, branch, customArgs) {
14488
15293
  return parsePullResult(stdOut, stdErr);
14489
15294
  },
14490
15295
  onError(result, _error, _done, fail) {
14491
- const pullError = parsePullErrorResult(bufferToString(result.stdOut), bufferToString(result.stdErr));
15296
+ const pullError = parsePullErrorResult(
15297
+ bufferToString(result.stdOut),
15298
+ bufferToString(result.stdErr)
15299
+ );
14492
15300
  if (pullError) {
14493
15301
  return fail(new GitResponseError(pullError));
14494
15302
  }
@@ -14513,7 +15321,7 @@ function parseGetRemotes(text) {
14513
15321
  function parseGetRemotesVerbose(text) {
14514
15322
  const remotes = {};
14515
15323
  forEach$1(text, ([name, url, purpose]) => {
14516
- if (!remotes.hasOwnProperty(name)) {
15324
+ if (!Object.hasOwn(remotes, name)) {
14517
15325
  remotes[name] = {
14518
15326
  name,
14519
15327
  refs: { fetch: "", push: "" }
@@ -14543,7 +15351,7 @@ __export(remote_exports, {
14543
15351
  remoteTask: () => remoteTask,
14544
15352
  removeRemoteTask: () => removeRemoteTask
14545
15353
  });
14546
- function addRemoteTask(remoteName, remoteRepo, customArgs = []) {
15354
+ function addRemoteTask(remoteName, remoteRepo, customArgs) {
14547
15355
  return straightThroughStringTask(["remote", "add", ...customArgs, remoteName, remoteRepo]);
14548
15356
  }
14549
15357
  function getRemotesTask(verbose) {
@@ -14557,14 +15365,14 @@ function getRemotesTask(verbose) {
14557
15365
  parser: verbose ? parseGetRemotesVerbose : parseGetRemotes
14558
15366
  };
14559
15367
  }
14560
- function listRemotesTask(customArgs = []) {
15368
+ function listRemotesTask(customArgs) {
14561
15369
  const commands = [...customArgs];
14562
15370
  if (commands[0] !== "ls-remote") {
14563
15371
  commands.unshift("ls-remote");
14564
15372
  }
14565
15373
  return straightThroughStringTask(commands);
14566
15374
  }
14567
- function remoteTask(customArgs = []) {
15375
+ function remoteTask(customArgs) {
14568
15376
  const commands = [...customArgs];
14569
15377
  if (commands[0] !== "remote") {
14570
15378
  commands.unshift("remote");
@@ -14589,11 +15397,15 @@ __export(stash_list_exports, {
14589
15397
  function stashListTask(opt = {}, customArgs) {
14590
15398
  const options = parseLogOptions(opt);
14591
15399
  const commands = ["stash", "list", ...options.commands, ...customArgs];
14592
- const parser3 = createListLogSummaryParser(options.splitter, options.fields, logFormatFromCommand(commands));
15400
+ const parser4 = createListLogSummaryParser(
15401
+ options.splitter,
15402
+ options.fields,
15403
+ logFormatFromCommand(commands)
15404
+ );
14593
15405
  return validateLogFormatConfig(commands) || {
14594
15406
  commands,
14595
15407
  format: "utf-8",
14596
- parser: parser3
15408
+ parser: parser4
14597
15409
  };
14598
15410
  }
14599
15411
  var init_stash_list = __esm({
@@ -14637,8 +15449,8 @@ var init_sub_module = __esm({
14637
15449
 
14638
15450
  // src/lib/responses/TagList.ts
14639
15451
  function singleSorted(a, b) {
14640
- const aIsNum = isNaN(a);
14641
- const bIsNum = isNaN(b);
15452
+ const aIsNum = Number.isNaN(a);
15453
+ const bIsNum = Number.isNaN(b);
14642
15454
  if (aIsNum !== bIsNum) {
14643
15455
  return aIsNum ? 1 : -1;
14644
15456
  }
@@ -14736,7 +15548,7 @@ var require_git = __commonJS({
14736
15548
  var { GitExecutor: GitExecutor2 } = (init_git_executor(), __toCommonJS(git_executor_exports));
14737
15549
  var { SimpleGitApi: SimpleGitApi2 } = (init_simple_git_api(), __toCommonJS(simple_git_api_exports));
14738
15550
  var { Scheduler: Scheduler2 } = (init_scheduler(), __toCommonJS(scheduler_exports));
14739
- var { configurationErrorTask: configurationErrorTask2 } = (init_task(), __toCommonJS(task_exports));
15551
+ var { adhocExecTask: adhocExecTask2, configurationErrorTask: configurationErrorTask2 } = (init_task(), __toCommonJS(task_exports));
14740
15552
  var {
14741
15553
  asArray: asArray2,
14742
15554
  filterArray: filterArray2,
@@ -14757,7 +15569,6 @@ var require_git = __commonJS({
14757
15569
  } = (init_branch(), __toCommonJS(branch_exports));
14758
15570
  var { checkIgnoreTask: checkIgnoreTask2 } = (init_check_ignore(), __toCommonJS(check_ignore_exports));
14759
15571
  var { checkIsRepoTask: checkIsRepoTask2 } = (init_check_is_repo(), __toCommonJS(check_is_repo_exports));
14760
- var { cloneTask: cloneTask2, cloneMirrorTask: cloneMirrorTask2 } = (init_clone(), __toCommonJS(clone_exports));
14761
15572
  var { cleanWithOptionsTask: cleanWithOptionsTask2, isCleanOptionsArray: isCleanOptionsArray2 } = (init_clean(), __toCommonJS(clean_exports));
14762
15573
  var { diffSummaryTask: diffSummaryTask2 } = (init_diff(), __toCommonJS(diff_exports));
14763
15574
  var { fetchTask: fetchTask2 } = (init_fetch(), __toCommonJS(fetch_exports));
@@ -14782,12 +15593,17 @@ var require_git = __commonJS({
14782
15593
  var { addAnnotatedTagTask: addAnnotatedTagTask2, addTagTask: addTagTask2, tagListTask: tagListTask2 } = (init_tag(), __toCommonJS(tag_exports));
14783
15594
  var { straightThroughBufferTask: straightThroughBufferTask2, straightThroughStringTask: straightThroughStringTask2 } = (init_task(), __toCommonJS(task_exports));
14784
15595
  function Git2(options, plugins) {
14785
- this._executor = new GitExecutor2(options.binary, options.baseDir, new Scheduler2(options.maxConcurrentProcesses), plugins);
15596
+ this._plugins = plugins;
15597
+ this._executor = new GitExecutor2(
15598
+ options.baseDir,
15599
+ new Scheduler2(options.maxConcurrentProcesses),
15600
+ plugins
15601
+ );
14786
15602
  this._trimmed = options.trimmed;
14787
15603
  }
14788
15604
  (Git2.prototype = Object.create(SimpleGitApi2.prototype)).constructor = Git2;
14789
15605
  Git2.prototype.customBinary = function(command) {
14790
- this._executor.binary = command;
15606
+ this._plugins.reconfigure("binary", command);
14791
15607
  return this;
14792
15608
  };
14793
15609
  Git2.prototype.env = function(name, value) {
@@ -14799,19 +15615,13 @@ var require_git = __commonJS({
14799
15615
  return this;
14800
15616
  };
14801
15617
  Git2.prototype.stashList = function(options) {
14802
- return this._runTask(stashListTask2(trailingOptionsArgument2(arguments) || {}, filterArray2(options) && options || []), trailingFunctionArgument2(arguments));
14803
- };
14804
- function createCloneTask(api, task, repoPath, localPath) {
14805
- if (typeof repoPath !== "string") {
14806
- return configurationErrorTask2(`git.${api}() requires a string 'repoPath'`);
14807
- }
14808
- return task(repoPath, filterType2(localPath, filterString2), getTrailingOptions2(arguments));
14809
- }
14810
- Git2.prototype.clone = function() {
14811
- return this._runTask(createCloneTask("clone", cloneTask2, ...arguments), trailingFunctionArgument2(arguments));
14812
- };
14813
- Git2.prototype.mirror = function() {
14814
- return this._runTask(createCloneTask("mirror", cloneMirrorTask2, ...arguments), trailingFunctionArgument2(arguments));
15618
+ return this._runTask(
15619
+ stashListTask2(
15620
+ trailingOptionsArgument2(arguments) || {},
15621
+ filterArray2(options) && options || []
15622
+ ),
15623
+ trailingFunctionArgument2(arguments)
15624
+ );
14815
15625
  };
14816
15626
  Git2.prototype.mv = function(from, to) {
14817
15627
  return this._runTask(moveTask2(from, to), trailingFunctionArgument2(arguments));
@@ -14825,46 +15635,89 @@ var require_git = __commonJS({
14825
15635
  });
14826
15636
  };
14827
15637
  Git2.prototype.pull = function(remote, branch, options, then) {
14828
- return this._runTask(pullTask2(filterType2(remote, filterString2), filterType2(branch, filterString2), getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));
15638
+ return this._runTask(
15639
+ pullTask2(
15640
+ filterType2(remote, filterString2),
15641
+ filterType2(branch, filterString2),
15642
+ getTrailingOptions2(arguments)
15643
+ ),
15644
+ trailingFunctionArgument2(arguments)
15645
+ );
14829
15646
  };
14830
15647
  Git2.prototype.fetch = function(remote, branch) {
14831
- return this._runTask(fetchTask2(filterType2(remote, filterString2), filterType2(branch, filterString2), getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));
15648
+ return this._runTask(
15649
+ fetchTask2(
15650
+ filterType2(remote, filterString2),
15651
+ filterType2(branch, filterString2),
15652
+ getTrailingOptions2(arguments)
15653
+ ),
15654
+ trailingFunctionArgument2(arguments)
15655
+ );
14832
15656
  };
14833
15657
  Git2.prototype.silent = function(silence) {
14834
- 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");
14835
- return this;
15658
+ return this._runTask(
15659
+ adhocExecTask2(
15660
+ () => console.warn(
15661
+ "simple-git deprecation notice: git.silent: logging should be configured using the `debug` library / `DEBUG` environment variable, this method will be removed."
15662
+ )
15663
+ )
15664
+ );
14836
15665
  };
14837
15666
  Git2.prototype.tags = function(options, then) {
14838
- return this._runTask(tagListTask2(getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));
15667
+ return this._runTask(
15668
+ tagListTask2(getTrailingOptions2(arguments)),
15669
+ trailingFunctionArgument2(arguments)
15670
+ );
14839
15671
  };
14840
15672
  Git2.prototype.rebase = function() {
14841
- return this._runTask(straightThroughStringTask2(["rebase", ...getTrailingOptions2(arguments)]), trailingFunctionArgument2(arguments));
15673
+ return this._runTask(
15674
+ straightThroughStringTask2(["rebase", ...getTrailingOptions2(arguments)]),
15675
+ trailingFunctionArgument2(arguments)
15676
+ );
14842
15677
  };
14843
15678
  Git2.prototype.reset = function(mode) {
14844
- return this._runTask(resetTask2(getResetMode2(mode), getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));
15679
+ return this._runTask(
15680
+ resetTask2(getResetMode2(mode), getTrailingOptions2(arguments)),
15681
+ trailingFunctionArgument2(arguments)
15682
+ );
14845
15683
  };
14846
15684
  Git2.prototype.revert = function(commit) {
14847
15685
  const next = trailingFunctionArgument2(arguments);
14848
15686
  if (typeof commit !== "string") {
14849
15687
  return this._runTask(configurationErrorTask2("Commit must be a string"), next);
14850
15688
  }
14851
- return this._runTask(straightThroughStringTask2(["revert", ...getTrailingOptions2(arguments, 0, true), commit]), next);
15689
+ return this._runTask(
15690
+ straightThroughStringTask2(["revert", ...getTrailingOptions2(arguments, 0, true), commit]),
15691
+ next
15692
+ );
14852
15693
  };
14853
15694
  Git2.prototype.addTag = function(name) {
14854
15695
  const task = typeof name === "string" ? addTagTask2(name) : configurationErrorTask2("Git.addTag requires a tag name");
14855
15696
  return this._runTask(task, trailingFunctionArgument2(arguments));
14856
15697
  };
14857
15698
  Git2.prototype.addAnnotatedTag = function(tagName, tagMessage) {
14858
- return this._runTask(addAnnotatedTagTask2(tagName, tagMessage), trailingFunctionArgument2(arguments));
15699
+ return this._runTask(
15700
+ addAnnotatedTagTask2(tagName, tagMessage),
15701
+ trailingFunctionArgument2(arguments)
15702
+ );
14859
15703
  };
14860
15704
  Git2.prototype.deleteLocalBranch = function(branchName, forceDelete, then) {
14861
- return this._runTask(deleteBranchTask2(branchName, typeof forceDelete === "boolean" ? forceDelete : false), trailingFunctionArgument2(arguments));
15705
+ return this._runTask(
15706
+ deleteBranchTask2(branchName, typeof forceDelete === "boolean" ? forceDelete : false),
15707
+ trailingFunctionArgument2(arguments)
15708
+ );
14862
15709
  };
14863
15710
  Git2.prototype.deleteLocalBranches = function(branchNames, forceDelete, then) {
14864
- return this._runTask(deleteBranchesTask2(branchNames, typeof forceDelete === "boolean" ? forceDelete : false), trailingFunctionArgument2(arguments));
15711
+ return this._runTask(
15712
+ deleteBranchesTask2(branchNames, typeof forceDelete === "boolean" ? forceDelete : false),
15713
+ trailingFunctionArgument2(arguments)
15714
+ );
14865
15715
  };
14866
15716
  Git2.prototype.branch = function(options, then) {
14867
- return this._runTask(branchTask2(getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));
15717
+ return this._runTask(
15718
+ branchTask2(getTrailingOptions2(arguments)),
15719
+ trailingFunctionArgument2(arguments)
15720
+ );
14868
15721
  };
14869
15722
  Git2.prototype.branchLocal = function(then) {
14870
15723
  return this._runTask(branchLocalTask2(), trailingFunctionArgument2(arguments));
@@ -14881,7 +15734,10 @@ var require_git = __commonJS({
14881
15734
  command.push(...getTrailingOptions2(arguments, 0, true));
14882
15735
  var next = trailingFunctionArgument2(arguments);
14883
15736
  if (!command.length) {
14884
- return this._runTask(configurationErrorTask2("Raw: must supply one or more command to execute"), next);
15737
+ return this._runTask(
15738
+ configurationErrorTask2("Raw: must supply one or more command to execute"),
15739
+ next
15740
+ );
14885
15741
  }
14886
15742
  return this._runTask(straightThroughStringTask2(command, this._trimmed), next);
14887
15743
  };
@@ -14889,19 +15745,34 @@ var require_git = __commonJS({
14889
15745
  return this._runTask(addSubModuleTask2(repo, path), trailingFunctionArgument2(arguments));
14890
15746
  };
14891
15747
  Git2.prototype.submoduleUpdate = function(args, then) {
14892
- return this._runTask(updateSubModuleTask2(getTrailingOptions2(arguments, true)), trailingFunctionArgument2(arguments));
15748
+ return this._runTask(
15749
+ updateSubModuleTask2(getTrailingOptions2(arguments, true)),
15750
+ trailingFunctionArgument2(arguments)
15751
+ );
14893
15752
  };
14894
15753
  Git2.prototype.submoduleInit = function(args, then) {
14895
- return this._runTask(initSubModuleTask2(getTrailingOptions2(arguments, true)), trailingFunctionArgument2(arguments));
15754
+ return this._runTask(
15755
+ initSubModuleTask2(getTrailingOptions2(arguments, true)),
15756
+ trailingFunctionArgument2(arguments)
15757
+ );
14896
15758
  };
14897
15759
  Git2.prototype.subModule = function(options, then) {
14898
- return this._runTask(subModuleTask2(getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));
15760
+ return this._runTask(
15761
+ subModuleTask2(getTrailingOptions2(arguments)),
15762
+ trailingFunctionArgument2(arguments)
15763
+ );
14899
15764
  };
14900
15765
  Git2.prototype.listRemote = function() {
14901
- return this._runTask(listRemotesTask2(getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));
15766
+ return this._runTask(
15767
+ listRemotesTask2(getTrailingOptions2(arguments)),
15768
+ trailingFunctionArgument2(arguments)
15769
+ );
14902
15770
  };
14903
15771
  Git2.prototype.addRemote = function(remoteName, remoteRepo, then) {
14904
- return this._runTask(addRemoteTask2(remoteName, remoteRepo, getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));
15772
+ return this._runTask(
15773
+ addRemoteTask2(remoteName, remoteRepo, getTrailingOptions2(arguments)),
15774
+ trailingFunctionArgument2(arguments)
15775
+ );
14905
15776
  };
14906
15777
  Git2.prototype.removeRemote = function(remoteName, then) {
14907
15778
  return this._runTask(removeRemoteTask2(remoteName), trailingFunctionArgument2(arguments));
@@ -14910,7 +15781,10 @@ var require_git = __commonJS({
14910
15781
  return this._runTask(getRemotesTask2(verbose === true), trailingFunctionArgument2(arguments));
14911
15782
  };
14912
15783
  Git2.prototype.remote = function(options, then) {
14913
- return this._runTask(remoteTask2(getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments));
15784
+ return this._runTask(
15785
+ remoteTask2(getTrailingOptions2(arguments)),
15786
+ trailingFunctionArgument2(arguments)
15787
+ );
14914
15788
  };
14915
15789
  Git2.prototype.tag = function(options, then) {
14916
15790
  const command = getTrailingOptions2(arguments);
@@ -14920,17 +15794,29 @@ var require_git = __commonJS({
14920
15794
  return this._runTask(straightThroughStringTask2(command), trailingFunctionArgument2(arguments));
14921
15795
  };
14922
15796
  Git2.prototype.updateServerInfo = function(then) {
14923
- return this._runTask(straightThroughStringTask2(["update-server-info"]), trailingFunctionArgument2(arguments));
15797
+ return this._runTask(
15798
+ straightThroughStringTask2(["update-server-info"]),
15799
+ trailingFunctionArgument2(arguments)
15800
+ );
14924
15801
  };
14925
15802
  Git2.prototype.pushTags = function(remote, then) {
14926
- const task = pushTagsTask2({ remote: filterType2(remote, filterString2) }, getTrailingOptions2(arguments));
15803
+ const task = pushTagsTask2(
15804
+ { remote: filterType2(remote, filterString2) },
15805
+ getTrailingOptions2(arguments)
15806
+ );
14927
15807
  return this._runTask(task, trailingFunctionArgument2(arguments));
14928
15808
  };
14929
15809
  Git2.prototype.rm = function(files) {
14930
- return this._runTask(straightThroughStringTask2(["rm", "-f", ...asArray2(files)]), trailingFunctionArgument2(arguments));
15810
+ return this._runTask(
15811
+ straightThroughStringTask2(["rm", "-f", ...asArray2(files)]),
15812
+ trailingFunctionArgument2(arguments)
15813
+ );
14931
15814
  };
14932
15815
  Git2.prototype.rmKeepLocal = function(files) {
14933
- return this._runTask(straightThroughStringTask2(["rm", "--cached", ...asArray2(files)]), trailingFunctionArgument2(arguments));
15816
+ return this._runTask(
15817
+ straightThroughStringTask2(["rm", "--cached", ...asArray2(files)]),
15818
+ trailingFunctionArgument2(arguments)
15819
+ );
14934
15820
  };
14935
15821
  Git2.prototype.catFile = function(options, then) {
14936
15822
  return this._catFile("utf-8", arguments);
@@ -14943,7 +15829,10 @@ var require_git = __commonJS({
14943
15829
  var command = ["cat-file"];
14944
15830
  var options = args[0];
14945
15831
  if (typeof options === "string") {
14946
- return this._runTask(configurationErrorTask2("Git.catFile: options must be supplied as an array of strings"), handler);
15832
+ return this._runTask(
15833
+ configurationErrorTask2("Git.catFile: options must be supplied as an array of strings"),
15834
+ handler
15835
+ );
14947
15836
  }
14948
15837
  if (Array.isArray(options)) {
14949
15838
  command.push.apply(command, options);
@@ -14952,25 +15841,38 @@ var require_git = __commonJS({
14952
15841
  return this._runTask(task, handler);
14953
15842
  };
14954
15843
  Git2.prototype.diff = function(options, then) {
14955
- const task = filterString2(options) ? configurationErrorTask2("git.diff: supplying options as a single string is no longer supported, switch to an array of strings") : straightThroughStringTask2(["diff", ...getTrailingOptions2(arguments)]);
15844
+ const task = filterString2(options) ? configurationErrorTask2(
15845
+ "git.diff: supplying options as a single string is no longer supported, switch to an array of strings"
15846
+ ) : straightThroughStringTask2(["diff", ...getTrailingOptions2(arguments)]);
14956
15847
  return this._runTask(task, trailingFunctionArgument2(arguments));
14957
15848
  };
14958
15849
  Git2.prototype.diffSummary = function() {
14959
- return this._runTask(diffSummaryTask2(getTrailingOptions2(arguments, 1)), trailingFunctionArgument2(arguments));
15850
+ return this._runTask(
15851
+ diffSummaryTask2(getTrailingOptions2(arguments, 1)),
15852
+ trailingFunctionArgument2(arguments)
15853
+ );
14960
15854
  };
14961
15855
  Git2.prototype.applyPatch = function(patches) {
14962
- const task = !filterStringOrStringArray2(patches) ? configurationErrorTask2(`git.applyPatch requires one or more string patches as the first argument`) : applyPatchTask2(asArray2(patches), getTrailingOptions2([].slice.call(arguments, 1)));
15856
+ const task = !filterStringOrStringArray2(patches) ? configurationErrorTask2(
15857
+ `git.applyPatch requires one or more string patches as the first argument`
15858
+ ) : applyPatchTask2(asArray2(patches), getTrailingOptions2([].slice.call(arguments, 1)));
14963
15859
  return this._runTask(task, trailingFunctionArgument2(arguments));
14964
15860
  };
14965
15861
  Git2.prototype.revparse = function() {
14966
15862
  const commands = ["rev-parse", ...getTrailingOptions2(arguments, true)];
14967
- return this._runTask(straightThroughStringTask2(commands, true), trailingFunctionArgument2(arguments));
15863
+ return this._runTask(
15864
+ straightThroughStringTask2(commands, true),
15865
+ trailingFunctionArgument2(arguments)
15866
+ );
14968
15867
  };
14969
15868
  Git2.prototype.clean = function(mode, options, then) {
14970
15869
  const usingCleanOptionsArray = isCleanOptionsArray2(mode);
14971
15870
  const cleanMode = usingCleanOptionsArray && mode.join("") || filterType2(mode, filterString2) || "";
14972
15871
  const customArgs = getTrailingOptions2([].slice.call(arguments, usingCleanOptionsArray ? 1 : 0));
14973
- return this._runTask(cleanWithOptionsTask2(cleanMode, customArgs), trailingFunctionArgument2(arguments));
15872
+ return this._runTask(
15873
+ cleanWithOptionsTask2(cleanMode, customArgs),
15874
+ trailingFunctionArgument2(arguments)
15875
+ );
14974
15876
  };
14975
15877
  Git2.prototype.exec = function(then) {
14976
15878
  const task = {
@@ -14985,21 +15887,30 @@ var require_git = __commonJS({
14985
15887
  return this._runTask(task);
14986
15888
  };
14987
15889
  Git2.prototype.clearQueue = function() {
14988
- return this;
15890
+ return this._runTask(
15891
+ adhocExecTask2(
15892
+ () => console.warn(
15893
+ "simple-git deprecation notice: clearQueue() is deprecated and will be removed, switch to using the abortPlugin instead."
15894
+ )
15895
+ )
15896
+ );
14989
15897
  };
14990
15898
  Git2.prototype.checkIgnore = function(pathnames, then) {
14991
- return this._runTask(checkIgnoreTask2(asArray2(filterType2(pathnames, filterStringOrStringArray2, []))), trailingFunctionArgument2(arguments));
15899
+ return this._runTask(
15900
+ checkIgnoreTask2(asArray2(filterType2(pathnames, filterStringOrStringArray2, []))),
15901
+ trailingFunctionArgument2(arguments)
15902
+ );
14992
15903
  };
14993
15904
  Git2.prototype.checkIsRepo = function(checkType, then) {
14994
- return this._runTask(checkIsRepoTask2(filterType2(checkType, filterString2)), trailingFunctionArgument2(arguments));
15905
+ return this._runTask(
15906
+ checkIsRepoTask2(filterType2(checkType, filterString2)),
15907
+ trailingFunctionArgument2(arguments)
15908
+ );
14995
15909
  };
14996
15910
  module.exports = Git2;
14997
15911
  }
14998
15912
  });
14999
15913
 
15000
- // src/lib/api.ts
15001
- init_pathspec();
15002
-
15003
15914
  // src/lib/errors/git-construct-error.ts
15004
15915
  init_git_error();
15005
15916
  var GitConstructError = class extends GitError {
@@ -15058,43 +15969,15 @@ function abortPlugin(signal) {
15058
15969
  };
15059
15970
  return [onSpawnBefore, onSpawnAfter];
15060
15971
  }
15061
-
15062
- // src/lib/plugins/block-unsafe-operations-plugin.ts
15063
- function isConfigSwitch(arg) {
15064
- return typeof arg === "string" && arg.trim().toLowerCase() === "-c";
15065
- }
15066
- function preventProtocolOverride(arg, next) {
15067
- if (!isConfigSwitch(arg)) {
15068
- return;
15069
- }
15070
- if (!/^\s*protocol(.[a-z]+)?.allow/.test(next)) {
15071
- return;
15072
- }
15073
- throw new GitPluginError(void 0, "unsafe", "Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol");
15074
- }
15075
- function preventUploadPack(arg, method) {
15076
- if (/^\s*--(upload|receive)-pack/.test(arg)) {
15077
- throw new GitPluginError(void 0, "unsafe", `Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack`);
15078
- }
15079
- if (method === "clone" && /^\s*-u\b/.test(arg)) {
15080
- throw new GitPluginError(void 0, "unsafe", `Use of clone with option -u is not permitted without enabling allowUnsafePack`);
15081
- }
15082
- if (method === "push" && /^\s*--exec\b/.test(arg)) {
15083
- throw new GitPluginError(void 0, "unsafe", `Use of push with option --exec is not permitted without enabling allowUnsafePack`);
15084
- }
15085
- }
15086
- function blockUnsafeOperationsPlugin({
15087
- allowUnsafeProtocolOverride = false,
15088
- allowUnsafePack = false
15089
- } = {}) {
15972
+ function blockUnsafeOperationsPlugin(options = {}) {
15090
15973
  return {
15091
15974
  type: "spawn.args",
15092
- action(args, context) {
15093
- args.forEach((current, index) => {
15094
- const next = index < args.length ? args[index + 1] : "";
15095
- allowUnsafeProtocolOverride || preventProtocolOverride(current, next);
15096
- allowUnsafePack || preventUploadPack(current, context.method);
15097
- });
15975
+ action(args, { env }) {
15976
+ for (const vulnerability of ne(args, env)) {
15977
+ if (options[vulnerability.category] !== true) {
15978
+ throw new GitPluginError(void 0, "unsafe", vulnerability.message);
15979
+ }
15980
+ }
15098
15981
  return args;
15099
15982
  }
15100
15983
  };
@@ -15156,31 +16039,66 @@ function completionDetectionPlugin({
15156
16039
  }
15157
16040
  return {
15158
16041
  type: "spawn.after",
15159
- action(_0, _1) {
15160
- return __async(this, arguments, function* (_data, { spawned, close }) {
15161
- var _a2, _b;
15162
- const events = createEvents();
15163
- let deferClose = true;
15164
- let quickClose = () => void (deferClose = false);
15165
- (_a2 = spawned.stdout) == null ? void 0 : _a2.on("data", quickClose);
15166
- (_b = spawned.stderr) == null ? void 0 : _b.on("data", quickClose);
15167
- spawned.on("error", quickClose);
15168
- spawned.on("close", (code) => events.close(code));
15169
- spawned.on("exit", (code) => events.exit(code));
15170
- try {
15171
- yield events.result;
15172
- if (deferClose) {
15173
- yield delay(50);
15174
- }
15175
- close(events.exitCode);
15176
- } catch (err) {
15177
- close(events.exitCode, err);
16042
+ async action(_data, { spawned, close }) {
16043
+ const events = createEvents();
16044
+ let deferClose = true;
16045
+ let quickClose = () => void (deferClose = false);
16046
+ spawned.stdout?.on("data", quickClose);
16047
+ spawned.stderr?.on("data", quickClose);
16048
+ spawned.on("error", quickClose);
16049
+ spawned.on("close", (code) => events.close(code));
16050
+ spawned.on("exit", (code) => events.exit(code));
16051
+ try {
16052
+ await events.result;
16053
+ if (deferClose) {
16054
+ await delay(50);
15178
16055
  }
15179
- });
16056
+ close(events.exitCode);
16057
+ } catch (err) {
16058
+ close(events.exitCode, err);
16059
+ }
15180
16060
  }
15181
16061
  };
15182
16062
  }
15183
16063
 
16064
+ // src/lib/plugins/custom-binary.plugin.ts
16065
+ init_utils();
16066
+ var WRONG_NUMBER_ERR = `Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings`;
16067
+ var WRONG_CHARS_ERR = `Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option`;
16068
+ function isBadArgument(arg) {
16069
+ return !arg || !/^([a-z]:)?([a-z0-9/.\\_~-]+)$/i.test(arg);
16070
+ }
16071
+ function toBinaryConfig(input, allowUnsafe) {
16072
+ if (input.length < 1 || input.length > 2) {
16073
+ throw new GitPluginError(void 0, "binary", WRONG_NUMBER_ERR);
16074
+ }
16075
+ const isBad = input.some(isBadArgument);
16076
+ if (isBad) {
16077
+ if (allowUnsafe) {
16078
+ console.warn(WRONG_CHARS_ERR);
16079
+ } else {
16080
+ throw new GitPluginError(void 0, "binary", WRONG_CHARS_ERR);
16081
+ }
16082
+ }
16083
+ const [binary, prefix] = input;
16084
+ return {
16085
+ binary,
16086
+ prefix
16087
+ };
16088
+ }
16089
+ function customBinaryPlugin(plugins, input = ["git"], allowUnsafe = false) {
16090
+ let config = toBinaryConfig(asArray(input), allowUnsafe);
16091
+ plugins.on("binary", (input2) => {
16092
+ config = toBinaryConfig(asArray(input2), allowUnsafe);
16093
+ });
16094
+ plugins.append("spawn.binary", () => {
16095
+ return config.binary;
16096
+ });
16097
+ plugins.append("spawn.args", (data) => {
16098
+ return config.prefix ? [config.prefix, ...data] : data;
16099
+ });
16100
+ }
16101
+
15184
16102
  // src/lib/plugins/error-detection.plugin.ts
15185
16103
  init_git_error();
15186
16104
  function isTaskError(result) {
@@ -15221,6 +16139,17 @@ init_utils();
15221
16139
  var PluginStore = class {
15222
16140
  constructor() {
15223
16141
  this.plugins = /* @__PURE__ */ new Set();
16142
+ this.events = new EventEmitter$1();
16143
+ }
16144
+ on(type, listener) {
16145
+ this.events.on(type, listener);
16146
+ }
16147
+ reconfigure(type, data) {
16148
+ this.events.emit(type, data);
16149
+ }
16150
+ append(type, action) {
16151
+ const plugin = append(this.plugins, { type, action });
16152
+ return () => this.plugins.delete(plugin);
15224
16153
  }
15225
16154
  add(plugin) {
15226
16155
  const plugins = [];
@@ -15249,11 +16178,10 @@ function progressMonitorPlugin(progress) {
15249
16178
  const onProgress = {
15250
16179
  type: "spawn.after",
15251
16180
  action(_data, context) {
15252
- var _a2;
15253
16181
  if (!context.commands.includes(progressCommand)) {
15254
16182
  return;
15255
16183
  }
15256
- (_a2 = context.spawned.stderr) == null ? void 0 : _a2.on("data", (chunk) => {
16184
+ context.spawned.stderr?.on("data", (chunk) => {
15257
16185
  const message = /^([\s\S]+?):\s*(\d+)% \((\d+)\/(\d+)\)/.exec(chunk.toString("utf8"));
15258
16186
  if (!message) {
15259
16187
  return;
@@ -15290,7 +16218,7 @@ function spawnOptionsPlugin(spawnOptions) {
15290
16218
  return {
15291
16219
  type: "spawn.options",
15292
16220
  action(data) {
15293
- return __spreadValues(__spreadValues({}, options), data);
16221
+ return { ...options, ...data };
15294
16222
  }
15295
16223
  };
15296
16224
  }
@@ -15305,16 +16233,14 @@ function timeoutPlugin({
15305
16233
  return {
15306
16234
  type: "spawn.after",
15307
16235
  action(_data, context) {
15308
- var _a2, _b;
15309
16236
  let timeout;
15310
16237
  function wait() {
15311
16238
  timeout && clearTimeout(timeout);
15312
16239
  timeout = setTimeout(kill, block);
15313
16240
  }
15314
16241
  function stop() {
15315
- var _a3, _b2;
15316
- (_a3 = context.spawned.stdout) == null ? void 0 : _a3.off("data", wait);
15317
- (_b2 = context.spawned.stderr) == null ? void 0 : _b2.off("data", wait);
16242
+ context.spawned.stdout?.off("data", wait);
16243
+ context.spawned.stderr?.off("data", wait);
15318
16244
  context.spawned.off("exit", stop);
15319
16245
  context.spawned.off("close", stop);
15320
16246
  timeout && clearTimeout(timeout);
@@ -15323,8 +16249,8 @@ function timeoutPlugin({
15323
16249
  stop();
15324
16250
  context.kill(new GitPluginError(void 0, "timeout", `block timeout reached`));
15325
16251
  }
15326
- stdOut && ((_a2 = context.spawned.stdout) == null ? void 0 : _a2.on("data", wait));
15327
- stdErr && ((_b = context.spawned.stderr) == null ? void 0 : _b.on("data", wait));
16252
+ stdOut && context.spawned.stdout?.on("data", wait);
16253
+ stdErr && context.spawned.stderr?.on("data", wait);
15328
16254
  context.spawned.on("exit", stop);
15329
16255
  context.spawned.on("close", stop);
15330
16256
  wait();
@@ -15332,9 +16258,6 @@ function timeoutPlugin({
15332
16258
  };
15333
16259
  }
15334
16260
  }
15335
-
15336
- // src/lib/plugins/suffix-paths.plugin.ts
15337
- init_pathspec();
15338
16261
  function suffixPathsPlugin() {
15339
16262
  return {
15340
16263
  type: "spawn.args",
@@ -15346,12 +16269,14 @@ function suffixPathsPlugin() {
15346
16269
  }
15347
16270
  for (let i = 0; i < data.length; i++) {
15348
16271
  const param = data[i];
15349
- if (isPathSpec(param)) {
15350
- append2(toPaths(param));
16272
+ if (r(param)) {
16273
+ append2(o(param));
15351
16274
  continue;
15352
16275
  }
15353
16276
  if (param === "--") {
15354
- append2(data.slice(i + 1).flatMap((item) => isPathSpec(item) && toPaths(item) || item));
16277
+ append2(
16278
+ data.slice(i + 1).flatMap((item) => r(item) && o(item) || item)
16279
+ );
15355
16280
  break;
15356
16281
  }
15357
16282
  prefix.push(param);
@@ -15366,22 +16291,29 @@ init_utils();
15366
16291
  var Git = require_git();
15367
16292
  function gitInstanceFactory(baseDir, options) {
15368
16293
  const plugins = new PluginStore();
15369
- const config = createInstanceConfig(baseDir && (typeof baseDir === "string" ? { baseDir } : baseDir) || {}, options);
16294
+ const config = createInstanceConfig(
16295
+ baseDir && (typeof baseDir === "string" ? { baseDir } : baseDir) || {},
16296
+ options
16297
+ );
15370
16298
  if (!folderExists(config.baseDir)) {
15371
- throw new GitConstructError(config, `Cannot use simple-git on a directory that does not exist`);
16299
+ throw new GitConstructError(
16300
+ config,
16301
+ `Cannot use simple-git on a directory that does not exist`
16302
+ );
15372
16303
  }
15373
16304
  if (Array.isArray(config.config)) {
15374
16305
  plugins.add(commandConfigPrefixingPlugin(config.config));
15375
16306
  }
15376
16307
  plugins.add(blockUnsafeOperationsPlugin(config.unsafe));
15377
- plugins.add(suffixPathsPlugin());
15378
16308
  plugins.add(completionDetectionPlugin(config.completion));
15379
16309
  config.abort && plugins.add(abortPlugin(config.abort));
15380
16310
  config.progress && plugins.add(progressMonitorPlugin(config.progress));
15381
16311
  config.timeout && plugins.add(timeoutPlugin(config.timeout));
15382
16312
  config.spawnOptions && plugins.add(spawnOptionsPlugin(config.spawnOptions));
16313
+ plugins.add(suffixPathsPlugin());
15383
16314
  plugins.add(errorDetectionPlugin(errorDetectionHandler(true)));
15384
16315
  config.errors && plugins.add(errorDetectionPlugin(config.errors));
16316
+ customBinaryPlugin(plugins, config.binary, config.unsafe?.allowUnsafeCustomBinary);
15385
16317
  return new Git(config, plugins);
15386
16318
  }
15387
16319
 
@@ -15890,7 +16822,7 @@ const prettier = async (debug) => {
15890
16822
  const DEPENDENCIES$4 = {};
15891
16823
 
15892
16824
  const DEV_DEPENDENCIES$4 = {
15893
- "@babel/core": "7.26.0",
16825
+ "@babel/core": "7.29.7",
15894
16826
  "@babel/eslint-parser": "7.25.9",
15895
16827
  "@babel/plugin-transform-runtime": "7.25.9",
15896
16828
  "@babel/plugin-syntax-dynamic-import": "^7.8.3",
@@ -33361,7 +34293,7 @@ var httpAdapter = isHttpAdapterSupported &&
33361
34293
  };
33362
34294
  }
33363
34295
 
33364
- const abortEmitter = new EventEmitter$1();
34296
+ const abortEmitter = new EventEmitter$2();
33365
34297
 
33366
34298
  function abort(reason) {
33367
34299
  try {