From c6781b1496e712ee87ad9b122abd13fa1db221d8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 May 2024 12:46:19 +0000 Subject: [PATCH] Bump simple-git from 3.22.0 to 3.24.0 (#25) * Bump simple-git from 3.22.0 to 3.24.0 Bumps [simple-git](https://github.com/steveukx/git-js/tree/HEAD/simple-git) from 3.22.0 to 3.24.0. - [Release notes](https://github.com/steveukx/git-js/releases) - [Changelog](https://github.com/steveukx/git-js/blob/main/simple-git/CHANGELOG.md) - [Commits](https://github.com/steveukx/git-js/commits/simple-git@3.24.0/simple-git) --- updated-dependencies: - dependency-name: simple-git dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Updating dist/ --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: AnHeuermann <38031952+AnHeuermann@users.noreply.github.com> --- dist/index.js | 1217 +++++++++++++++++++++++++++++++++------------ package-lock.json | 8 +- package.json | 2 +- 3 files changed, 910 insertions(+), 317 deletions(-) diff --git a/dist/index.js b/dist/index.js index e44098a..d20aad6 100644 --- a/dist/index.js +++ b/dist/index.js @@ -116439,6 +116439,8 @@ minimatch.Minimatch = Minimatch /***/ 79103: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { +"use strict"; + var __create = Object.create; var __defProp = Object.defineProperty; var __defProps = Object.defineProperties; @@ -116462,7 +116464,6 @@ var __spreadValues = (a, b) => { return a; }; var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); -var __markAsModule = (target) => __defProp(target, "__esModule", { value: true }); var __esm = (fn, res) => function __init() { return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; }; @@ -116473,22 +116474,19 @@ var __export = (target, all) => { for (var name in all) __defProp(target, name, { get: all[name], enumerable: true }); }; -var __reExport = (target, module2, copyDefault, desc) => { - if (module2 && typeof module2 === "object" || typeof module2 === "function") { - for (let key of __getOwnPropNames(module2)) - if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default")) - __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable }); +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); } - return target; -}; -var __toESM = (module2, isNodeMode) => { - return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2); + return to; }; -var __toCommonJS = /* @__PURE__ */ ((cache2) => { - return (module2, temp) => { - return cache2 && cache2.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache2 && cache2.set(module2, temp), temp); - }; -})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0); +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); +var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); var __async = (__this, __arguments, generator) => { return new Promise((resolve, reject) => { var fulfilled = (value) => { @@ -116514,6 +116512,7 @@ var __async = (__this, __arguments, generator) => { var GitError; var init_git_error = __esm({ "src/lib/errors/git-error.ts"() { + "use strict"; GitError = class extends Error { constructor(task, message) { super(message); @@ -116528,6 +116527,7 @@ var init_git_error = __esm({ var GitResponseError; var init_git_response_error = __esm({ "src/lib/errors/git-response-error.ts"() { + "use strict"; init_git_error(); GitResponseError = class extends GitError { constructor(git, message) { @@ -116553,6 +116553,7 @@ function toPaths(pathSpec) { var cache; var init_pathspec = __esm({ "src/lib/args/pathspec.ts"() { + "use strict"; cache = /* @__PURE__ */ new WeakMap(); } }); @@ -116561,6 +116562,7 @@ var init_pathspec = __esm({ var GitConstructError; var init_git_construct_error = __esm({ "src/lib/errors/git-construct-error.ts"() { + "use strict"; init_git_error(); GitConstructError = class extends GitError { constructor(config, message) { @@ -116575,6 +116577,7 @@ var init_git_construct_error = __esm({ var GitPluginError; var init_git_plugin_error = __esm({ "src/lib/errors/git-plugin-error.ts"() { + "use strict"; init_git_error(); GitPluginError = class extends GitError { constructor(task, plugin, message) { @@ -116591,6 +116594,7 @@ var init_git_plugin_error = __esm({ var TaskConfigurationError; var init_task_configuration_error = __esm({ "src/lib/errors/task-configuration-error.ts"() { + "use strict"; init_git_error(); TaskConfigurationError = class extends GitError { constructor(message) { @@ -116691,7 +116695,10 @@ function bufferToString(input) { return (Array.isArray(input) ? Buffer.concat(input) : input).toString("utf-8"); } function pick(source, properties) { - return Object.assign({}, ...properties.map((property) => property in source ? { [property]: source[property] } : {})); + return Object.assign( + {}, + ...properties.map((property) => property in source ? { [property]: source[property] } : {}) + ); } function delay(duration = 0) { return new Promise((done) => setTimeout(done, duration)); @@ -116705,6 +116712,7 @@ function orVoid(input) { var import_file_exists, NULL, NOOP, objectToString; var init_util = __esm({ "src/lib/utils/util.ts"() { + "use strict"; import_file_exists = __nccwpck_require__(54751); NULL = "\0"; NOOP = () => { @@ -116733,6 +116741,7 @@ function filterFunction(input) { var filterArray, filterString, filterStringArray, filterStringOrStringArray, filterHasLength; var init_argument_filters = __esm({ "src/lib/utils/argument-filters.ts"() { + "use strict"; init_util(); init_pathspec(); filterArray = (input) => { @@ -116760,6 +116769,7 @@ var init_argument_filters = __esm({ var ExitCodes; var init_exit_codes = __esm({ "src/lib/utils/exit-codes.ts"() { + "use strict"; ExitCodes = /* @__PURE__ */ ((ExitCodes2) => { ExitCodes2[ExitCodes2["SUCCESS"] = 0] = "SUCCESS"; ExitCodes2[ExitCodes2["ERROR"] = 1] = "ERROR"; @@ -116774,6 +116784,7 @@ var init_exit_codes = __esm({ var GitOutputStreams; var init_git_output_streams = __esm({ "src/lib/utils/git-output-streams.ts"() { + "use strict"; GitOutputStreams = class { constructor(stdOut, stdErr) { this.stdOut = stdOut; @@ -116790,6 +116801,7 @@ var init_git_output_streams = __esm({ var LineParser, RemoteLineParser; var init_line_parser = __esm({ "src/lib/utils/line-parser.ts"() { + "use strict"; LineParser = class { constructor(regExp, useMatches) { this.matches = []; @@ -116841,7 +116853,10 @@ var init_line_parser = __esm({ // src/lib/utils/simple-git-options.ts function createInstanceConfig(...options) { const baseDir = process.cwd(); - const config = Object.assign(__spreadValues({ baseDir }, defaultOptions), ...options.filter((o) => typeof o === "object" && o)); + const config = Object.assign( + __spreadValues({ baseDir }, defaultOptions), + ...options.filter((o) => typeof o === "object" && o) + ); config.baseDir = config.baseDir || baseDir; config.trimmed = config.trimmed === true; return config; @@ -116849,6 +116864,7 @@ function createInstanceConfig(...options) { var defaultOptions; var init_simple_git_options = __esm({ "src/lib/utils/simple-git-options.ts"() { + "use strict"; defaultOptions = { binary: "git", maxConcurrentProcesses: 5, @@ -116902,6 +116918,7 @@ function trailingFunctionArgument(args, includeNoop = true) { } var init_task_options = __esm({ "src/lib/utils/task-options.ts"() { + "use strict"; init_argument_filters(); init_util(); init_pathspec(); @@ -116928,6 +116945,7 @@ function parseStringResponse(result, parsers12, texts, trim = true) { } var init_task_parser = __esm({ "src/lib/utils/task-parser.ts"() { + "use strict"; init_util(); } }); @@ -116980,6 +116998,7 @@ __export(utils_exports, { }); var init_utils = __esm({ "src/lib/utils/index.ts"() { + "use strict"; init_argument_filters(); init_exit_codes(); init_git_output_streams(); @@ -117040,6 +117059,7 @@ function isNotRepoMessage(error) { var CheckRepoActions, onError, parser; var init_check_is_repo = __esm({ "src/lib/tasks/check-is-repo.ts"() { + "use strict"; init_utils(); CheckRepoActions = /* @__PURE__ */ ((CheckRepoActions2) => { CheckRepoActions2["BARE"] = "bare"; @@ -117073,6 +117093,7 @@ function cleanSummaryParser(dryRun, text) { var CleanResponse, removalRegexp, dryRunRemovalRegexp, isFolderRegexp; var init_CleanSummary = __esm({ "src/lib/responses/CleanSummary.ts"() { + "use strict"; init_utils(); CleanResponse = class { constructor(dryRun) { @@ -117142,6 +117163,7 @@ function isEmptyTask(task) { var EMPTY_COMMANDS; var init_task = __esm({ "src/lib/tasks/task.ts"() { + "use strict"; init_task_configuration_error(); EMPTY_COMMANDS = []; } @@ -117218,6 +117240,7 @@ function isInteractiveMode(option) { var CONFIG_ERROR_INTERACTIVE_MODE, CONFIG_ERROR_MODE_REQUIRED, CONFIG_ERROR_UNKNOWN_OPTION, CleanOptions, CleanOptionValues; var init_clean = __esm({ "src/lib/tasks/clean.ts"() { + "use strict"; init_CleanSummary(); init_utils(); init_task(); @@ -117291,6 +117314,7 @@ function* configParser(text, requestedKey = null) { var ConfigList; var init_ConfigList = __esm({ "src/lib/responses/ConfigList.ts"() { + "use strict"; init_utils(); ConfigList = class { constructor() { @@ -117378,19 +117402,34 @@ function listConfigTask(scope) { function config_default() { return { addConfig(key, value, ...rest) { - return this._runTask(addConfigTask(key, value, rest[0] === true, asConfigScope(rest[1], "local" /* local */)), trailingFunctionArgument(arguments)); + return this._runTask( + addConfigTask( + key, + value, + rest[0] === true, + asConfigScope(rest[1], "local" /* local */) + ), + trailingFunctionArgument(arguments) + ); }, getConfig(key, scope) { - return this._runTask(getConfigTask(key, asConfigScope(scope, void 0)), trailingFunctionArgument(arguments)); + return this._runTask( + getConfigTask(key, asConfigScope(scope, void 0)), + trailingFunctionArgument(arguments) + ); }, listConfig(...rest) { - return this._runTask(listConfigTask(asConfigScope(rest[0], void 0)), trailingFunctionArgument(arguments)); + return this._runTask( + listConfigTask(asConfigScope(rest[0], void 0)), + trailingFunctionArgument(arguments) + ); } }; } var GitConfigScope; var init_config = __esm({ "src/lib/tasks/config.ts"() { + "use strict"; init_ConfigList(); init_utils(); GitConfigScope = /* @__PURE__ */ ((GitConfigScope2) => { @@ -117410,6 +117449,7 @@ function isDiffNameStatus(input) { var DiffNameStatus, diffNameStatus; var init_diff_name_status = __esm({ "src/lib/tasks/diff-name-status.ts"() { + "use strict"; DiffNameStatus = /* @__PURE__ */ ((DiffNameStatus2) => { DiffNameStatus2["ADDED"] = "A"; DiffNameStatus2["COPIED"] = "C"; @@ -117454,26 +117494,33 @@ function grep_default() { const options = getTrailingOptions(arguments); for (const option of disallowedOptions) { if (options.includes(option)) { - return this._runTask(configurationErrorTask(`git.grep: use of "${option}" is not supported.`), then); + return this._runTask( + configurationErrorTask(`git.grep: use of "${option}" is not supported.`), + then + ); } } if (typeof searchTerm === "string") { searchTerm = grepQueryBuilder().param(searchTerm); } const commands = ["grep", "--null", "-n", "--full-name", ...options, ...searchTerm]; - return this._runTask({ - commands, - format: "utf-8", - parser(stdOut) { - return parseGrep(stdOut); - } - }, then); + return this._runTask( + { + commands, + format: "utf-8", + parser(stdOut) { + return parseGrep(stdOut); + } + }, + then + ); } }; } var disallowedOptions, Query, _a, GrepQuery; var init_grep = __esm({ "src/lib/tasks/grep.ts"() { + "use strict"; init_utils(); init_task(); disallowedOptions = ["-h"]; @@ -117531,6 +117578,7 @@ function isValidResetMode(mode) { var ResetMode, ResetModes; var init_reset = __esm({ "src/lib/tasks/reset.ts"() { + "use strict"; init_task(); ResetMode = /* @__PURE__ */ ((ResetMode2) => { ResetMode2["MIXED"] = "mixed"; @@ -117562,6 +117610,7 @@ __export(api_exports, { }); var init_api = __esm({ "src/lib/api.ts"() { + "use strict"; init_pathspec(); init_git_construct_error(); init_git_error(); @@ -117604,6 +117653,7 @@ function abortPlugin(signal) { } var init_abort_plugin = __esm({ "src/lib/plugins/abort-plugin.ts"() { + "use strict"; init_git_plugin_error(); } }); @@ -117619,17 +117669,33 @@ function preventProtocolOverride(arg, next) { if (!/^\s*protocol(.[a-z]+)?.allow/.test(next)) { return; } - throw new GitPluginError(void 0, "unsafe", "Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol"); + throw new GitPluginError( + void 0, + "unsafe", + "Configuring protocol.allow is not permitted without enabling allowUnsafeExtProtocol" + ); } function preventUploadPack(arg, method) { if (/^\s*--(upload|receive)-pack/.test(arg)) { - throw new GitPluginError(void 0, "unsafe", `Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack`); + throw new GitPluginError( + void 0, + "unsafe", + `Use of --upload-pack or --receive-pack is not permitted without enabling allowUnsafePack` + ); } if (method === "clone" && /^\s*-u\b/.test(arg)) { - throw new GitPluginError(void 0, "unsafe", `Use of clone with option -u is not permitted without enabling allowUnsafePack`); + throw new GitPluginError( + void 0, + "unsafe", + `Use of clone with option -u is not permitted without enabling allowUnsafePack` + ); } if (method === "push" && /^\s*--exec\b/.test(arg)) { - throw new GitPluginError(void 0, "unsafe", `Use of push with option --exec is not permitted without enabling allowUnsafePack`); + throw new GitPluginError( + void 0, + "unsafe", + `Use of push with option --exec is not permitted without enabling allowUnsafePack` + ); } } function blockUnsafeOperationsPlugin({ @@ -117650,6 +117716,7 @@ function blockUnsafeOperationsPlugin({ } var init_block_unsafe_operations_plugin = __esm({ "src/lib/plugins/block-unsafe-operations-plugin.ts"() { + "use strict"; init_git_plugin_error(); } }); @@ -117666,6 +117733,7 @@ function commandConfigPrefixingPlugin(configuration) { } var init_command_config_prefixing_plugin = __esm({ "src/lib/plugins/command-config-prefixing-plugin.ts"() { + "use strict"; init_utils(); } }); @@ -117714,11 +117782,11 @@ function completionDetectionPlugin({ type: "spawn.after", action(_0, _1) { return __async(this, arguments, function* (_data, { spawned, close }) { - var _a2, _b; + var _a3, _b; const events = createEvents(); let deferClose = true; let quickClose = () => void (deferClose = false); - (_a2 = spawned.stdout) == null ? void 0 : _a2.on("data", quickClose); + (_a3 = spawned.stdout) == null ? void 0 : _a3.on("data", quickClose); (_b = spawned.stderr) == null ? void 0 : _b.on("data", quickClose); spawned.on("error", quickClose); spawned.on("close", (code) => events.close(code)); @@ -117739,12 +117807,58 @@ function completionDetectionPlugin({ var import_promise_deferred, never; var init_completion_detection_plugin = __esm({ "src/lib/plugins/completion-detection.plugin.ts"() { + "use strict"; import_promise_deferred = __nccwpck_require__(49819); init_utils(); never = (0, import_promise_deferred.deferred)().promise; } }); +// src/lib/plugins/custom-binary.plugin.ts +function isBadArgument(arg) { + return !arg || !/^([a-z]:)?([a-z0-9/.\\_-]+)$/i.test(arg); +} +function toBinaryConfig(input, allowUnsafe) { + if (input.length < 1 || input.length > 2) { + throw new GitPluginError(void 0, "binary", WRONG_NUMBER_ERR); + } + const isBad = input.some(isBadArgument); + if (isBad) { + if (allowUnsafe) { + console.warn(WRONG_CHARS_ERR); + } else { + throw new GitPluginError(void 0, "binary", WRONG_CHARS_ERR); + } + } + const [binary, prefix] = input; + return { + binary, + prefix + }; +} +function customBinaryPlugin(plugins, input = ["git"], allowUnsafe = false) { + let config = toBinaryConfig(asArray(input), allowUnsafe); + plugins.on("binary", (input2) => { + config = toBinaryConfig(asArray(input2), allowUnsafe); + }); + plugins.append("spawn.binary", () => { + return config.binary; + }); + plugins.append("spawn.args", (data) => { + return config.prefix ? [config.prefix, ...data] : data; + }); +} +var WRONG_NUMBER_ERR, WRONG_CHARS_ERR; +var init_custom_binary_plugin = __esm({ + "src/lib/plugins/custom-binary.plugin.ts"() { + "use strict"; + init_git_plugin_error(); + init_utils(); + WRONG_NUMBER_ERR = `Invalid value supplied for custom binary, requires a single string or an array containing either one or two strings`; + WRONG_CHARS_ERR = `Invalid value supplied for custom binary, restricted characters must be removed or supply the unsafe.allowUnsafeCustomBinary option`; + } +}); + // src/lib/plugins/error-detection.plugin.ts function isTaskError(result) { return !!(result.exitCode && result.stdErr.length); @@ -117780,18 +117894,32 @@ function errorDetectionPlugin(config) { } var init_error_detection_plugin = __esm({ "src/lib/plugins/error-detection.plugin.ts"() { + "use strict"; init_git_error(); } }); // src/lib/plugins/plugin-store.ts -var PluginStore; +var import_node_events, PluginStore; var init_plugin_store = __esm({ "src/lib/plugins/plugin-store.ts"() { + "use strict"; + import_node_events = __nccwpck_require__(15673); init_utils(); PluginStore = class { constructor() { this.plugins = /* @__PURE__ */ new Set(); + this.events = new import_node_events.EventEmitter(); + } + on(type, listener) { + this.events.on(type, listener); + } + reconfigure(type, data) { + this.events.emit(type, data); + } + append(type, action) { + const plugin = append(this.plugins, { type, action }); + return () => this.plugins.delete(plugin); } add(plugin) { const plugins = []; @@ -117856,6 +117984,7 @@ function progressEventStage(input) { } var init_progress_monitor_plugin = __esm({ "src/lib/plugins/progress-monitor-plugin.ts"() { + "use strict"; init_utils(); } }); @@ -117863,6 +117992,7 @@ var init_progress_monitor_plugin = __esm({ // src/lib/plugins/simple-git-plugin.ts var init_simple_git_plugin = __esm({ "src/lib/plugins/simple-git-plugin.ts"() { + "use strict"; } }); @@ -117878,6 +118008,7 @@ function spawnOptionsPlugin(spawnOptions) { } var init_spawn_options_plugin = __esm({ "src/lib/plugins/spawn-options-plugin.ts"() { + "use strict"; init_utils(); } }); @@ -117921,6 +118052,7 @@ function timeoutPlugin({ } var init_timout_plugin = __esm({ "src/lib/plugins/timout-plugin.ts"() { + "use strict"; init_git_plugin_error(); } }); @@ -117928,10 +118060,12 @@ var init_timout_plugin = __esm({ // src/lib/plugins/index.ts var init_plugins = __esm({ "src/lib/plugins/index.ts"() { + "use strict"; init_abort_plugin(); init_block_unsafe_operations_plugin(); init_command_config_prefixing_plugin(); init_completion_detection_plugin(); + init_custom_binary_plugin(); init_error_detection_plugin(); init_plugin_store(); init_progress_monitor_plugin(); @@ -117958,7 +118092,9 @@ function suffixPathsPlugin() { continue; } if (param === "--") { - append2(data.slice(i + 1).flatMap((item) => isPathSpec(item) && toPaths(item) || item)); + append2( + data.slice(i + 1).flatMap((item) => isPathSpec(item) && toPaths(item) || item) + ); break; } prefix.push(param); @@ -117969,6 +118105,7 @@ function suffixPathsPlugin() { } var init_suffix_paths_plugin = __esm({ "src/lib/plugins/suffix-paths.plugin.ts"() { + "use strict"; init_pathspec(); } }); @@ -118008,7 +118145,10 @@ function createLogger(label, verbose, initialStep, infoDebugger = createLog()) { const key = childLoggerName(filterType(verbose, filterString), debugDebugger, infoDebugger); return step(initialStep); function sibling(name, initial) { - return append(spawned, createLogger(label, key.replace(/^[^:]+/, name), initial, infoDebugger)); + return append( + spawned, + createLogger(label, key.replace(/^[^:]+/, name), initial, infoDebugger) + ); } function step(phase) { const stepPrefix = phase && `[${phase}]` || ""; @@ -118025,6 +118165,7 @@ function createLogger(label, verbose, initialStep, infoDebugger = createLog()) { var import_debug; var init_git_logger = __esm({ "src/lib/git-logger.ts"() { + "use strict"; import_debug = __toESM(__nccwpck_require__(38237)); init_utils(); import_debug.default.formatters.L = (value) => String(filterHasLength(value) ? value.length : "-"); @@ -118041,6 +118182,7 @@ var init_git_logger = __esm({ var _TasksPendingQueue, TasksPendingQueue; var init_tasks_pending_queue = __esm({ "src/lib/runners/tasks-pending-queue.ts"() { + "use strict"; init_git_error(); init_git_logger(); _TasksPendingQueue = class { @@ -118070,9 +118212,14 @@ var init_tasks_pending_queue = __esm({ for (const [task, { logger }] of Array.from(this._queue.entries())) { if (task === err.task) { logger.info(`Failed %o`, err); - logger(`Fatal exception, any as-yet un-started tasks run through this executor will not be attempted`); + logger( + `Fatal exception, any as-yet un-started tasks run through this executor will not be attempted` + ); } else { - logger.info(`A fatal exception occurred in a previous task, the queue has been purged: %o`, err.message); + logger.info( + `A fatal exception occurred in a previous task, the queue has been purged: %o`, + err.message + ); } this.complete(task); } @@ -118126,6 +118273,7 @@ function onDataReceived(target, name, logger, output) { var import_child_process, GitExecutorChain; var init_git_executor_chain = __esm({ "src/lib/runners/git-executor-chain.ts"() { + "use strict"; import_child_process = __nccwpck_require__(32081); init_git_error(); init_task(); @@ -118139,9 +118287,6 @@ var init_git_executor_chain = __esm({ this._chain = Promise.resolve(); this._queue = new TasksPendingQueue(); } - get binary() { - return this._executor.binary; - } get cwd() { return this._cwd || this._executor.cwd; } @@ -118184,8 +118329,19 @@ var init_git_executor_chain = __esm({ } attemptRemoteTask(task, logger) { return __async(this, null, function* () { - const args = this._plugins.exec("spawn.args", [...task.commands], pluginContext(task, task.commands)); - const raw = yield this.gitResponse(task, this.binary, args, this.outputHandler, logger.step("SPAWN")); + const binary = this._plugins.exec("spawn.binary", "", pluginContext(task, task.commands)); + const args = this._plugins.exec( + "spawn.args", + [...task.commands], + pluginContext(task, task.commands) + ); + const raw = yield this.gitResponse( + task, + binary, + args, + this.outputHandler, + logger.step("SPAWN") + ); const outputStreams = yield this.handleTaskData(task, args, raw, logger.step("HANDLE")); logger(`passing response to task's parser as a %s`, task.format); if (isBufferTask(task)) { @@ -118204,17 +118360,36 @@ var init_git_executor_chain = __esm({ const { exitCode, rejection, stdOut, stdErr } = result; return new Promise((done, fail) => { logger(`Preparing to handle process response exitCode=%d stdOut=`, exitCode); - const { error } = this._plugins.exec("task.error", { error: rejection }, __spreadValues(__spreadValues({}, pluginContext(task, args)), result)); + const { error } = this._plugins.exec( + "task.error", + { error: rejection }, + __spreadValues(__spreadValues({}, pluginContext(task, args)), result) + ); if (error && task.onError) { logger.info(`exitCode=%s handling with custom error handler`); - return task.onError(result, error, (newStdOut) => { - logger.info(`custom error handler treated as success`); - logger(`custom error returned a %s`, objectToString(newStdOut)); - done(new GitOutputStreams(Array.isArray(newStdOut) ? Buffer.concat(newStdOut) : newStdOut, Buffer.concat(stdErr))); - }, fail); + return task.onError( + result, + error, + (newStdOut) => { + logger.info(`custom error handler treated as success`); + logger(`custom error returned a %s`, objectToString(newStdOut)); + done( + new GitOutputStreams( + Array.isArray(newStdOut) ? Buffer.concat(newStdOut) : newStdOut, + Buffer.concat(stdErr) + ) + ); + }, + fail + ); } if (error) { - logger.info(`handling as error: exitCode=%s stdErr=%s rejection=%o`, exitCode, stdErr.length, rejection); + logger.info( + `handling as error: exitCode=%s stdErr=%s rejection=%o`, + exitCode, + stdErr.length, + rejection + ); return fail(error); } logger.info(`retrieving task output complete`); @@ -118224,11 +118399,15 @@ var init_git_executor_chain = __esm({ gitResponse(task, command, args, outputHandler, logger) { return __async(this, null, function* () { const outputLogger = logger.sibling("output"); - const spawnOptions = this._plugins.exec("spawn.options", { - cwd: this.cwd, - env: this.env, - windowsHide: true - }, pluginContext(task, task.commands)); + const spawnOptions = this._plugins.exec( + "spawn.options", + { + cwd: this.cwd, + env: this.env, + windowsHide: true + }, + pluginContext(task, task.commands) + ); return new Promise((done) => { const stdOut = []; const stdErr = []; @@ -118249,8 +118428,14 @@ var init_git_executor_chain = __esm({ } })); const spawned = (0, import_child_process.spawn)(command, args, spawnOptions); - spawned.stdout.on("data", onDataReceived(stdOut, "stdOut", logger, outputLogger.step("stdOut"))); - spawned.stderr.on("data", onDataReceived(stdErr, "stdErr", logger, outputLogger.step("stdErr"))); + spawned.stdout.on( + "data", + onDataReceived(stdOut, "stdOut", logger, outputLogger.step("stdOut")) + ); + spawned.stderr.on( + "data", + onDataReceived(stdErr, "stdErr", logger, outputLogger.step("stdErr")) + ); spawned.on("error", onErrorReceived(stdErr, logger)); if (outputHandler) { logger(`Passing child process stdOut/stdErr to custom outputHandler`); @@ -118298,10 +118483,10 @@ __export(git_executor_exports, { var GitExecutor; var init_git_executor = __esm({ "src/lib/runners/git-executor.ts"() { + "use strict"; init_git_executor_chain(); GitExecutor = class { - constructor(binary = "git", cwd, _scheduler, _plugins) { - this.binary = binary; + constructor(cwd, _scheduler, _plugins) { this.cwd = cwd; this._scheduler = _scheduler; this._plugins = _plugins; @@ -118324,14 +118509,19 @@ function taskCallback(task, response, callback = NOOP) { }; const onError2 = (err) => { if ((err == null ? void 0 : err.task) === task) { - callback(err instanceof GitResponseError ? addDeprecationNoticeToError(err) : err, void 0); + callback( + err instanceof GitResponseError ? addDeprecationNoticeToError(err) : err, + void 0 + ); } }; response.then(onSuccess, onError2); } function addDeprecationNoticeToError(err) { let log = (name) => { - console.warn(`simple-git deprecation notice: accessing GitResponseError.${name} should be GitResponseError.git.${name}, this will no longer be available in version 3`); + console.warn( + `simple-git deprecation notice: accessing GitResponseError.${name} should be GitResponseError.git.${name}, this will no longer be available in version 3` + ); log = NOOP; }; return Object.create(err, Object.getOwnPropertyNames(err.git).reduce(descriptorReducer, {})); @@ -118352,6 +118542,7 @@ function addDeprecationNoticeToError(err) { } var init_task_callback = __esm({ "src/lib/task-callback.ts"() { + "use strict"; init_git_response_error(); init_utils(); } @@ -118368,6 +118559,7 @@ function changeWorkingDirectoryTask(directory, root) { } var init_change_working_directory = __esm({ "src/lib/tasks/change-working-directory.ts"() { + "use strict"; init_utils(); init_task(); } @@ -118384,18 +118576,28 @@ function checkoutTask(args) { function checkout_default() { return { checkout() { - return this._runTask(checkoutTask(getTrailingOptions(arguments, 1)), trailingFunctionArgument(arguments)); + return this._runTask( + checkoutTask(getTrailingOptions(arguments, 1)), + trailingFunctionArgument(arguments) + ); }, checkoutBranch(branchName, startPoint) { - return this._runTask(checkoutTask(["-b", branchName, startPoint, ...getTrailingOptions(arguments)]), trailingFunctionArgument(arguments)); + return this._runTask( + checkoutTask(["-b", branchName, startPoint, ...getTrailingOptions(arguments)]), + trailingFunctionArgument(arguments) + ); }, checkoutLocalBranch(branchName) { - return this._runTask(checkoutTask(["-b", branchName, ...getTrailingOptions(arguments)]), trailingFunctionArgument(arguments)); + return this._runTask( + checkoutTask(["-b", branchName, ...getTrailingOptions(arguments)]), + trailingFunctionArgument(arguments) + ); } }; } var init_checkout = __esm({ "src/lib/tasks/checkout.ts"() { + "use strict"; init_utils(); init_task(); } @@ -118419,6 +118621,7 @@ function parseCommitResult(stdOut) { var parsers; var init_parse_commit = __esm({ "src/lib/parsers/parse-commit.ts"() { + "use strict"; init_utils(); parsers = [ new LineParser(/^\[([^\s]+)( \([^)]+\))? ([^\]]+)/, (result, [branch, root, commit]) => { @@ -118437,20 +118640,26 @@ var init_parse_commit = __esm({ name: parts.join("<").trim() }; }), - new LineParser(/(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g, (result, [changes, insertions, deletions]) => { - result.summary.changes = parseInt(changes, 10) || 0; - result.summary.insertions = parseInt(insertions, 10) || 0; - result.summary.deletions = parseInt(deletions, 10) || 0; - }), - new LineParser(/^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/, (result, [changes, lines, direction]) => { - result.summary.changes = parseInt(changes, 10) || 0; - const count = parseInt(lines, 10) || 0; - if (direction === "-") { - result.summary.deletions = count; - } else if (direction === "+") { - result.summary.insertions = count; + new LineParser( + /(\d+)[^,]*(?:,\s*(\d+)[^,]*)(?:,\s*(\d+))/g, + (result, [changes, insertions, deletions]) => { + result.summary.changes = parseInt(changes, 10) || 0; + result.summary.insertions = parseInt(insertions, 10) || 0; + result.summary.deletions = parseInt(deletions, 10) || 0; } - }) + ), + new LineParser( + /^(\d+)[^,]*(?:,\s*(\d+)[^(]+\(([+-]))?/, + (result, [changes, lines, direction]) => { + result.summary.changes = parseInt(changes, 10) || 0; + const count = parseInt(lines, 10) || 0; + if (direction === "-") { + result.summary.deletions = count; + } else if (direction === "+") { + result.summary.insertions = count; + } + } + ) ]; } }); @@ -118475,16 +118684,23 @@ function commit_default() { return { commit(message, ...rest) { const next = trailingFunctionArgument(arguments); - const task = rejectDeprecatedSignatures(message) || commitTask(asArray(message), asArray(filterType(rest[0], filterStringOrStringArray, [])), [...filterType(rest[1], filterArray, []), ...getTrailingOptions(arguments, 0, true)]); + const task = rejectDeprecatedSignatures(message) || commitTask( + asArray(message), + asArray(filterType(rest[0], filterStringOrStringArray, [])), + [...filterType(rest[1], filterArray, []), ...getTrailingOptions(arguments, 0, true)] + ); return this._runTask(task, next); } }; function rejectDeprecatedSignatures(message) { - return !filterStringOrStringArray(message) && configurationErrorTask(`git.commit: requires the commit message to be supplied as a string/string[]`); + return !filterStringOrStringArray(message) && configurationErrorTask( + `git.commit: requires the commit message to be supplied as a string/string[]` + ); } } var init_commit = __esm({ "src/lib/tasks/commit.ts"() { + "use strict"; init_parse_commit(); init_utils(); init_task(); @@ -118495,12 +118711,16 @@ var init_commit = __esm({ function first_commit_default() { return { firstCommit() { - return this._runTask(straightThroughStringTask(["rev-list", "--max-parents=0", "HEAD"], true), trailingFunctionArgument(arguments)); + return this._runTask( + straightThroughStringTask(["rev-list", "--max-parents=0", "HEAD"], true), + trailingFunctionArgument(arguments) + ); } }; } var init_first_commit = __esm({ "src/lib/tasks/first-commit.ts"() { + "use strict"; init_utils(); init_task(); } @@ -118516,6 +118736,7 @@ function hashObjectTask(filePath, write) { } var init_hash_object = __esm({ "src/lib/tasks/hash-object.ts"() { + "use strict"; init_task(); } }); @@ -118544,6 +118765,7 @@ function parseInit(bare, path, text) { var InitSummary, initResponseRegex, reInitResponseRegex; var init_InitSummary = __esm({ "src/lib/responses/InitSummary.ts"() { + "use strict"; InitSummary = class { constructor(bare, path, existing, gitDir) { this.bare = bare; @@ -118577,6 +118799,7 @@ function initTask(bare = false, path, customArgs) { var bareCommand; var init_init = __esm({ "src/lib/tasks/init.ts"() { + "use strict"; init_InitSummary(); bareCommand = "--bare"; } @@ -118598,6 +118821,7 @@ function isLogFormat(customArg) { var logFormatRegex; var init_log_format = __esm({ "src/lib/args/log-format.ts"() { + "use strict"; logFormatRegex = /^--(stat|numstat|name-only|name-status)(=|$)/; } }); @@ -118606,6 +118830,7 @@ var init_log_format = __esm({ var DiffSummary; var init_DiffSummary = __esm({ "src/lib/responses/DiffSummary.ts"() { + "use strict"; DiffSummary = class { constructor() { this.changed = 0; @@ -118625,51 +118850,64 @@ function getDiffParser(format = "" /* NONE */) { var statParser, numStatParser, nameOnlyParser, nameStatusParser, diffSummaryParsers; var init_parse_diff_summary = __esm({ "src/lib/parsers/parse-diff-summary.ts"() { + "use strict"; init_log_format(); init_DiffSummary(); init_diff_name_status(); init_utils(); statParser = [ - new LineParser(/(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/, (result, [file, changes, alterations = ""]) => { - result.files.push({ - file: file.trim(), - changes: asNumber(changes), - insertions: alterations.replace(/[^+]/g, "").length, - deletions: alterations.replace(/[^-]/g, "").length, - binary: false - }); - }), - new LineParser(/(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/, (result, [file, before, after]) => { - result.files.push({ - file: file.trim(), - before: asNumber(before), - after: asNumber(after), - binary: true - }); - }), - new LineParser(/(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/, (result, [changed, summary]) => { - const inserted = /(\d+) i/.exec(summary); - const deleted = /(\d+) d/.exec(summary); - result.changed = asNumber(changed); - result.insertions = asNumber(inserted == null ? void 0 : inserted[1]); - result.deletions = asNumber(deleted == null ? void 0 : deleted[1]); - }) + new LineParser( + /^(.+)\s+\|\s+(\d+)(\s+[+\-]+)?$/, + (result, [file, changes, alterations = ""]) => { + result.files.push({ + file: file.trim(), + changes: asNumber(changes), + insertions: alterations.replace(/[^+]/g, "").length, + deletions: alterations.replace(/[^-]/g, "").length, + binary: false + }); + } + ), + new LineParser( + /^(.+) \|\s+Bin ([0-9.]+) -> ([0-9.]+) ([a-z]+)/, + (result, [file, before, after]) => { + result.files.push({ + file: file.trim(), + before: asNumber(before), + after: asNumber(after), + binary: true + }); + } + ), + new LineParser( + /(\d+) files? changed\s*((?:, \d+ [^,]+){0,2})/, + (result, [changed, summary]) => { + const inserted = /(\d+) i/.exec(summary); + const deleted = /(\d+) d/.exec(summary); + result.changed = asNumber(changed); + result.insertions = asNumber(inserted == null ? void 0 : inserted[1]); + result.deletions = asNumber(deleted == null ? void 0 : deleted[1]); + } + ) ]; numStatParser = [ - new LineParser(/(\d+)\t(\d+)\t(.+)$/, (result, [changesInsert, changesDelete, file]) => { - const insertions = asNumber(changesInsert); - const deletions = asNumber(changesDelete); - result.changed++; - result.insertions += insertions; - result.deletions += deletions; - result.files.push({ - file, - changes: insertions + deletions, - insertions, - deletions, - binary: false - }); - }), + new LineParser( + /(\d+)\t(\d+)\t(.+)$/, + (result, [changesInsert, changesDelete, file]) => { + const insertions = asNumber(changesInsert); + const deletions = asNumber(changesDelete); + result.changed++; + result.insertions += insertions; + result.deletions += deletions; + result.files.push({ + file, + changes: insertions + deletions, + insertions, + deletions, + binary: false + }); + } + ), new LineParser(/-\t-\t(.+)$/, (result, [file]) => { result.changed++; result.files.push({ @@ -118693,17 +118931,20 @@ var init_parse_diff_summary = __esm({ }) ]; nameStatusParser = [ - new LineParser(/([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/, (result, [status, _similarity, from, _to, to]) => { - result.changed++; - result.files.push({ - file: to != null ? to : from, - changes: 0, - status: orVoid(isDiffNameStatus(status) && status), - insertions: 0, - deletions: 0, - binary: false - }); - }) + new LineParser( + /([ACDMRTUXB])([0-9]{0,3})\t(.[^\t]*)(\t(.[^\t]*))?$/, + (result, [status, _similarity, from, _to, to]) => { + result.changed++; + result.files.push({ + file: to != null ? to : from, + changes: 0, + status: orVoid(isDiffNameStatus(status) && status), + insertions: 0, + deletions: 0, + binary: false + }); + } + ) ]; diffSummaryParsers = { ["" /* NONE */]: statParser, @@ -118717,17 +118958,27 @@ var init_parse_diff_summary = __esm({ // src/lib/parsers/parse-list-log-summary.ts function lineBuilder(tokens, fields) { - return fields.reduce((line, field, index) => { - line[field] = tokens[index] || ""; - return line; - }, /* @__PURE__ */ Object.create({ diff: null })); + return fields.reduce( + (line, field, index) => { + line[field] = tokens[index] || ""; + return line; + }, + /* @__PURE__ */ Object.create({ diff: null }) + ); } function createListLogSummaryParser(splitter = SPLITTER, fields = defaultFieldNames, logFormat = "" /* NONE */) { const parseDiffResult = getDiffParser(logFormat); return function(stdOut) { - const all = toLinesWithContent(stdOut, true, START_BOUNDARY).map(function(item) { + const all = toLinesWithContent( + stdOut, + true, + START_BOUNDARY + ).map(function(item) { const lineDetail = item.trim().split(COMMIT_BOUNDARY); - const listLogLine = lineBuilder(lineDetail[0].trim().split(splitter), fields); + const listLogLine = lineBuilder( + lineDetail[0].trim().split(splitter), + fields + ); if (lineDetail.length > 1 && !!lineDetail[1].trim()) { listLogLine.diff = parseDiffResult(lineDetail[1]); } @@ -118743,6 +118994,7 @@ function createListLogSummaryParser(splitter = SPLITTER, fields = defaultFieldNa var START_BOUNDARY, COMMIT_BOUNDARY, SPLITTER, defaultFieldNames; var init_parse_list_log_summary = __esm({ "src/lib/parsers/parse-list-log-summary.ts"() { + "use strict"; init_utils(); init_parse_diff_summary(); init_log_format(); @@ -118776,14 +119028,19 @@ function diffSummaryTask(customArgs) { function validateLogFormatConfig(customArgs) { const flags = customArgs.filter(isLogFormat); if (flags.length > 1) { - return configurationErrorTask(`Summary flags are mutually exclusive - pick one of ${flags.join(",")}`); + return configurationErrorTask( + `Summary flags are mutually exclusive - pick one of ${flags.join(",")}` + ); } if (flags.length && customArgs.includes("-z")) { - return configurationErrorTask(`Summary flag ${flags} parsing is not compatible with null termination option '-z'`); + return configurationErrorTask( + `Summary flag ${flags} parsing is not compatible with null termination option '-z'` + ); } } var init_diff = __esm({ "src/lib/tasks/diff.ts"() { + "use strict"; init_log_format(); init_parse_diff_summary(); init_task(); @@ -118855,7 +119112,10 @@ function log_default() { return { log(...rest) { const next = trailingFunctionArgument(arguments); - const options = parseLogOptions(trailingOptionsArgument(arguments), filterType(arguments[0], filterArray)); + const options = parseLogOptions( + trailingOptionsArgument(arguments), + filterType(arguments[0], filterArray) + ); const task = rejectDeprecatedSignatures(...rest) || validateLogFormatConfig(options.commands) || createLogTask(options); return this._runTask(task, next); } @@ -118864,12 +119124,15 @@ function log_default() { return logTask(options.splitter, options.fields, options.commands); } function rejectDeprecatedSignatures(from, to) { - return filterString(from) && filterString(to) && configurationErrorTask(`git.log(string, string) should be replaced with git.log({ from: string, to: string })`); + return filterString(from) && filterString(to) && configurationErrorTask( + `git.log(string, string) should be replaced with git.log({ from: string, to: string })` + ); } } var excludeOptions; var init_log = __esm({ "src/lib/tasks/log.ts"() { + "use strict"; init_log_format(); init_pathspec(); init_parse_list_log_summary(); @@ -118899,6 +119162,7 @@ var init_log = __esm({ var MergeSummaryConflict, MergeSummaryDetail; var init_MergeSummary = __esm({ "src/lib/responses/MergeSummary.ts"() { + "use strict"; MergeSummaryConflict = class { constructor(reason, file = null, meta) { this.reason = reason; @@ -118935,6 +119199,7 @@ var init_MergeSummary = __esm({ var PullSummary, PullFailedSummary; var init_PullSummary = __esm({ "src/lib/responses/PullSummary.ts"() { + "use strict"; PullSummary = class { constructor() { this.remoteMessages = { @@ -118994,24 +119259,34 @@ function asObjectCount(source) { var remoteMessagesObjectParsers; var init_parse_remote_objects = __esm({ "src/lib/parsers/parse-remote-objects.ts"() { + "use strict"; init_utils(); remoteMessagesObjectParsers = [ - new RemoteLineParser(/^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i, (result, [action, count]) => { - const key = action.toLowerCase(); - const enumeration = objectEnumerationResult(result.remoteMessages); - Object.assign(enumeration, { [key]: asNumber(count) }); - }), - new RemoteLineParser(/^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i, (result, [action, count]) => { - const key = action.toLowerCase(); - const enumeration = objectEnumerationResult(result.remoteMessages); - Object.assign(enumeration, { [key]: asNumber(count) }); - }), - new RemoteLineParser(/total ([^,]+), reused ([^,]+), pack-reused (\d+)/i, (result, [total, reused, packReused]) => { - const objects = objectEnumerationResult(result.remoteMessages); - objects.total = asObjectCount(total); - objects.reused = asObjectCount(reused); - objects.packReused = asNumber(packReused); - }) + new RemoteLineParser( + /^remote:\s*(enumerating|counting|compressing) objects: (\d+),/i, + (result, [action, count]) => { + const key = action.toLowerCase(); + const enumeration = objectEnumerationResult(result.remoteMessages); + Object.assign(enumeration, { [key]: asNumber(count) }); + } + ), + new RemoteLineParser( + /^remote:\s*(enumerating|counting|compressing) objects: \d+% \(\d+\/(\d+)\),/i, + (result, [action, count]) => { + const key = action.toLowerCase(); + const enumeration = objectEnumerationResult(result.remoteMessages); + Object.assign(enumeration, { [key]: asNumber(count) }); + } + ), + new RemoteLineParser( + /total ([^,]+), reused ([^,]+), pack-reused (\d+)/i, + (result, [total, reused, packReused]) => { + const objects = objectEnumerationResult(result.remoteMessages); + objects.total = asObjectCount(total); + objects.reused = asObjectCount(reused); + objects.packReused = asNumber(packReused); + } + ) ]; } }); @@ -119023,6 +119298,7 @@ function parseRemoteMessages(_stdOut, stdErr) { var parsers2, RemoteMessageSummary; var init_parse_remote_messages = __esm({ "src/lib/parsers/parse-remote-messages.ts"() { + "use strict"; init_utils(); init_parse_remote_objects(); parsers2 = [ @@ -119031,16 +119307,22 @@ var init_parse_remote_messages = __esm({ return false; }), ...remoteMessagesObjectParsers, - new RemoteLineParser([/create a (?:pull|merge) request/i, /\s(https?:\/\/\S+)$/], (result, [pullRequestUrl]) => { - result.remoteMessages.pullRequestUrl = pullRequestUrl; - }), - new RemoteLineParser([/found (\d+) vulnerabilities.+\(([^)]+)\)/i, /\s(https?:\/\/\S+)$/], (result, [count, summary, url]) => { - result.remoteMessages.vulnerabilities = { - count: asNumber(count), - summary, - url - }; - }) + new RemoteLineParser( + [/create a (?:pull|merge) request/i, /\s(https?:\/\/\S+)$/], + (result, [pullRequestUrl]) => { + result.remoteMessages.pullRequestUrl = pullRequestUrl; + } + ), + new RemoteLineParser( + [/found (\d+) vulnerabilities.+\(([^)]+)\)/i, /\s(https?:\/\/\S+)$/], + (result, [count, summary, url]) => { + result.remoteMessages.vulnerabilities = { + count: asNumber(count), + summary, + url + }; + } + ) ]; RemoteMessageSummary = class { constructor() { @@ -119058,6 +119340,7 @@ function parsePullErrorResult(stdOut, stdErr) { var FILE_UPDATE_REGEX, SUMMARY_REGEX, ACTION_REGEX, parsers3, errorParsers, parsePullDetail, parsePullResult; var init_parse_pull = __esm({ "src/lib/parsers/parse-pull.ts"() { + "use strict"; init_PullSummary(); init_utils(); init_parse_remote_messages(); @@ -119091,18 +119374,25 @@ var init_parse_pull = __esm({ errorParsers = [ new LineParser(/^from\s(.+)$/i, (result, [remote]) => void (result.remote = remote)), new LineParser(/^fatal:\s(.+)$/, (result, [message]) => void (result.message = message)), - new LineParser(/([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/, (result, [hashLocal, hashRemote, branchLocal, branchRemote]) => { - result.branch.local = branchLocal; - result.hash.local = hashLocal; - result.branch.remote = branchRemote; - result.hash.remote = hashRemote; - }) + new LineParser( + /([a-z0-9]+)\.\.([a-z0-9]+)\s+(\S+)\s+->\s+(\S+)$/, + (result, [hashLocal, hashRemote, branchLocal, branchRemote]) => { + result.branch.local = branchLocal; + result.hash.local = hashLocal; + result.branch.remote = branchRemote; + result.hash.remote = hashRemote; + } + ) ]; parsePullDetail = (stdOut, stdErr) => { return parseStringResponse(new PullSummary(), parsers3, [stdOut, stdErr]); }; parsePullResult = (stdOut, stdErr) => { - return Object.assign(new PullSummary(), parsePullDetail(stdOut, stdErr), parseRemoteMessages(stdOut, stdErr)); + return Object.assign( + new PullSummary(), + parsePullDetail(stdOut, stdErr), + parseRemoteMessages(stdOut, stdErr) + ); }; } }); @@ -119111,6 +119401,7 @@ var init_parse_pull = __esm({ var parsers4, parseMergeResult, parseMergeDetail; var init_parse_merge = __esm({ "src/lib/parsers/parse-merge.ts"() { + "use strict"; init_MergeSummary(); init_utils(); init_parse_pull(); @@ -119121,9 +119412,12 @@ var init_parse_merge = __esm({ new LineParser(/^CONFLICT\s+\((.+)\): Merge conflict in (.+)$/, (summary, [reason, file]) => { summary.conflicts.push(new MergeSummaryConflict(reason, file)); }), - new LineParser(/^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/, (summary, [reason, file, deleteRef]) => { - summary.conflicts.push(new MergeSummaryConflict(reason, file, { deleteRef })); - }), + new LineParser( + /^CONFLICT\s+\((.+\/delete)\): (.+) deleted in (.+) and/, + (summary, [reason, file, deleteRef]) => { + summary.conflicts.push(new MergeSummaryConflict(reason, file, { deleteRef })); + } + ), new LineParser(/^CONFLICT\s+\((.+)\):/, (summary, [reason]) => { summary.conflicts.push(new MergeSummaryConflict(reason, null)); }), @@ -119159,6 +119453,7 @@ function mergeTask(customArgs) { } var init_merge = __esm({ "src/lib/tasks/merge.ts"() { + "use strict"; init_git_response_error(); init_parse_merge(); init_task(); @@ -119183,6 +119478,7 @@ function pushResultPushedItem(local, remote, status) { var parsers5, parsePushResult, parsePushDetail; var init_parse_push = __esm({ "src/lib/parsers/parse-push.ts"() { + "use strict"; init_utils(); init_parse_remote_messages(); parsers5 = [ @@ -119197,25 +119493,31 @@ var init_parse_push = __esm({ new LineParser(/^[=*-]\s+([^:]+):(\S+)\s+\[(.+)]$/, (result, [local, remote, type]) => { result.pushed.push(pushResultPushedItem(local, remote, type)); }), - new LineParser(/^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/, (result, [local, remote, remoteName]) => { - result.branch = __spreadProps(__spreadValues({}, result.branch || {}), { - local, - remote, - remoteName - }); - }), - new LineParser(/^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/, (result, [local, remote, from, to]) => { - result.update = { - head: { + new LineParser( + /^Branch '([^']+)' set up to track remote branch '([^']+)' from '([^']+)'/, + (result, [local, remote, remoteName]) => { + result.branch = __spreadProps(__spreadValues({}, result.branch || {}), { local, - remote - }, - hash: { - from, - to - } - }; - }) + remote, + remoteName + }); + } + ), + new LineParser( + /^([^:]+):(\S+)\s+([a-z0-9]+)\.\.([a-z0-9]+)$/, + (result, [local, remote, from, to]) => { + result.update = { + head: { + local, + remote + }, + hash: { + from, + to + } + }; + } + ) ]; parsePushResult = (stdOut, stdErr) => { const pushDetail = parsePushDetail(stdOut, stdErr); @@ -119257,6 +119559,7 @@ function pushTask(ref = {}, customArgs) { } var init_push = __esm({ "src/lib/tasks/push.ts"() { + "use strict"; init_parse_push(); init_utils(); } @@ -119270,16 +119573,23 @@ function show_default() { if (!commands.includes("--binary")) { commands.splice(1, 0, "--binary"); } - return this._runTask(straightThroughBufferTask(commands), trailingFunctionArgument(arguments)); + return this._runTask( + straightThroughBufferTask(commands), + trailingFunctionArgument(arguments) + ); }, show() { const commands = ["show", ...getTrailingOptions(arguments, 1)]; - return this._runTask(straightThroughStringTask(commands), trailingFunctionArgument(arguments)); + return this._runTask( + straightThroughStringTask(commands), + trailingFunctionArgument(arguments) + ); } }; } var init_show = __esm({ "src/lib/tasks/show.ts"() { + "use strict"; init_utils(); init_task(); } @@ -119289,13 +119599,14 @@ var init_show = __esm({ var fromPathRegex, FileStatusSummary; var init_FileStatusSummary = __esm({ "src/lib/responses/FileStatusSummary.ts"() { + "use strict"; fromPathRegex = /^(.+) -> (.+)$/; FileStatusSummary = class { constructor(path, index, working_dir) { this.path = path; this.index = index; this.working_dir = working_dir; - if (index + working_dir === "R") { + if ("R" === index + working_dir) { const detail = fromPathRegex.exec(path) || [null, path, path]; this.from = detail[1] || ""; this.path = detail[2] || ""; @@ -119343,6 +119654,7 @@ function splitLine(result, lineStr) { var StatusSummary, parsers6, parseStatusSummary; var init_StatusSummary = __esm({ "src/lib/responses/StatusSummary.ts"() { + "use strict"; init_utils(); init_FileStatusSummary(); StatusSummary = class { @@ -119367,14 +119679,46 @@ var init_StatusSummary = __esm({ } }; parsers6 = new Map([ - parser2(" " /* NONE */, "A" /* ADDED */, (result, file) => append(result.created, file)), - parser2(" " /* NONE */, "D" /* DELETED */, (result, file) => append(result.deleted, file)), - parser2(" " /* NONE */, "M" /* MODIFIED */, (result, file) => append(result.modified, file)), - parser2("A" /* ADDED */, " " /* NONE */, (result, file) => append(result.created, file) && append(result.staged, file)), - parser2("A" /* ADDED */, "M" /* MODIFIED */, (result, file) => append(result.created, file) && append(result.staged, file) && append(result.modified, file)), - parser2("D" /* DELETED */, " " /* NONE */, (result, file) => append(result.deleted, file) && append(result.staged, file)), - parser2("M" /* MODIFIED */, " " /* NONE */, (result, file) => append(result.modified, file) && append(result.staged, file)), - parser2("M" /* MODIFIED */, "M" /* MODIFIED */, (result, file) => append(result.modified, file) && append(result.staged, file)), + parser2( + " " /* NONE */, + "A" /* ADDED */, + (result, file) => append(result.created, file) + ), + parser2( + " " /* NONE */, + "D" /* DELETED */, + (result, file) => append(result.deleted, file) + ), + parser2( + " " /* NONE */, + "M" /* MODIFIED */, + (result, file) => append(result.modified, file) + ), + parser2( + "A" /* ADDED */, + " " /* NONE */, + (result, file) => append(result.created, file) && append(result.staged, file) + ), + parser2( + "A" /* ADDED */, + "M" /* MODIFIED */, + (result, file) => append(result.created, file) && append(result.staged, file) && append(result.modified, file) + ), + parser2( + "D" /* DELETED */, + " " /* NONE */, + (result, file) => append(result.deleted, file) && append(result.staged, file) + ), + parser2( + "M" /* MODIFIED */, + " " /* NONE */, + (result, file) => append(result.modified, file) && append(result.staged, file) + ), + parser2( + "M" /* MODIFIED */, + "M" /* MODIFIED */, + (result, file) => append(result.modified, file) && append(result.staged, file) + ), parser2("R" /* RENAMED */, " " /* NONE */, (result, file) => { append(result.renamed, renamedFile(file)); }), @@ -119386,10 +119730,23 @@ var init_StatusSummary = __esm({ parser2("!" /* IGNORED */, "!" /* IGNORED */, (_result, _file) => { append(_result.ignored = _result.ignored || [], _file); }), - parser2("?" /* UNTRACKED */, "?" /* UNTRACKED */, (result, file) => append(result.not_added, file)), + parser2( + "?" /* UNTRACKED */, + "?" /* UNTRACKED */, + (result, file) => append(result.not_added, file) + ), ...conflicts("A" /* ADDED */, "A" /* ADDED */, "U" /* UNMERGED */), - ...conflicts("D" /* DELETED */, "D" /* DELETED */, "U" /* UNMERGED */), - ...conflicts("U" /* UNMERGED */, "A" /* ADDED */, "D" /* DELETED */, "U" /* UNMERGED */), + ...conflicts( + "D" /* DELETED */, + "D" /* DELETED */, + "U" /* UNMERGED */ + ), + ...conflicts( + "U" /* UNMERGED */, + "A" /* ADDED */, + "D" /* DELETED */, + "U" /* UNMERGED */ + ), [ "##", (result, line) => { @@ -119452,6 +119809,7 @@ function statusTask(customArgs) { var ignoredOptions; var init_status = __esm({ "src/lib/tasks/status.ts"() { + "use strict"; init_StatusSummary(); ignoredOptions = ["--null", "-z"]; } @@ -119459,19 +119817,23 @@ var init_status = __esm({ // src/lib/tasks/version.ts function versionResponse(major = 0, minor = 0, patch = 0, agent = "", installed = true) { - return Object.defineProperty({ - major, - minor, - patch, - agent, - installed - }, "toString", { - value() { - return `${this.major}.${this.minor}.${this.patch}`; + return Object.defineProperty( + { + major, + minor, + patch, + agent, + installed }, - configurable: false, - enumerable: false - }); + "toString", + { + value() { + return `${this.major}.${this.minor}.${this.patch}`; + }, + configurable: false, + enumerable: false + } + ); } function notInstalledResponse() { return versionResponse(0, 0, 0, "", false); @@ -119502,15 +119864,25 @@ function versionParser(stdOut) { var NOT_INSTALLED, parsers7; var init_version = __esm({ "src/lib/tasks/version.ts"() { + "use strict"; init_utils(); NOT_INSTALLED = "installed=false"; parsers7 = [ - new LineParser(/version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/, (result, [major, minor, patch, agent = ""]) => { - Object.assign(result, versionResponse(asNumber(major), asNumber(minor), asNumber(patch), agent)); - }), - new LineParser(/version (\d+)\.(\d+)\.(\D+)(.+)?$/, (result, [major, minor, patch, agent = ""]) => { - Object.assign(result, versionResponse(asNumber(major), asNumber(minor), patch, agent)); - }) + new LineParser( + /version (\d+)\.(\d+)\.(\d+)(?:\s*\((.+)\))?/, + (result, [major, minor, patch, agent = ""]) => { + Object.assign( + result, + versionResponse(asNumber(major), asNumber(minor), asNumber(patch), agent) + ); + } + ), + new LineParser( + /version (\d+)\.(\d+)\.(\D+)(.+)?$/, + (result, [major, minor, patch, agent = ""]) => { + Object.assign(result, versionResponse(asNumber(major), asNumber(minor), patch, agent)); + } + ) ]; } }); @@ -119523,6 +119895,7 @@ __export(simple_git_api_exports, { var SimpleGitApi; var init_simple_git_api = __esm({ "src/lib/simple-git-api.ts"() { + "use strict"; init_task_callback(); init_change_working_directory(); init_checkout(); @@ -119557,7 +119930,10 @@ var init_simple_git_api = __esm({ }); } add(files) { - return this._runTask(straightThroughStringTask(["add", ...asArray(files)]), trailingFunctionArgument(arguments)); + return this._runTask( + straightThroughStringTask(["add", ...asArray(files)]), + trailingFunctionArgument(arguments) + ); } cwd(directory) { const next = trailingFunctionArgument(arguments); @@ -119565,44 +119941,88 @@ var init_simple_git_api = __esm({ return this._runTask(changeWorkingDirectoryTask(directory, this._executor), next); } if (typeof (directory == null ? void 0 : directory.path) === "string") { - return this._runTask(changeWorkingDirectoryTask(directory.path, directory.root && this._executor || void 0), next); - } - return this._runTask(configurationErrorTask("Git.cwd: workingDirectory must be supplied as a string"), next); + return this._runTask( + changeWorkingDirectoryTask( + directory.path, + directory.root && this._executor || void 0 + ), + next + ); + } + return this._runTask( + configurationErrorTask("Git.cwd: workingDirectory must be supplied as a string"), + next + ); } hashObject(path, write) { - return this._runTask(hashObjectTask(path, write === true), trailingFunctionArgument(arguments)); + return this._runTask( + hashObjectTask(path, write === true), + trailingFunctionArgument(arguments) + ); } init(bare) { - return this._runTask(initTask(bare === true, this._executor.cwd, getTrailingOptions(arguments)), trailingFunctionArgument(arguments)); + return this._runTask( + initTask(bare === true, this._executor.cwd, getTrailingOptions(arguments)), + trailingFunctionArgument(arguments) + ); } merge() { - return this._runTask(mergeTask(getTrailingOptions(arguments)), trailingFunctionArgument(arguments)); + return this._runTask( + mergeTask(getTrailingOptions(arguments)), + trailingFunctionArgument(arguments) + ); } mergeFromTo(remote, branch) { if (!(filterString(remote) && filterString(branch))) { - return this._runTask(configurationErrorTask(`Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings`)); + return this._runTask( + configurationErrorTask( + `Git.mergeFromTo requires that the 'remote' and 'branch' arguments are supplied as strings` + ) + ); } - return this._runTask(mergeTask([remote, branch, ...getTrailingOptions(arguments)]), trailingFunctionArgument(arguments, false)); + return this._runTask( + mergeTask([remote, branch, ...getTrailingOptions(arguments)]), + trailingFunctionArgument(arguments, false) + ); } outputHandler(handler) { this._executor.outputHandler = handler; return this; } push() { - const task = pushTask({ - remote: filterType(arguments[0], filterString), - branch: filterType(arguments[1], filterString) - }, getTrailingOptions(arguments)); + const task = pushTask( + { + remote: filterType(arguments[0], filterString), + branch: filterType(arguments[1], filterString) + }, + getTrailingOptions(arguments) + ); return this._runTask(task, trailingFunctionArgument(arguments)); } stash() { - return this._runTask(straightThroughStringTask(["stash", ...getTrailingOptions(arguments)]), trailingFunctionArgument(arguments)); + return this._runTask( + straightThroughStringTask(["stash", ...getTrailingOptions(arguments)]), + trailingFunctionArgument(arguments) + ); } status() { - return this._runTask(statusTask(getTrailingOptions(arguments)), trailingFunctionArgument(arguments)); + return this._runTask( + statusTask(getTrailingOptions(arguments)), + trailingFunctionArgument(arguments) + ); } }; - Object.assign(SimpleGitApi.prototype, checkout_default(), commit_default(), config_default(), first_commit_default(), grep_default(), log_default(), show_default(), version_default()); + Object.assign( + SimpleGitApi.prototype, + checkout_default(), + commit_default(), + config_default(), + first_commit_default(), + grep_default(), + log_default(), + show_default(), + version_default() + ); } }); @@ -119614,6 +120034,7 @@ __export(scheduler_exports, { var import_promise_deferred2, createScheduledTask, Scheduler; var init_scheduler = __esm({ "src/lib/runners/scheduler.ts"() { + "use strict"; init_utils(); import_promise_deferred2 = __nccwpck_require__(49819); init_git_logger(); @@ -119639,7 +120060,12 @@ var init_scheduler = __esm({ } schedule() { if (!this.pending.length || this.running.length >= this.concurrency) { - this.logger(`Schedule attempt ignored, pending=%s running=%s concurrency=%s`, this.pending.length, this.running.length, this.concurrency); + this.logger( + `Schedule attempt ignored, pending=%s running=%s concurrency=%s`, + this.pending.length, + this.running.length, + this.concurrency + ); return; } const task = append(this.running, this.pending.shift()); @@ -119670,6 +120096,7 @@ function applyPatchTask(patches, customArgs) { } var init_apply_patch = __esm({ "src/lib/tasks/apply-patch.ts"() { + "use strict"; init_task(); } }); @@ -119692,6 +120119,7 @@ function branchDeletionFailure(branch) { var BranchDeletionBatch; var init_BranchDeleteSummary = __esm({ "src/lib/responses/BranchDeleteSummary.ts"() { + "use strict"; BranchDeletionBatch = class { constructor() { this.all = []; @@ -119712,6 +120140,7 @@ function hasBranchDeletionError(data, processExitCode) { var deleteSuccessRegex, deleteErrorRegex, parsers8, parseBranchDeletions; var init_parse_branch_delete = __esm({ "src/lib/parsers/parse-branch-delete.ts"() { + "use strict"; init_BranchDeleteSummary(); init_utils(); deleteSuccessRegex = /(\S+)\s+\(\S+\s([^)]+)\)/; @@ -119739,6 +120168,7 @@ var init_parse_branch_delete = __esm({ var BranchSummaryResult; var init_BranchSummary = __esm({ "src/lib/responses/BranchSummary.ts"() { + "use strict"; BranchSummaryResult = class { constructor() { this.all = []; @@ -119774,15 +120204,22 @@ function parseBranchSummary(stdOut) { var parsers9; var init_parse_branch = __esm({ "src/lib/parsers/parse-branch.ts"() { + "use strict"; init_BranchSummary(); init_utils(); parsers9 = [ - new LineParser(/^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/, (result, [current, name, commit, label]) => { - result.push(branchStatus(current), true, name, commit, label); - }), - new LineParser(/^([*+]\s)?(\S+)\s+([a-z0-9]+)\s?(.*)$/s, (result, [current, name, commit, label]) => { - result.push(branchStatus(current), false, name, commit, label); - }) + new LineParser( + /^([*+]\s)?\((?:HEAD )?detached (?:from|at) (\S+)\)\s+([a-z0-9]+)\s(.*)$/, + (result, [current, name, commit, label]) => { + result.push(branchStatus(current), true, name, commit, label); + } + ), + new LineParser( + new RegExp("^([*+]\\s)?(\\S+)\\s+([a-z0-9]+)\\s?(.*)$", "s"), + (result, [current, name, commit, label]) => { + result.push(branchStatus(current), false, name, commit, label); + } + ) ]; } }); @@ -119854,13 +120291,17 @@ function deleteBranchTask(branch, forceDelete = false) { if (!hasBranchDeletionError(String(error), exitCode)) { return fail(error); } - throw new GitResponseError(task.parser(bufferToString(stdOut), bufferToString(stdErr)), String(error)); + throw new GitResponseError( + task.parser(bufferToString(stdOut), bufferToString(stdErr)), + String(error) + ); } }; return task; } var init_branch = __esm({ "src/lib/tasks/branch.ts"() { + "use strict"; init_git_response_error(); init_parse_branch_delete(); init_parse_branch(); @@ -119872,6 +120313,7 @@ var init_branch = __esm({ var parseCheckIgnore; var init_CheckIgnore = __esm({ "src/lib/responses/CheckIgnore.ts"() { + "use strict"; parseCheckIgnore = (text) => { return text.split(/\n/g).map((line) => line.trim()).filter((file) => !!file); }; @@ -119892,6 +120334,7 @@ function checkIgnoreTask(paths) { } var init_check_ignore = __esm({ "src/lib/tasks/check-ignore.ts"() { + "use strict"; init_CheckIgnore(); } }); @@ -119921,6 +120364,7 @@ function cloneMirrorTask(repo, directory, customArgs) { } var init_clone = __esm({ "src/lib/tasks/clone.ts"() { + "use strict"; init_task(); init_utils(); } @@ -119941,6 +120385,7 @@ function parseFetchResult(stdOut, stdErr) { var parsers10; var init_parse_fetch = __esm({ "src/lib/parsers/parse-fetch.ts"() { + "use strict"; init_utils(); parsers10 = [ new LineParser(/From (.+)$/, (result, [remote]) => { @@ -119963,14 +120408,17 @@ var init_parse_fetch = __esm({ tracking }); }), - new LineParser(/\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/, (result, [from, to, name, tracking]) => { - result.updated.push({ - name, - tracking, - to, - from - }); - }) + new LineParser( + /\s*([^.]+)\.\.(\S+)\s+(\S+)\s*-> (.+)$/, + (result, [from, to, name, tracking]) => { + result.updated.push({ + name, + tracking, + to, + from + }); + } + ) ]; } }); @@ -120000,6 +120448,7 @@ function fetchTask(remote, branch, customArgs) { } var init_fetch = __esm({ "src/lib/tasks/fetch.ts"() { + "use strict"; init_parse_fetch(); init_task(); } @@ -120012,6 +120461,7 @@ function parseMoveResult(stdOut) { var parsers11; var init_parse_move = __esm({ "src/lib/parsers/parse-move.ts"() { + "use strict"; init_utils(); parsers11 = [ new LineParser(/^Renaming (.+) to (.+)$/, (result, [from, to]) => { @@ -120035,6 +120485,7 @@ function moveTask(from, to) { } var init_move = __esm({ "src/lib/tasks/move.ts"() { + "use strict"; init_parse_move(); init_utils(); } @@ -120057,7 +120508,10 @@ function pullTask(remote, branch, customArgs) { return parsePullResult(stdOut, stdErr); }, onError(result, _error, _done, fail) { - const pullError = parsePullErrorResult(bufferToString(result.stdOut), bufferToString(result.stdErr)); + const pullError = parsePullErrorResult( + bufferToString(result.stdOut), + bufferToString(result.stdErr) + ); if (pullError) { return fail(new GitResponseError(pullError)); } @@ -120067,6 +120521,7 @@ function pullTask(remote, branch, customArgs) { } var init_pull = __esm({ "src/lib/tasks/pull.ts"() { + "use strict"; init_git_response_error(); init_parse_pull(); init_utils(); @@ -120099,6 +120554,7 @@ function forEach(text, handler) { } var init_GetRemoteSummary = __esm({ "src/lib/responses/GetRemoteSummary.ts"() { + "use strict"; init_utils(); } }); @@ -120112,7 +120568,7 @@ __export(remote_exports, { remoteTask: () => remoteTask, removeRemoteTask: () => removeRemoteTask }); -function addRemoteTask(remoteName, remoteRepo, customArgs = []) { +function addRemoteTask(remoteName, remoteRepo, customArgs) { return straightThroughStringTask(["remote", "add", ...customArgs, remoteName, remoteRepo]); } function getRemotesTask(verbose) { @@ -120126,14 +120582,14 @@ function getRemotesTask(verbose) { parser: verbose ? parseGetRemotesVerbose : parseGetRemotes }; } -function listRemotesTask(customArgs = []) { +function listRemotesTask(customArgs) { const commands = [...customArgs]; if (commands[0] !== "ls-remote") { commands.unshift("ls-remote"); } return straightThroughStringTask(commands); } -function remoteTask(customArgs = []) { +function remoteTask(customArgs) { const commands = [...customArgs]; if (commands[0] !== "remote") { commands.unshift("remote"); @@ -120145,6 +120601,7 @@ function removeRemoteTask(remoteName) { } var init_remote = __esm({ "src/lib/tasks/remote.ts"() { + "use strict"; init_GetRemoteSummary(); init_task(); } @@ -120158,7 +120615,11 @@ __export(stash_list_exports, { function stashListTask(opt = {}, customArgs) { const options = parseLogOptions(opt); const commands = ["stash", "list", ...options.commands, ...customArgs]; - const parser3 = createListLogSummaryParser(options.splitter, options.fields, logFormatFromCommand(commands)); + const parser3 = createListLogSummaryParser( + options.splitter, + options.fields, + logFormatFromCommand(commands) + ); return validateLogFormatConfig(commands) || { commands, format: "utf-8", @@ -120167,6 +120628,7 @@ function stashListTask(opt = {}, customArgs) { } var init_stash_list = __esm({ "src/lib/tasks/stash-list.ts"() { + "use strict"; init_log_format(); init_parse_list_log_summary(); init_diff(); @@ -120200,6 +120662,7 @@ function updateSubModuleTask(customArgs) { } var init_sub_module = __esm({ "src/lib/tasks/sub-module.ts"() { + "use strict"; init_task(); } }); @@ -120228,6 +120691,7 @@ function toNumber(input) { var TagList, parseTagList; var init_TagList = __esm({ "src/lib/responses/TagList.ts"() { + "use strict"; TagList = class { constructor(all, latest) { this.all = all; @@ -120295,6 +120759,7 @@ function addAnnotatedTagTask(name, tagMessage) { } var init_tag = __esm({ "src/lib/tasks/tag.ts"() { + "use strict"; init_TagList(); } }); @@ -120302,6 +120767,7 @@ var init_tag = __esm({ // src/git.js var require_git = __commonJS({ "src/git.js"(exports2, module2) { + "use strict"; var { GitExecutor: GitExecutor2 } = (init_git_executor(), __toCommonJS(git_executor_exports)); var { SimpleGitApi: SimpleGitApi2 } = (init_simple_git_api(), __toCommonJS(simple_git_api_exports)); var { Scheduler: Scheduler2 } = (init_scheduler(), __toCommonJS(scheduler_exports)); @@ -120351,12 +120817,17 @@ var require_git = __commonJS({ var { addAnnotatedTagTask: addAnnotatedTagTask2, addTagTask: addTagTask2, tagListTask: tagListTask2 } = (init_tag(), __toCommonJS(tag_exports)); var { straightThroughBufferTask: straightThroughBufferTask2, straightThroughStringTask: straightThroughStringTask2 } = (init_task(), __toCommonJS(task_exports)); function Git2(options, plugins) { - this._executor = new GitExecutor2(options.binary, options.baseDir, new Scheduler2(options.maxConcurrentProcesses), plugins); + this._plugins = plugins; + this._executor = new GitExecutor2( + options.baseDir, + new Scheduler2(options.maxConcurrentProcesses), + plugins + ); this._trimmed = options.trimmed; } (Git2.prototype = Object.create(SimpleGitApi2.prototype)).constructor = Git2; Git2.prototype.customBinary = function(command) { - this._executor.binary = command; + this._plugins.reconfigure("binary", command); return this; }; Git2.prototype.env = function(name, value) { @@ -120368,7 +120839,13 @@ var require_git = __commonJS({ return this; }; Git2.prototype.stashList = function(options) { - return this._runTask(stashListTask2(trailingOptionsArgument2(arguments) || {}, filterArray2(options) && options || []), trailingFunctionArgument2(arguments)); + return this._runTask( + stashListTask2( + trailingOptionsArgument2(arguments) || {}, + filterArray2(options) && options || [] + ), + trailingFunctionArgument2(arguments) + ); }; function createCloneTask(api, task, repoPath, localPath) { if (typeof repoPath !== "string") { @@ -120377,10 +120854,16 @@ var require_git = __commonJS({ return task(repoPath, filterType2(localPath, filterString2), getTrailingOptions2(arguments)); } Git2.prototype.clone = function() { - return this._runTask(createCloneTask("clone", cloneTask2, ...arguments), trailingFunctionArgument2(arguments)); + return this._runTask( + createCloneTask("clone", cloneTask2, ...arguments), + trailingFunctionArgument2(arguments) + ); }; Git2.prototype.mirror = function() { - return this._runTask(createCloneTask("mirror", cloneMirrorTask2, ...arguments), trailingFunctionArgument2(arguments)); + return this._runTask( + createCloneTask("mirror", cloneMirrorTask2, ...arguments), + trailingFunctionArgument2(arguments) + ); }; Git2.prototype.mv = function(from, to) { return this._runTask(moveTask2(from, to), trailingFunctionArgument2(arguments)); @@ -120394,46 +120877,86 @@ var require_git = __commonJS({ }); }; Git2.prototype.pull = function(remote, branch, options, then) { - return this._runTask(pullTask2(filterType2(remote, filterString2), filterType2(branch, filterString2), getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments)); + return this._runTask( + pullTask2( + filterType2(remote, filterString2), + filterType2(branch, filterString2), + getTrailingOptions2(arguments) + ), + trailingFunctionArgument2(arguments) + ); }; Git2.prototype.fetch = function(remote, branch) { - return this._runTask(fetchTask2(filterType2(remote, filterString2), filterType2(branch, filterString2), getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments)); + return this._runTask( + fetchTask2( + filterType2(remote, filterString2), + filterType2(branch, filterString2), + getTrailingOptions2(arguments) + ), + trailingFunctionArgument2(arguments) + ); }; Git2.prototype.silent = function(silence) { - 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"); + 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" + ); return this; }; Git2.prototype.tags = function(options, then) { - return this._runTask(tagListTask2(getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments)); + return this._runTask( + tagListTask2(getTrailingOptions2(arguments)), + trailingFunctionArgument2(arguments) + ); }; Git2.prototype.rebase = function() { - return this._runTask(straightThroughStringTask2(["rebase", ...getTrailingOptions2(arguments)]), trailingFunctionArgument2(arguments)); + return this._runTask( + straightThroughStringTask2(["rebase", ...getTrailingOptions2(arguments)]), + trailingFunctionArgument2(arguments) + ); }; Git2.prototype.reset = function(mode) { - return this._runTask(resetTask2(getResetMode2(mode), getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments)); + return this._runTask( + resetTask2(getResetMode2(mode), getTrailingOptions2(arguments)), + trailingFunctionArgument2(arguments) + ); }; Git2.prototype.revert = function(commit) { const next = trailingFunctionArgument2(arguments); if (typeof commit !== "string") { return this._runTask(configurationErrorTask2("Commit must be a string"), next); } - return this._runTask(straightThroughStringTask2(["revert", ...getTrailingOptions2(arguments, 0, true), commit]), next); + return this._runTask( + straightThroughStringTask2(["revert", ...getTrailingOptions2(arguments, 0, true), commit]), + next + ); }; Git2.prototype.addTag = function(name) { const task = typeof name === "string" ? addTagTask2(name) : configurationErrorTask2("Git.addTag requires a tag name"); return this._runTask(task, trailingFunctionArgument2(arguments)); }; Git2.prototype.addAnnotatedTag = function(tagName, tagMessage) { - return this._runTask(addAnnotatedTagTask2(tagName, tagMessage), trailingFunctionArgument2(arguments)); + return this._runTask( + addAnnotatedTagTask2(tagName, tagMessage), + trailingFunctionArgument2(arguments) + ); }; Git2.prototype.deleteLocalBranch = function(branchName, forceDelete, then) { - return this._runTask(deleteBranchTask2(branchName, typeof forceDelete === "boolean" ? forceDelete : false), trailingFunctionArgument2(arguments)); + return this._runTask( + deleteBranchTask2(branchName, typeof forceDelete === "boolean" ? forceDelete : false), + trailingFunctionArgument2(arguments) + ); }; Git2.prototype.deleteLocalBranches = function(branchNames, forceDelete, then) { - return this._runTask(deleteBranchesTask2(branchNames, typeof forceDelete === "boolean" ? forceDelete : false), trailingFunctionArgument2(arguments)); + return this._runTask( + deleteBranchesTask2(branchNames, typeof forceDelete === "boolean" ? forceDelete : false), + trailingFunctionArgument2(arguments) + ); }; Git2.prototype.branch = function(options, then) { - return this._runTask(branchTask2(getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments)); + return this._runTask( + branchTask2(getTrailingOptions2(arguments)), + trailingFunctionArgument2(arguments) + ); }; Git2.prototype.branchLocal = function(then) { return this._runTask(branchLocalTask2(), trailingFunctionArgument2(arguments)); @@ -120450,7 +120973,10 @@ var require_git = __commonJS({ command.push(...getTrailingOptions2(arguments, 0, true)); var next = trailingFunctionArgument2(arguments); if (!command.length) { - return this._runTask(configurationErrorTask2("Raw: must supply one or more command to execute"), next); + return this._runTask( + configurationErrorTask2("Raw: must supply one or more command to execute"), + next + ); } return this._runTask(straightThroughStringTask2(command, this._trimmed), next); }; @@ -120458,19 +120984,34 @@ var require_git = __commonJS({ return this._runTask(addSubModuleTask2(repo, path), trailingFunctionArgument2(arguments)); }; Git2.prototype.submoduleUpdate = function(args, then) { - return this._runTask(updateSubModuleTask2(getTrailingOptions2(arguments, true)), trailingFunctionArgument2(arguments)); + return this._runTask( + updateSubModuleTask2(getTrailingOptions2(arguments, true)), + trailingFunctionArgument2(arguments) + ); }; Git2.prototype.submoduleInit = function(args, then) { - return this._runTask(initSubModuleTask2(getTrailingOptions2(arguments, true)), trailingFunctionArgument2(arguments)); + return this._runTask( + initSubModuleTask2(getTrailingOptions2(arguments, true)), + trailingFunctionArgument2(arguments) + ); }; Git2.prototype.subModule = function(options, then) { - return this._runTask(subModuleTask2(getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments)); + return this._runTask( + subModuleTask2(getTrailingOptions2(arguments)), + trailingFunctionArgument2(arguments) + ); }; Git2.prototype.listRemote = function() { - return this._runTask(listRemotesTask2(getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments)); + return this._runTask( + listRemotesTask2(getTrailingOptions2(arguments)), + trailingFunctionArgument2(arguments) + ); }; Git2.prototype.addRemote = function(remoteName, remoteRepo, then) { - return this._runTask(addRemoteTask2(remoteName, remoteRepo, getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments)); + return this._runTask( + addRemoteTask2(remoteName, remoteRepo, getTrailingOptions2(arguments)), + trailingFunctionArgument2(arguments) + ); }; Git2.prototype.removeRemote = function(remoteName, then) { return this._runTask(removeRemoteTask2(remoteName), trailingFunctionArgument2(arguments)); @@ -120479,7 +121020,10 @@ var require_git = __commonJS({ return this._runTask(getRemotesTask2(verbose === true), trailingFunctionArgument2(arguments)); }; Git2.prototype.remote = function(options, then) { - return this._runTask(remoteTask2(getTrailingOptions2(arguments)), trailingFunctionArgument2(arguments)); + return this._runTask( + remoteTask2(getTrailingOptions2(arguments)), + trailingFunctionArgument2(arguments) + ); }; Git2.prototype.tag = function(options, then) { const command = getTrailingOptions2(arguments); @@ -120489,17 +121033,29 @@ var require_git = __commonJS({ return this._runTask(straightThroughStringTask2(command), trailingFunctionArgument2(arguments)); }; Git2.prototype.updateServerInfo = function(then) { - return this._runTask(straightThroughStringTask2(["update-server-info"]), trailingFunctionArgument2(arguments)); + return this._runTask( + straightThroughStringTask2(["update-server-info"]), + trailingFunctionArgument2(arguments) + ); }; Git2.prototype.pushTags = function(remote, then) { - const task = pushTagsTask2({ remote: filterType2(remote, filterString2) }, getTrailingOptions2(arguments)); + const task = pushTagsTask2( + { remote: filterType2(remote, filterString2) }, + getTrailingOptions2(arguments) + ); return this._runTask(task, trailingFunctionArgument2(arguments)); }; Git2.prototype.rm = function(files) { - return this._runTask(straightThroughStringTask2(["rm", "-f", ...asArray2(files)]), trailingFunctionArgument2(arguments)); + return this._runTask( + straightThroughStringTask2(["rm", "-f", ...asArray2(files)]), + trailingFunctionArgument2(arguments) + ); }; Git2.prototype.rmKeepLocal = function(files) { - return this._runTask(straightThroughStringTask2(["rm", "--cached", ...asArray2(files)]), trailingFunctionArgument2(arguments)); + return this._runTask( + straightThroughStringTask2(["rm", "--cached", ...asArray2(files)]), + trailingFunctionArgument2(arguments) + ); }; Git2.prototype.catFile = function(options, then) { return this._catFile("utf-8", arguments); @@ -120512,7 +121068,10 @@ var require_git = __commonJS({ var command = ["cat-file"]; var options = args[0]; if (typeof options === "string") { - return this._runTask(configurationErrorTask2("Git.catFile: options must be supplied as an array of strings"), handler); + return this._runTask( + configurationErrorTask2("Git.catFile: options must be supplied as an array of strings"), + handler + ); } if (Array.isArray(options)) { command.push.apply(command, options); @@ -120521,25 +121080,38 @@ var require_git = __commonJS({ return this._runTask(task, handler); }; Git2.prototype.diff = function(options, then) { - 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)]); + 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)]); return this._runTask(task, trailingFunctionArgument2(arguments)); }; Git2.prototype.diffSummary = function() { - return this._runTask(diffSummaryTask2(getTrailingOptions2(arguments, 1)), trailingFunctionArgument2(arguments)); + return this._runTask( + diffSummaryTask2(getTrailingOptions2(arguments, 1)), + trailingFunctionArgument2(arguments) + ); }; Git2.prototype.applyPatch = function(patches) { - 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))); + 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))); return this._runTask(task, trailingFunctionArgument2(arguments)); }; Git2.prototype.revparse = function() { const commands = ["rev-parse", ...getTrailingOptions2(arguments, true)]; - return this._runTask(straightThroughStringTask2(commands, true), trailingFunctionArgument2(arguments)); + return this._runTask( + straightThroughStringTask2(commands, true), + trailingFunctionArgument2(arguments) + ); }; Git2.prototype.clean = function(mode, options, then) { const usingCleanOptionsArray = isCleanOptionsArray2(mode); const cleanMode = usingCleanOptionsArray && mode.join("") || filterType2(mode, filterString2) || ""; const customArgs = getTrailingOptions2([].slice.call(arguments, usingCleanOptionsArray ? 1 : 0)); - return this._runTask(cleanWithOptionsTask2(cleanMode, customArgs), trailingFunctionArgument2(arguments)); + return this._runTask( + cleanWithOptionsTask2(cleanMode, customArgs), + trailingFunctionArgument2(arguments) + ); }; Git2.prototype.exec = function(then) { const task = { @@ -120557,10 +121129,16 @@ var require_git = __commonJS({ return this; }; Git2.prototype.checkIgnore = function(pathnames, then) { - return this._runTask(checkIgnoreTask2(asArray2(filterType2(pathnames, filterStringOrStringArray2, []))), trailingFunctionArgument2(arguments)); + return this._runTask( + checkIgnoreTask2(asArray2(filterType2(pathnames, filterStringOrStringArray2, []))), + trailingFunctionArgument2(arguments) + ); }; Git2.prototype.checkIsRepo = function(checkType, then) { - return this._runTask(checkIsRepoTask2(filterType2(checkType, filterString2)), trailingFunctionArgument2(arguments)); + return this._runTask( + checkIsRepoTask2(filterType2(checkType, filterString2)), + trailingFunctionArgument2(arguments) + ); }; module2.exports = Git2; } @@ -120583,10 +121161,17 @@ function gitExportFactory(factory) { return Object.assign(factory.bind(null), api_exports); } function gitInstanceFactory(baseDir, options) { + var _a2; const plugins = new PluginStore(); - const config = createInstanceConfig(baseDir && (typeof baseDir === "string" ? { baseDir } : baseDir) || {}, options); + const config = createInstanceConfig( + baseDir && (typeof baseDir === "string" ? { baseDir } : baseDir) || {}, + options + ); if (!folderExists(config.baseDir)) { - throw new GitConstructError(config, `Cannot use simple-git on a directory that does not exist`); + throw new GitConstructError( + config, + `Cannot use simple-git on a directory that does not exist` + ); } if (Array.isArray(config.config)) { plugins.add(commandConfigPrefixingPlugin(config.config)); @@ -120600,11 +121185,13 @@ function gitInstanceFactory(baseDir, options) { config.spawnOptions && plugins.add(spawnOptionsPlugin(config.spawnOptions)); plugins.add(errorDetectionPlugin(errorDetectionHandler(true))); config.errors && plugins.add(errorDetectionPlugin(config.errors)); + customBinaryPlugin(plugins, config.binary, (_a2 = config.unsafe) == null ? void 0 : _a2.allowUnsafeCustomBinary); return new Git(config, plugins); } var Git; var init_git_factory = __esm({ "src/lib/git-factory.ts"() { + "use strict"; init_api(); init_plugins(); init_suffix_paths_plugin(); @@ -120632,22 +121219,27 @@ function gitP(...args) { function chainReturn() { return chain; } - const promiseApi = [...functionNamesBuilderApi, ...functionNamesPromiseApi].reduce((api, name) => { - const isAsync = functionNamesPromiseApi.includes(name); - const valid = isAsync ? asyncWrapper(name, git) : syncWrapper(name, git, api); - const alternative = isAsync ? chainReturn : builderReturn; - Object.defineProperty(api, name, { - enumerable: false, - configurable: false, - value: git ? valid : alternative - }); - return api; - }, {}); + const promiseApi = [...functionNamesBuilderApi, ...functionNamesPromiseApi].reduce( + (api, name) => { + const isAsync = functionNamesPromiseApi.includes(name); + const valid = isAsync ? asyncWrapper(name, git) : syncWrapper(name, git, api); + const alternative = isAsync ? chainReturn : builderReturn; + Object.defineProperty(api, name, { + enumerable: false, + configurable: false, + value: git ? valid : alternative + }); + return api; + }, + {} + ); return promiseApi; function asyncWrapper(fn, git2) { return function(...args2) { if (typeof args2[args2.length] === "function") { - throw new TypeError("Promise interface requires that handlers are not supplied inline, trailing function not allowed in call to " + fn); + throw new TypeError( + "Promise interface requires that handlers are not supplied inline, trailing function not allowed in call to " + fn + ); } return chain.then(function() { return new Promise(function(resolve, reject) { @@ -120682,6 +121274,7 @@ function toError(error) { var functionNamesBuilderApi, functionNamesPromiseApi; var init_promise_wrapped = __esm({ "src/lib/runners/promise-wrapped.ts"() { + "use strict"; init_git_response_error(); init_git_factory(); functionNamesBuilderApi = ["customBinary", "env", "outputHandler", "silent"]; diff --git a/package-lock.json b/package-lock.json index 22f1255..dcfa0b2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,7 +12,7 @@ "@actions/artifact": "^2.1.7", "@actions/core": "^1.10.1", "node-html-parser": "^6.1.13", - "simple-git": "^3.22.0", + "simple-git": "^3.24.0", "turndown": "^7.1.3", "turndown-plugin-gfm": "^1.0.2" }, @@ -7868,9 +7868,9 @@ "dev": true }, "node_modules/simple-git": { - "version": "3.22.0", - "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.22.0.tgz", - "integrity": "sha512-6JujwSs0ac82jkGjMHiCnTifvf1crOiY/+tfs/Pqih6iow7VrpNKRRNdWm6RtaXpvvv/JGNYhlUtLhGFqHF+Yw==", + "version": "3.24.0", + "resolved": "https://registry.npmjs.org/simple-git/-/simple-git-3.24.0.tgz", + "integrity": "sha512-QqAKee9Twv+3k8IFOFfPB2hnk6as6Y6ACUpwCtQvRYBAes23Wv3SZlHVobAzqcE8gfsisCvPw3HGW3HYM+VYYw==", "dependencies": { "@kwsites/file-exists": "^1.1.1", "@kwsites/promise-deferred": "^1.1.1", diff --git a/package.json b/package.json index 26108b9..338c65a 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,7 @@ "@actions/artifact": "^2.1.7", "@actions/core": "^1.10.1", "node-html-parser": "^6.1.13", - "simple-git": "^3.22.0", + "simple-git": "^3.24.0", "turndown": "^7.1.3", "turndown-plugin-gfm": "^1.0.2" },