@statewalker/vcs-commands 0.12.0 → 0.14.0
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/commands/archive/archive-command.d.ts +6 -2
- package/dist/commands/archive/archive-command.d.ts.map +1 -1
- package/dist/commands/archive/remote-archive-command.d.ts +23 -1
- package/dist/commands/archive/remote-archive-command.d.ts.map +1 -1
- package/dist/commands/archive/upload-archive-writer.d.ts +11 -5
- package/dist/commands/archive/upload-archive-writer.d.ts.map +1 -1
- package/dist/commands/bundle/bundle-format.d.ts +6 -1
- package/dist/commands/bundle/bundle-format.d.ts.map +1 -1
- package/dist/commands/bundle/bundle-uri-host.d.ts +12 -1
- package/dist/commands/bundle/bundle-uri-host.d.ts.map +1 -1
- package/dist/commands/bundle/bundle-uri.d.ts +7 -1
- package/dist/commands/bundle/bundle-uri.d.ts.map +1 -1
- package/dist/commands/bundle/bundle-verify.d.ts +4 -1
- package/dist/commands/bundle/bundle-verify.d.ts.map +1 -1
- package/dist/commands/cat-file/cat-file-command.d.ts.map +1 -1
- package/dist/commands/check-ignore-command.d.ts.map +1 -1
- package/dist/commands/clone-command.d.ts +15 -0
- package/dist/commands/clone-command.d.ts.map +1 -1
- package/dist/commands/commit-command.d.ts +10 -1
- package/dist/commands/commit-command.d.ts.map +1 -1
- package/dist/commands/default-branch.d.ts +17 -3
- package/dist/commands/default-branch.d.ts.map +1 -1
- package/dist/commands/fetch-command.d.ts +2 -1
- package/dist/commands/fetch-command.d.ts.map +1 -1
- package/dist/commands/fsck/fsck-object-checks.d.ts.map +1 -1
- package/dist/commands/git-hooks.d.ts +3 -3
- package/dist/commands/git-hooks.d.ts.map +1 -1
- package/dist/commands/http-config.d.ts +1 -1
- package/dist/commands/http-config.d.ts.map +1 -1
- package/dist/commands/index.js +6 -6
- package/dist/commands/init-command.d.ts.map +1 -1
- package/dist/commands/local-transport.d.ts +11 -1
- package/dist/commands/local-transport.d.ts.map +1 -1
- package/dist/commands/ls-tree-command.d.ts +10 -0
- package/dist/commands/ls-tree-command.d.ts.map +1 -1
- package/dist/commands/merge-command.d.ts +11 -1
- package/dist/commands/merge-command.d.ts.map +1 -1
- package/dist/commands/merge-support.d.ts +19 -2
- package/dist/commands/merge-support.d.ts.map +1 -1
- package/dist/commands/plumbing-input.d.ts.map +1 -1
- package/dist/commands/promisor-remote-reply.d.ts +31 -4
- package/dist/commands/promisor-remote-reply.d.ts.map +1 -1
- package/dist/commands/promisor-remote.d.ts +8 -1
- package/dist/commands/promisor-remote.d.ts.map +1 -1
- package/dist/commands/push-command.d.ts.map +1 -1
- package/dist/commands/ref-filter/index.d.ts +1 -0
- package/dist/commands/ref-filter/index.d.ts.map +1 -1
- package/dist/commands/ref-filter/peel-limit.d.ts +8 -0
- package/dist/commands/ref-filter/peel-limit.d.ts.map +1 -0
- package/dist/commands/ref-filter/ref-filter.d.ts.map +1 -1
- package/dist/commands/ref-filter/ref-format.d.ts.map +1 -1
- package/dist/commands/serve-repository.d.ts +4 -3
- package/dist/commands/serve-repository.d.ts.map +1 -1
- package/dist/commands/signing.d.ts +29 -2
- package/dist/commands/signing.d.ts.map +1 -1
- package/dist/commands/split-cmdline.d.ts +6 -0
- package/dist/commands/split-cmdline.d.ts.map +1 -0
- package/dist/{commands-C2E51T1z.js → commands-C9M78Chn.js} +1186 -1036
- package/dist/errors/commit-errors.d.ts +17 -1
- package/dist/errors/commit-errors.d.ts.map +1 -1
- package/dist/errors/index.js +18 -3
- package/dist/{fsck-BjlxStsM.js → fsck-C4US3l0B.js} +2 -2
- package/dist/index.js +7 -7
- package/dist/{maintenance-run-command-G_eWdA8O.js → maintenance-run-command-CoJFKr2p.js} +85 -33
- package/dist/{remote-transport-CSgTJ1BH.js → remote-transport-C43eykfK.js} +51 -16
- package/dist/results/index.js +1 -1
- package/dist/{results-Dg1KHG8y.js → results-B0CWLCAp.js} +398 -54
- package/dist/transport-command.d.ts +3 -0
- package/dist/transport-command.d.ts.map +1 -1
- package/package.json +21 -13
- package/src/commands/archive/archive-command.ts +7 -3
- package/src/commands/archive/remote-archive-command.ts +37 -3
- package/src/commands/archive/upload-archive-writer.ts +34 -22
- package/src/commands/bundle/bundle-format.ts +10 -2
- package/src/commands/bundle/bundle-uri-host.ts +71 -11
- package/src/commands/bundle/bundle-uri.ts +11 -4
- package/src/commands/bundle/bundle-verify.ts +4 -1
- package/src/commands/cat-file/cat-file-command.ts +1 -33
- package/src/commands/check-ignore-command.ts +60 -15
- package/src/commands/clone-command.ts +89 -11
- package/src/commands/commit-command.ts +42 -7
- package/src/commands/default-branch.ts +19 -5
- package/src/commands/fetch-command.ts +13 -2
- package/src/commands/fsck/fsck-object-checks.ts +3 -1
- package/src/commands/git-hooks.ts +11 -5
- package/src/commands/http-config.ts +47 -1
- package/src/commands/init-command.ts +24 -4
- package/src/commands/local-transport.ts +53 -9
- package/src/commands/ls-tree-command.ts +20 -12
- package/src/commands/merge-command.ts +32 -8
- package/src/commands/merge-support.ts +42 -4
- package/src/commands/plumbing-input.ts +3 -1
- package/src/commands/promisor-remote-reply.ts +338 -56
- package/src/commands/promisor-remote.ts +25 -3
- package/src/commands/push-command.ts +5 -1
- package/src/commands/read-tree-command.ts +2 -2
- package/src/commands/ref-filter/index.ts +1 -0
- package/src/commands/ref-filter/peel-limit.ts +7 -0
- package/src/commands/ref-filter/ref-filter.ts +9 -3
- package/src/commands/ref-filter/ref-format.ts +2 -1
- package/src/commands/repack-command.ts +1 -1
- package/src/commands/serve-repository.ts +8 -3
- package/src/commands/signing.ts +93 -10
- package/src/commands/split-cmdline.ts +32 -0
- package/src/errors/commit-errors.ts +24 -2
- package/src/transport-command.ts +31 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { I as __exportAll, m as receiveFsckOf } from "./fsck-
|
|
1
|
+
import { I as __exportAll, m as receiveFsckOf } from "./fsck-C4US3l0B.js";
|
|
2
2
|
import { GitApiError, InvalidConfigError, InvalidPathError, ReadTreeFailedError, TransportError as TransportError$1 } from "./errors/index.js";
|
|
3
|
-
import { $t as SubmoduleUnpack,
|
|
3
|
+
import { $t as SubmoduleUnpack, As as quoteCStyleBody, Il as hookSettingsFromEntries, In as checkSignatureWith, Jl as coreBool, Lt as resetMerge, Nl as hookHostOf, R as StatusCommand, Sl as worktreePathRules, Tl as LOCAL_REPO_ENV, Wc as SparseUnpack, Xa as signingConfigFromEntries, Xl as worktreeModeTrust, _l as restoreCaseOptions, bn as worktreeAdminWorkingCopy, ca as plainUnpackError, dl as untrackedUnder, en as recursesIntoSubmodules, fa as rewriteIndex, ga as switchTrees, gn as requireWorktrees, hn as repositoryPlaceOf, ia as flatTree, ju as RemoteConfigStore, la as planPathsRestore, nl as entryNotUptodate, ol as pruneEmptyParents, pn as parseExpiry, qc as pushSparseWarnings, ra as firstPlainError, sl as removeCaseVariants, tl as IndexCaseFolding, vl as writeTreeRestorePlan, wl as HookSession, xl as withTreePathRefusal, xn as worktreeUsingBranch, yl as firstInvalidPath, yn as usesBranch, yu as hostEnvironmentOf, za as GitCommand, zl as refTransactionHookOf } from "./results-B0CWLCAp.js";
|
|
4
4
|
import { FileMode, historyWithoutLazyFetch } from "@statewalker/vcs-core";
|
|
5
5
|
import { compareGitPaths, decodeGitPath, encodeGitPath, parseGitBool, parseGitInt } from "@statewalker/vcs-utils/encoding";
|
|
6
6
|
import { attributesIndexOf, cacheTreeOfTree, entryStatOf, isIndexUnborn, repairCacheTree, sparseFilterMatcher } from "@statewalker/vcs-working-tree";
|
|
@@ -44,7 +44,7 @@ const HEX = /^[0-9a-fA-F]$/;
|
|
|
44
44
|
* if (!parsed.ok) console.error(`error: ${parsed.error}`);
|
|
45
45
|
* ```
|
|
46
46
|
*/
|
|
47
|
-
function parseBundleHeader(bytes, name = "<bundle>") {
|
|
47
|
+
function parseBundleHeader(bytes, name = "<bundle>", defaultFormat = SHA1_OBJECT_FORMAT$1) {
|
|
48
48
|
let at = 0;
|
|
49
49
|
/** strbuf_getwholeline_fd: the next line with its LF; undefined at the end */
|
|
50
50
|
const nextLine = () => {
|
|
@@ -63,7 +63,7 @@ function parseBundleHeader(bytes, name = "<bundle>") {
|
|
|
63
63
|
error: `'${name}' does not look like a v2 or v3 bundle file`,
|
|
64
64
|
notABundle: true
|
|
65
65
|
};
|
|
66
|
-
let objectFormat =
|
|
66
|
+
let objectFormat = defaultFormat;
|
|
67
67
|
let filter;
|
|
68
68
|
const prerequisites = [];
|
|
69
69
|
const references = [];
|
|
@@ -202,8 +202,8 @@ async function bundleBytes(input) {
|
|
|
202
202
|
* builtin/bundle.c's `open_bundle` (`read_bundle_header`): the header and the pack, or git's
|
|
203
203
|
* `error:` line (the bundle reported as `name`: its path, `<stdin>` for `-`).
|
|
204
204
|
*/
|
|
205
|
-
function openBundle(bytes, name) {
|
|
206
|
-
const parsed = parseBundleHeader(bytes, name);
|
|
205
|
+
function openBundle(bytes, name, defaultFormat) {
|
|
206
|
+
const parsed = parseBundleHeader(bytes, name, defaultFormat);
|
|
207
207
|
if (!parsed.ok) return {
|
|
208
208
|
ok: false,
|
|
209
209
|
error: `error: ${parsed.error}\n`
|
|
@@ -1004,7 +1004,7 @@ var ReadTreeCommand = class extends GitCommand {
|
|
|
1004
1004
|
refused(refusal?.message, refusal?.paths);
|
|
1005
1005
|
} else if (treeIds.length === 2) {
|
|
1006
1006
|
const [h, m] = treeIds;
|
|
1007
|
-
const refusal = await switchTrees(sequencerCtx, await flatTree(this.trees, h), await flatTree(this.trees, m), {
|
|
1007
|
+
const refusal = await switchTrees(sequencerCtx, await flatTree(this.trees, h, { asIndex: true }), await flatTree(this.trees, m, { asIndex: true }), {
|
|
1008
1008
|
action: "merge",
|
|
1009
1009
|
operation: "read-tree",
|
|
1010
1010
|
update,
|
|
@@ -1511,25 +1511,53 @@ const NOT_A_REPOSITORY = (path) => `fatal: '${path}' does not appear to be a git
|
|
|
1511
1511
|
* A connected pair of in-memory duplex streams: what one side writes, the other reads. `end`
|
|
1512
1512
|
* half-closes a side (the other one reads to its end and can still answer); `close` ends it.
|
|
1513
1513
|
*/
|
|
1514
|
-
function createDuplexPair() {
|
|
1514
|
+
function createDuplexPair(options = {}) {
|
|
1515
|
+
const highWaterMark = options.highWaterMark;
|
|
1515
1516
|
const make = () => {
|
|
1516
1517
|
const queue = [];
|
|
1518
|
+
let queued = 0;
|
|
1517
1519
|
let ended = false;
|
|
1520
|
+
let abandoned = false;
|
|
1518
1521
|
let wake;
|
|
1522
|
+
let writers = [];
|
|
1523
|
+
const release = (error) => {
|
|
1524
|
+
const waiting = writers;
|
|
1525
|
+
writers = [];
|
|
1526
|
+
for (const w of waiting) if (error) w.reject(error);
|
|
1527
|
+
else w.resolve();
|
|
1528
|
+
};
|
|
1519
1529
|
const push = (chunk) => {
|
|
1520
1530
|
if (chunk === null) ended = true;
|
|
1521
|
-
else
|
|
1531
|
+
else {
|
|
1532
|
+
if (abandoned) return Promise.reject(/* @__PURE__ */ new Error("the stream's reader stopped"));
|
|
1533
|
+
queue.push(chunk);
|
|
1534
|
+
queued += chunk.length;
|
|
1535
|
+
}
|
|
1522
1536
|
wake?.();
|
|
1523
1537
|
wake = void 0;
|
|
1538
|
+
if (chunk === null || highWaterMark === void 0 || queued < highWaterMark) return;
|
|
1539
|
+
return new Promise((resolve, reject) => writers.push({
|
|
1540
|
+
resolve,
|
|
1541
|
+
reject
|
|
1542
|
+
}));
|
|
1543
|
+
};
|
|
1544
|
+
const abandon = () => {
|
|
1545
|
+
if (highWaterMark === void 0) return;
|
|
1546
|
+
abandoned = true;
|
|
1547
|
+
queue.length = 0;
|
|
1548
|
+
queued = 0;
|
|
1549
|
+
release(/* @__PURE__ */ new Error("the stream's reader stopped"));
|
|
1524
1550
|
};
|
|
1525
1551
|
async function* read() {
|
|
1526
1552
|
while (true) {
|
|
1527
1553
|
const next = queue.shift();
|
|
1528
1554
|
if (next) {
|
|
1555
|
+
queued -= next.length;
|
|
1556
|
+
if (highWaterMark === void 0 || queued < highWaterMark) release();
|
|
1529
1557
|
yield next;
|
|
1530
1558
|
continue;
|
|
1531
1559
|
}
|
|
1532
|
-
if (ended) return;
|
|
1560
|
+
if (ended || abandoned) return;
|
|
1533
1561
|
await new Promise((resolve) => {
|
|
1534
1562
|
wake = resolve;
|
|
1535
1563
|
});
|
|
@@ -1537,7 +1565,8 @@ function createDuplexPair() {
|
|
|
1537
1565
|
}
|
|
1538
1566
|
return {
|
|
1539
1567
|
push,
|
|
1540
|
-
read
|
|
1568
|
+
read,
|
|
1569
|
+
abandon
|
|
1541
1570
|
};
|
|
1542
1571
|
};
|
|
1543
1572
|
const a = make();
|
|
@@ -1557,17 +1586,23 @@ function createDuplexPair() {
|
|
|
1557
1586
|
return [{
|
|
1558
1587
|
[Symbol.asyncIterator]: () => a.read()[Symbol.asyncIterator](),
|
|
1559
1588
|
write: (data) => {
|
|
1560
|
-
if (!aClosed) b.push(data.slice());
|
|
1589
|
+
if (!aClosed) return b.push(data.slice());
|
|
1561
1590
|
},
|
|
1562
1591
|
end: endLeft,
|
|
1563
|
-
close:
|
|
1592
|
+
close: async () => {
|
|
1593
|
+
a.abandon();
|
|
1594
|
+
await endLeft();
|
|
1595
|
+
}
|
|
1564
1596
|
}, {
|
|
1565
1597
|
[Symbol.asyncIterator]: () => b.read()[Symbol.asyncIterator](),
|
|
1566
1598
|
write: (data) => {
|
|
1567
|
-
if (!bClosed) a.push(data.slice());
|
|
1599
|
+
if (!bClosed) return a.push(data.slice());
|
|
1568
1600
|
},
|
|
1569
1601
|
end: endRight,
|
|
1570
|
-
close:
|
|
1602
|
+
close: async () => {
|
|
1603
|
+
b.abandon();
|
|
1604
|
+
await endRight();
|
|
1605
|
+
}
|
|
1571
1606
|
}];
|
|
1572
1607
|
}
|
|
1573
1608
|
/**
|
|
@@ -1969,7 +2004,7 @@ function afterPushOf(remote, hooks) {
|
|
|
1969
2004
|
const result = await new GarbageCollectCommand(workingCopy).setAuto(true).setQuiet(true).call();
|
|
1970
2005
|
lines = [...result.errors ?? [], ...result.warnings ?? []];
|
|
1971
2006
|
} else {
|
|
1972
|
-
const { MaintenanceRunCommand } = await import("./maintenance-run-command-
|
|
2007
|
+
const { MaintenanceRunCommand } = await import("./maintenance-run-command-CoJFKr2p.js").then((n) => n.r);
|
|
1973
2008
|
lines = (await new MaintenanceRunCommand(workingCopy).setAuto(true).setQuiet(true).call()).stderr.split("\n").filter((l) => l.length > 0);
|
|
1974
2009
|
}
|
|
1975
2010
|
if (lines.length > 0) await ctx.message(`${lines.join("\n")}\n`);
|
package/dist/results/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as submoduleToken, $o as
|
|
1
|
+
import { $ as submoduleToken, $o as isConflictMarkerLine, Aa as createAddEntry, As as quoteCStyleBody, Bi as FastForwardMode, Bs as DEFAULT_DIFF_COLORS, Ca as DiffPickaxe, Cs as formatSummary, Da as DiffFormatter, Ds as utf8, Ea as parseOrderFile, Es as statSummary, Fa as DEFAULT_DIRSTAT, Fs as WORD_DIFF_MODES, Gs as WSEH_OLD, Hi as MergeStrategy, Hs as MovedLineBuffer, Ia as formatDirstat, Is as compileWordRegex, Js as parseColorMoved, Ks as coloredHunkHeader, La as parseDirstatParams, Ls as writeWordDiffHunks, Ma as createDeleteEntry, Ms as quoteTwo, Na as createModifyEntry, Ns as cutToLineRanges, Oa as diffEntryToPair, Os as writeHeaderOnlyPatch, Pa as createRenameEntry, Ps as lineRangesSpan, Q as formatStatusPorcelain, Qo as conflictMarkerSizeOf, Qs as wsErrorHighlightOf, Ra as writeCombinedDiff, Rs as COLOR_MOVED_MODE_ERROR, Ss as formatStat, Ta as orderRank, Ts as pprintRename, Ui as isMergeSuccessful, Us as WSEH_CONTEXT, Vi as MergeStatus, Vs as DIFF_COLOR_SLOTS, Ws as WSEH_NEW, Xs as parseWsErrorHighlight, Ys as parseColorMovedWs, Z as StatusImpl, Zo as DEFAULT_CONFLICT_MARKER_SIZE, Zs as writeColoredHunks, _ as formatBlamePorcelain, _s as formatNoIndexDiff, a as PushStatus, as as blobSide, ba as StashApplyStatus, bs as formatRawPair, c as isPullSuccessful, cs as contentSide, d as hasUpdates, ds as diffOptsContext, es as writePairCheck, f as CherryPickStatus, fs as displayWidth, g as formatBlameIncremental, gs as formatNameStatus, h as formatBlame, hs as formatNameOnly, i as isRebaseSuccessful, is as blobIdOf, ja as createCopyEntry, js as quotePath, ka as ChangeType, ks as writePairPatch, l as RefUpdateStatus, ls as countLines, m as formatAnnotate, ms as externalDiffMetainfo, n as RebaseAction, ns as LoadedSide, o as getFailedUpdates, os as computeDiffstat, p as BlameColorError, ps as driverOf, qs as diffColorSlotOf, r as RebaseStatus, rs as attrPathOf, s as isPushSuccessful, ss as contentDriver, t as RevertStatus, ts as GIT_DIFF_BIG_FILE_THRESHOLD, u as getSuccessfulUpdates, us as diffDriverOf, vs as formatNumstat, wa as orderByPatterns, ws as noIndexPair, xs as formatShortstat, ys as formatPatch, zi as ContentMergeStrategy, zs as COLOR_MOVED_WS_ALLOW_INDENTATION_CHANGE } from "../results-B0CWLCAp.js";
|
|
2
2
|
export { BlameColorError, COLOR_MOVED_MODE_ERROR, COLOR_MOVED_WS_ALLOW_INDENTATION_CHANGE, ChangeType, CherryPickStatus, ContentMergeStrategy, DEFAULT_CONFLICT_MARKER_SIZE, DEFAULT_DIFF_COLORS, DEFAULT_DIRSTAT, DIFF_COLOR_SLOTS, DiffFormatter, DiffPickaxe, FastForwardMode, GIT_DIFF_BIG_FILE_THRESHOLD, LoadedSide, MergeStatus, MergeStrategy, MovedLineBuffer, PushStatus, RebaseAction, RebaseStatus, RefUpdateStatus, RevertStatus, StashApplyStatus, StatusImpl, WORD_DIFF_MODES, WSEH_CONTEXT, WSEH_NEW, WSEH_OLD, attrPathOf, blobIdOf, blobSide, coloredHunkHeader, compileWordRegex, computeDiffstat, conflictMarkerSizeOf, contentDriver, contentSide, countLines, createAddEntry, createCopyEntry, createDeleteEntry, createModifyEntry, createRenameEntry, cutToLineRanges, diffColorSlotOf, diffDriverOf, diffEntryToPair, diffOptsContext, displayWidth, driverOf, externalDiffMetainfo, formatAnnotate, formatBlame, formatBlameIncremental, formatBlamePorcelain, formatDirstat, formatNameOnly, formatNameStatus, formatNoIndexDiff, formatNumstat, formatPatch, formatRawPair, formatShortstat, formatStat, formatStatusPorcelain, formatSummary, getFailedUpdates, getSuccessfulUpdates, hasUpdates, isConflictMarkerLine, isMergeSuccessful, isPullSuccessful, isPushSuccessful, isRebaseSuccessful, lineRangesSpan, noIndexPair, orderByPatterns, orderRank, parseColorMoved, parseColorMovedWs, parseDirstatParams, parseOrderFile, parseWsErrorHighlight, pprintRename, quoteCStyleBody, quotePath, quoteTwo, statSummary, submoduleToken, utf8, writeColoredHunks, writeCombinedDiff, writeHeaderOnlyPatch, writePairCheck, writePairPatch, writeWordDiffHunks, wsErrorHighlightOf };
|