@statewalker/vcs-commands 0.14.0 → 0.15.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/add-command.d.ts.map +1 -1
- package/dist/commands/add-patch/patch-backend.d.ts +1 -1
- package/dist/commands/add-patch/patch-backend.d.ts.map +1 -1
- package/dist/commands/archive/remote-archive-command.d.ts +4 -1
- package/dist/commands/archive/remote-archive-command.d.ts.map +1 -1
- package/dist/commands/branch-command.d.ts +14 -2
- package/dist/commands/branch-command.d.ts.map +1 -1
- package/dist/commands/cat-file/batch-format.d.ts +8 -12
- package/dist/commands/cat-file/batch-format.d.ts.map +1 -1
- package/dist/commands/cat-file/cat-file-command.d.ts +39 -5
- 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/checkout-command.d.ts +4 -0
- package/dist/commands/checkout-command.d.ts.map +1 -1
- package/dist/commands/checkout-paths.d.ts +9 -0
- package/dist/commands/checkout-paths.d.ts.map +1 -1
- package/dist/commands/cherry-pick-command.d.ts +3 -0
- package/dist/commands/cherry-pick-command.d.ts.map +1 -1
- package/dist/commands/clean-interactive.d.ts +0 -9
- package/dist/commands/clean-interactive.d.ts.map +1 -1
- package/dist/commands/clone-command.d.ts +2 -0
- package/dist/commands/clone-command.d.ts.map +1 -1
- package/dist/commands/column/column-config.d.ts +23 -0
- package/dist/commands/column/column-config.d.ts.map +1 -0
- package/dist/commands/column/column-layout.d.ts +129 -0
- package/dist/commands/column/column-layout.d.ts.map +1 -0
- package/dist/commands/column/index.d.ts +3 -0
- package/dist/commands/column/index.d.ts.map +1 -0
- package/dist/commands/column-command.d.ts +59 -0
- package/dist/commands/column-command.d.ts.map +1 -0
- package/dist/commands/comment-char-config.d.ts +15 -0
- package/dist/commands/comment-char-config.d.ts.map +1 -1
- package/dist/commands/commit-command.d.ts +21 -2
- package/dist/commands/commit-command.d.ts.map +1 -1
- package/dist/commands/config-command.d.ts +12 -0
- package/dist/commands/config-command.d.ts.map +1 -1
- package/dist/commands/credential-helper.d.ts +214 -0
- package/dist/commands/credential-helper.d.ts.map +1 -0
- package/dist/commands/default-branch.d.ts +17 -1
- package/dist/commands/default-branch.d.ts.map +1 -1
- package/dist/commands/diff-color-config.d.ts +4 -0
- package/dist/commands/diff-color-config.d.ts.map +1 -1
- package/dist/commands/diff-command.d.ts +12 -0
- package/dist/commands/diff-command.d.ts.map +1 -1
- package/dist/commands/fast-export/fast-export-command.d.ts +89 -2
- package/dist/commands/fast-export/fast-export-command.d.ts.map +1 -1
- package/dist/commands/fast-export/fast-import-command.d.ts +113 -8
- package/dist/commands/fast-export/fast-import-command.d.ts.map +1 -1
- package/dist/commands/fast-export/fast-stream-support.d.ts +0 -9
- package/dist/commands/fast-export/fast-stream-support.d.ts.map +1 -1
- package/dist/commands/fetch-command.d.ts +21 -0
- package/dist/commands/fetch-command.d.ts.map +1 -1
- package/dist/commands/git-hooks.d.ts +28 -0
- package/dist/commands/git-hooks.d.ts.map +1 -1
- package/dist/commands/history-command.d.ts +173 -7
- package/dist/commands/history-command.d.ts.map +1 -1
- package/dist/commands/index-host.d.ts +19 -0
- package/dist/commands/index-host.d.ts.map +1 -1
- package/dist/commands/index-refresh.d.ts +36 -0
- package/dist/commands/index-refresh.d.ts.map +1 -0
- package/dist/commands/index.d.ts +9 -0
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +7 -6
- package/dist/commands/init-command.d.ts +20 -0
- package/dist/commands/init-command.d.ts.map +1 -1
- package/dist/commands/local-transport.d.ts +29 -1
- package/dist/commands/local-transport.d.ts.map +1 -1
- package/dist/commands/log-command.d.ts +7 -0
- package/dist/commands/log-command.d.ts.map +1 -1
- package/dist/commands/log-output.d.ts +11 -0
- package/dist/commands/log-output.d.ts.map +1 -1
- package/dist/commands/maintenance-schedule-command.d.ts +122 -0
- package/dist/commands/maintenance-schedule-command.d.ts.map +1 -0
- package/dist/commands/merge-command.d.ts +2 -0
- package/dist/commands/merge-command.d.ts.map +1 -1
- package/dist/commands/merge-index-command.d.ts +42 -0
- package/dist/commands/merge-index-command.d.ts.map +1 -0
- package/dist/commands/merge-one-file.d.ts +129 -0
- package/dist/commands/merge-one-file.d.ts.map +1 -0
- package/dist/commands/merge-support.d.ts +21 -2
- package/dist/commands/merge-support.d.ts.map +1 -1
- package/dist/commands/object-disk-info.d.ts +35 -0
- package/dist/commands/object-disk-info.d.ts.map +1 -0
- package/dist/commands/octopus-merge.d.ts +3 -3
- package/dist/commands/octopus-merge.d.ts.map +1 -1
- package/dist/commands/promisor-remote.d.ts.map +1 -1
- package/dist/commands/pull-command.d.ts +55 -7
- package/dist/commands/pull-command.d.ts.map +1 -1
- package/dist/commands/push-command.d.ts +18 -1
- package/dist/commands/push-command.d.ts.map +1 -1
- package/dist/commands/range-diff/range-diff-command.d.ts +37 -1
- package/dist/commands/range-diff/range-diff-command.d.ts.map +1 -1
- package/dist/commands/rebase-command.d.ts +13 -1
- package/dist/commands/rebase-command.d.ts.map +1 -1
- package/dist/commands/ref-filter/for-each-ref-command.d.ts +3 -2
- package/dist/commands/ref-filter/for-each-ref-command.d.ts.map +1 -1
- package/dist/commands/ref-filter/ref-filter.d.ts.map +1 -1
- package/dist/commands/ref-filter/ref-format.d.ts +26 -1
- package/dist/commands/ref-filter/ref-format.d.ts.map +1 -1
- package/dist/commands/ref-filter/ref-listing-command.d.ts +9 -0
- package/dist/commands/ref-filter/ref-listing-command.d.ts.map +1 -1
- package/dist/commands/remote-transport.d.ts +27 -0
- package/dist/commands/remote-transport.d.ts.map +1 -1
- package/dist/commands/repack-command.d.ts +18 -2
- package/dist/commands/repack-command.d.ts.map +1 -1
- package/dist/commands/repo-command.d.ts +2 -7
- package/dist/commands/repo-command.d.ts.map +1 -1
- package/dist/commands/reset-command.d.ts +4 -1
- package/dist/commands/reset-command.d.ts.map +1 -1
- package/dist/commands/restore-command.d.ts.map +1 -1
- package/dist/commands/rev-list-command.d.ts +65 -0
- package/dist/commands/rev-list-command.d.ts.map +1 -1
- package/dist/commands/revert-command.d.ts +3 -0
- package/dist/commands/revert-command.d.ts.map +1 -1
- package/dist/commands/revision-filenames.d.ts.map +1 -1
- package/dist/commands/revision-range.d.ts +17 -0
- package/dist/commands/revision-range.d.ts.map +1 -1
- package/dist/commands/revision-resolver.d.ts +12 -0
- package/dist/commands/revision-resolver.d.ts.map +1 -1
- package/dist/commands/serve-repository.d.ts +17 -1
- package/dist/commands/serve-repository.d.ts.map +1 -1
- package/dist/commands/served-lazy-fetch.d.ts +61 -0
- package/dist/commands/served-lazy-fetch.d.ts.map +1 -0
- package/dist/commands/signing.d.ts +10 -4
- package/dist/commands/signing.d.ts.map +1 -1
- package/dist/commands/status-color-config.d.ts +33 -0
- package/dist/commands/status-color-config.d.ts.map +1 -0
- package/dist/commands/status-command.d.ts +15 -0
- package/dist/commands/status-command.d.ts.map +1 -1
- package/dist/commands/status-format.d.ts +46 -4
- package/dist/commands/status-format.d.ts.map +1 -1
- package/dist/commands/tag-command.d.ts +15 -1
- package/dist/commands/tag-command.d.ts.map +1 -1
- package/dist/commands/tree-restore.d.ts +14 -0
- package/dist/commands/tree-restore.d.ts.map +1 -1
- package/dist/commands/verify-command.d.ts +22 -2
- package/dist/commands/verify-command.d.ts.map +1 -1
- package/dist/commands/worktree-add-command.d.ts.map +1 -1
- package/dist/commands/worktree-overwrite-checks.d.ts +31 -6
- package/dist/commands/worktree-overwrite-checks.d.ts.map +1 -1
- package/dist/{commands-C9M78Chn.js → commands-DT3VEv50.js} +14879 -16703
- package/dist/errors/commit-errors.d.ts +23 -3
- package/dist/errors/commit-errors.d.ts.map +1 -1
- package/dist/errors/git-api-error.d.ts +6 -0
- package/dist/errors/git-api-error.d.ts.map +1 -1
- package/dist/errors/index.js +30 -4
- package/dist/{fsck-C4US3l0B.js → fsck-BZ508Elg.js} +1 -1
- package/dist/git-command.d.ts +33 -1
- package/dist/git-command.d.ts.map +1 -1
- package/dist/git.d.ts +104 -1
- package/dist/git.d.ts.map +1 -1
- package/dist/index.js +8 -7
- package/dist/{remote-transport-C43eykfK.js → local-transport-D98U6p4d.js} +184 -683
- package/dist/{maintenance-run-command-CoJFKr2p.js → maintenance-run-command-DZFnbnbo.js} +2285 -79
- package/dist/remote-config/remote-config-store.d.ts +6 -0
- package/dist/remote-config/remote-config-store.d.ts.map +1 -1
- package/dist/remote-transport-zvSqwpOB.js +4865 -0
- package/dist/results/cherry-pick-result.d.ts +4 -3
- package/dist/results/cherry-pick-result.d.ts.map +1 -1
- package/dist/results/diff-output.d.ts +7 -0
- package/dist/results/diff-output.d.ts.map +1 -1
- package/dist/results/diff-words.d.ts +14 -3
- package/dist/results/diff-words.d.ts.map +1 -1
- package/dist/results/index.js +1 -1
- package/dist/results/line-prefix-sink.d.ts +50 -0
- package/dist/results/line-prefix-sink.d.ts.map +1 -0
- package/dist/results/merge-result.d.ts +4 -3
- package/dist/results/merge-result.d.ts.map +1 -1
- package/dist/results/rebase-result.d.ts +5 -0
- package/dist/results/rebase-result.d.ts.map +1 -1
- package/dist/results/revert-result.d.ts +4 -3
- package/dist/results/revert-result.d.ts.map +1 -1
- package/dist/{results-B0CWLCAp.js → results-rF81cQse.js} +1425 -202
- package/dist/transport-command.d.ts +10 -0
- package/dist/transport-command.d.ts.map +1 -1
- package/package.json +12 -12
- package/src/commands/add-command.ts +15 -2
- package/src/commands/add-patch/patch-backend.ts +6 -44
- package/src/commands/archive/remote-archive-command.ts +10 -3
- package/src/commands/branch-command.ts +57 -4
- package/src/commands/cat-file/batch-format.ts +17 -18
- package/src/commands/cat-file/cat-file-command.ts +181 -15
- package/src/commands/check-ignore-command.ts +61 -17
- package/src/commands/checkout-command.ts +149 -21
- package/src/commands/checkout-index-command.ts +2 -1
- package/src/commands/checkout-paths.ts +13 -0
- package/src/commands/cherry-pick-command.ts +9 -0
- package/src/commands/clean-interactive.ts +20 -74
- package/src/commands/clone-command.ts +13 -0
- package/src/commands/column/column-config.ts +63 -0
- package/src/commands/column/column-layout.ts +396 -0
- package/src/commands/column/index.ts +2 -0
- package/src/commands/column-command.ts +171 -0
- package/src/commands/comment-char-config.ts +42 -0
- package/src/commands/commit-command.ts +61 -21
- package/src/commands/config-command.ts +28 -0
- package/src/commands/credential-helper.ts +807 -0
- package/src/commands/default-branch.ts +38 -0
- package/src/commands/diff-color-config.ts +23 -10
- package/src/commands/diff-command.ts +25 -2
- package/src/commands/fast-export/fast-export-command.ts +661 -35
- package/src/commands/fast-export/fast-import-command.ts +694 -94
- package/src/commands/fast-export/fast-stream-support.ts +18 -1
- package/src/commands/fetch-command.ts +103 -14
- package/src/commands/git-hooks.ts +85 -0
- package/src/commands/history-command.ts +952 -20
- package/src/commands/index-host.ts +51 -0
- package/src/commands/index-refresh.ts +121 -0
- package/src/commands/index.ts +9 -0
- package/src/commands/init-command.ts +34 -1
- package/src/commands/legacy-remotes.ts +4 -20
- package/src/commands/local-transport.ts +130 -9
- package/src/commands/log-command.ts +39 -1
- package/src/commands/log-output.ts +31 -4
- package/src/commands/maintenance-schedule-command.ts +418 -0
- package/src/commands/merge-command.ts +10 -0
- package/src/commands/merge-index-command.ts +202 -0
- package/src/commands/merge-one-file.ts +451 -0
- package/src/commands/merge-support.ts +127 -11
- package/src/commands/object-disk-info.ts +169 -0
- package/src/commands/octopus-merge.ts +37 -128
- package/src/commands/promisor-remote.ts +14 -3
- package/src/commands/pull-command.ts +173 -27
- package/src/commands/push-command.ts +50 -5
- package/src/commands/range-diff/range-diff-command.ts +86 -3
- package/src/commands/rebase-command.ts +46 -1
- package/src/commands/ref-filter/for-each-ref-command.ts +4 -3
- package/src/commands/ref-filter/ref-filter.ts +59 -4
- package/src/commands/ref-filter/ref-format.ts +83 -10
- package/src/commands/ref-filter/ref-listing-command.ts +30 -0
- package/src/commands/remote-command.ts +2 -2
- package/src/commands/remote-transport.ts +66 -3
- package/src/commands/repack-command.ts +75 -9
- package/src/commands/repo-command.ts +6 -70
- package/src/commands/reset-command.ts +11 -1
- package/src/commands/restore-command.ts +1 -0
- package/src/commands/rev-list-command.ts +205 -3
- package/src/commands/revert-command.ts +9 -0
- package/src/commands/revision-filenames.ts +32 -4
- package/src/commands/revision-range.ts +2 -2
- package/src/commands/revision-resolver.ts +21 -1
- package/src/commands/serve-repository.ts +34 -8
- package/src/commands/served-lazy-fetch.ts +164 -0
- package/src/commands/signing.ts +18 -10
- package/src/commands/status-color-config.ts +92 -0
- package/src/commands/status-command.ts +50 -2
- package/src/commands/status-format.ts +198 -50
- package/src/commands/tag-command.ts +57 -2
- package/src/commands/tree-restore.ts +17 -0
- package/src/commands/verify-command.ts +84 -12
- package/src/commands/worktree-add-command.ts +2 -0
- package/src/commands/worktree-overwrite-checks.ts +75 -14
- package/src/errors/commit-errors.ts +31 -3
- package/src/errors/git-api-error.ts +7 -0
- package/src/git-command.ts +105 -4
- package/src/git.ts +153 -0
- package/src/remote-config/remote-config-store.ts +16 -0
- package/src/results/cherry-pick-result.ts +4 -3
- package/src/results/diff-output.ts +8 -0
- package/src/results/diff-words.ts +160 -32
- package/src/results/line-prefix-sink.ts +102 -0
- package/src/results/merge-result.ts +4 -3
- package/src/results/rebase-result.ts +5 -0
- package/src/results/revert-result.ts +4 -3
- package/src/transport-command.ts +48 -2
|
@@ -37,6 +37,7 @@ import { decodeGitPath, encodeGitPath, gitCharWidth } from "@statewalker/vcs-uti
|
|
|
37
37
|
import { InvalidArgumentError } from "../errors/index.js";
|
|
38
38
|
import type { DiffColors } from "../results/diff-color.js";
|
|
39
39
|
import { ChangeType } from "../results/diff-entry.js";
|
|
40
|
+
import { insertLinePrefix } from "../results/line-prefix-sink.js";
|
|
40
41
|
import { type DateMode, DEFAULT_DATE_MODE, parseDateMode, showDate } from "./date-format.js";
|
|
41
42
|
import { type DiffOutputFormat, type DiffTextOptions, hasPickaxe } from "./diff-command.js";
|
|
42
43
|
import { LogGraph } from "./log-graph.js";
|
|
@@ -351,11 +352,24 @@ export interface LogOutputHost {
|
|
|
351
352
|
entry: LogOutputEntry,
|
|
352
353
|
parent: ObjectId | undefined,
|
|
353
354
|
formats: DiffOutputFormat[],
|
|
354
|
-
options: {
|
|
355
|
+
options: {
|
|
356
|
+
statWidth?: number;
|
|
357
|
+
follow?: string;
|
|
358
|
+
fullDiff?: boolean;
|
|
359
|
+
abbrev?: number;
|
|
360
|
+
/**
|
|
361
|
+
* diff.c's `diff_line_prefix` (the graph's padding) is inserted by the log: a host
|
|
362
|
+
* may say where with `prefixPoints` (git's word diff leaves it out of most lines);
|
|
363
|
+
* without them the log prefixes every line
|
|
364
|
+
*/
|
|
365
|
+
linePrefix?: boolean;
|
|
366
|
+
},
|
|
355
367
|
): Promise<{
|
|
356
368
|
bytes?: Uint8Array;
|
|
357
369
|
followPath?: string;
|
|
358
370
|
followChange?: ChangeType.RENAME | ChangeType.COPY;
|
|
371
|
+
/** The offsets in `bytes` where the line prefix goes, ascending */
|
|
372
|
+
prefixPoints?: readonly number[];
|
|
359
373
|
}>;
|
|
360
374
|
/**
|
|
361
375
|
* The combined diff of a merge (`-c`, `--cc`): the paths that differ from every parent,
|
|
@@ -376,10 +390,12 @@ export interface LogOutputHost {
|
|
|
376
390
|
follow?: string;
|
|
377
391
|
fullDiff?: boolean;
|
|
378
392
|
abbrev?: number;
|
|
393
|
+
/** As {@link LogOutputHost.diff}'s */
|
|
394
|
+
linePrefix?: boolean;
|
|
379
395
|
/** The commits the log has processed before this one (git 2.43 freed their parents) */
|
|
380
396
|
processed?: ReadonlySet<ObjectId>;
|
|
381
397
|
},
|
|
382
|
-
): Promise<{ bytes?: Uint8Array; followPath?: string }>;
|
|
398
|
+
): Promise<{ bytes?: Uint8Array; followPath?: string; prefixPoints?: readonly number[] }>;
|
|
383
399
|
combinedDiff(
|
|
384
400
|
entry: LogOutputEntry,
|
|
385
401
|
options: {
|
|
@@ -1286,6 +1302,7 @@ export class LogPrinter {
|
|
|
1286
1302
|
const width = this.graph ? this.graph.getWidth() : 0;
|
|
1287
1303
|
const diffOptions = {
|
|
1288
1304
|
...(width ? { statWidth: 80 - width } : {}),
|
|
1305
|
+
...(this.graph ? { linePrefix: true } : {}),
|
|
1289
1306
|
...(this.follow && this.followPath !== undefined ? { follow: this.followPath } : {}),
|
|
1290
1307
|
...(this.options.fullDiff ? { fullDiff: true } : {}),
|
|
1291
1308
|
...this.diffAbbrev(),
|
|
@@ -1293,7 +1310,11 @@ export class LogPrinter {
|
|
|
1293
1310
|
if (remerge && !this.host.remergeDiff) {
|
|
1294
1311
|
throw new Error("--remerge-diff: the log's host cannot re-merge");
|
|
1295
1312
|
}
|
|
1296
|
-
const result: {
|
|
1313
|
+
const result: {
|
|
1314
|
+
bytes?: Uint8Array;
|
|
1315
|
+
followPath?: string;
|
|
1316
|
+
prefixPoints?: readonly number[];
|
|
1317
|
+
} =
|
|
1297
1318
|
lineLog && this.host.lineLogDiff
|
|
1298
1319
|
? await this.host.lineLogDiff(entry, this.formats, this.diffAbbrev())
|
|
1299
1320
|
: remerge && this.host.remergeDiff
|
|
@@ -1319,7 +1340,13 @@ export class LogPrinter {
|
|
|
1319
1340
|
this.out.text("\n");
|
|
1320
1341
|
}
|
|
1321
1342
|
}
|
|
1322
|
-
|
|
1343
|
+
// the graph's padding once the commit's header is out (git's prefix callback runs then)
|
|
1344
|
+
const padding = this.padding();
|
|
1345
|
+
this.out.bytes(
|
|
1346
|
+
result.prefixPoints
|
|
1347
|
+
? insertLinePrefix(result.bytes, result.prefixPoints, bytesOf(padding))
|
|
1348
|
+
: prefixLines(result.bytes, padding),
|
|
1349
|
+
);
|
|
1323
1350
|
}
|
|
1324
1351
|
|
|
1325
1352
|
/** combine-diff.c's diff_tree_combined for a merge */
|
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `git maintenance register`, `unregister`, `start` and `stop` (builtin/gc.c's
|
|
3
|
+
* `maintenance_register`, `maintenance_unregister`, `maintenance_start`, `maintenance_stop`).
|
|
4
|
+
*
|
|
5
|
+
* register and unregister are configuration edits: the repository's path (its worktree top,
|
|
6
|
+
* the git directory when bare, real path) goes into, or out of, `maintenance.repo` of the
|
|
7
|
+
* global configuration or `--config-file`, and register turns the repository's foreground
|
|
8
|
+
* maintenance off (`maintenance.auto=false`) and gives it the `incremental` strategy unless
|
|
9
|
+
* one is set. Every edit goes through {@link ConfigCommand}, so the files' bytes are git's.
|
|
10
|
+
*
|
|
11
|
+
* start and stop drive the operating system's scheduler, which is the host's
|
|
12
|
+
* ({@link GitHostEnvironment.maintenanceScheduler}): start disables the runs of every other
|
|
13
|
+
* scheduler the host has, enables those of the chosen one, then registers; stop disables
|
|
14
|
+
* them on every scheduler and leaves the registration alone. Both hold
|
|
15
|
+
* `<objects>/schedule.lock` while they do. Without a host scheduler git finds none: start
|
|
16
|
+
* dies as git does, stop does nothing.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* await git.maintenanceRegister().call(); // { exitCode: 0, stderr: "" }
|
|
21
|
+
* await git.maintenanceUnregister().setForce(true).call();
|
|
22
|
+
* await git.maintenanceStart().setScheduler("crontab").call(); // needs a host scheduler
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import { atomicFilesOver } from "@statewalker/vcs-utils/files";
|
|
27
|
+
import type {
|
|
28
|
+
GitHostEnvironment,
|
|
29
|
+
MaintenanceFrequency,
|
|
30
|
+
MaintenanceScheduleRequest,
|
|
31
|
+
MaintenanceSchedulerName,
|
|
32
|
+
} from "@statewalker/vcs-working-tree";
|
|
33
|
+
import { expandUserPath } from "@statewalker/vcs-working-tree";
|
|
34
|
+
import { GitApiError } from "../errors/index.js";
|
|
35
|
+
import { GitCommand } from "../git-command.js";
|
|
36
|
+
import { ConfigCommand } from "./config-command.js";
|
|
37
|
+
import { hookHostOf } from "./git-hooks.js";
|
|
38
|
+
import { hostEnvironmentOf } from "./git-ident.js";
|
|
39
|
+
import { objectsDirectoryDisplay } from "./object-store/objects-directory.js";
|
|
40
|
+
import { worktreeHostPath } from "./submodule-model.js";
|
|
41
|
+
|
|
42
|
+
/** How a maintenance subcommand ended, as git's process. */
|
|
43
|
+
export interface MaintenanceScheduleResult {
|
|
44
|
+
/** git's exit status: 0, 128 for a death, 129 for a usage error, 255 for an `error()` return */
|
|
45
|
+
exitCode: number;
|
|
46
|
+
/** git's stderr */
|
|
47
|
+
stderr: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const KEY = "maintenance.repo";
|
|
51
|
+
const FREQUENCIES: readonly MaintenanceFrequency[] = ["hourly", "daily", "weekly"];
|
|
52
|
+
/** builtin/gc.c's `scheduler_fn[]` order (after `SCHEDULER_AUTO`) */
|
|
53
|
+
const SCHEDULERS: readonly MaintenanceSchedulerName[] = [
|
|
54
|
+
"crontab",
|
|
55
|
+
"systemctl",
|
|
56
|
+
"launchctl",
|
|
57
|
+
"schtasks",
|
|
58
|
+
];
|
|
59
|
+
|
|
60
|
+
/** A death of git's: its stderr lines and exit status. */
|
|
61
|
+
class Death {
|
|
62
|
+
constructor(
|
|
63
|
+
readonly exitCode: number,
|
|
64
|
+
readonly lines: string[],
|
|
65
|
+
) {}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** The shared part: the repository's path, git's version, the config edits and deaths. */
|
|
69
|
+
abstract class MaintenanceScheduleBase extends GitCommand<MaintenanceScheduleResult> {
|
|
70
|
+
protected stderrLines: string[] = [];
|
|
71
|
+
|
|
72
|
+
protected get v243(): boolean {
|
|
73
|
+
return this.hooks.compatibility === "2.43";
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
async call(): Promise<MaintenanceScheduleResult> {
|
|
77
|
+
this.checkCallable();
|
|
78
|
+
this.setCallable(false);
|
|
79
|
+
let exitCode: number;
|
|
80
|
+
try {
|
|
81
|
+
exitCode = await this.run();
|
|
82
|
+
} catch (error) {
|
|
83
|
+
if (!(error instanceof Death)) throw error;
|
|
84
|
+
this.stderrLines.push(...error.lines);
|
|
85
|
+
exitCode = error.exitCode;
|
|
86
|
+
}
|
|
87
|
+
return { exitCode, stderr: this.stderrLines.map((l) => `${l}\n`).join("") };
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
protected abstract run(): Promise<number>;
|
|
91
|
+
|
|
92
|
+
/** git's `get_maintpath`: the real path of the worktree top, the git directory when bare. */
|
|
93
|
+
protected async maintPath(): Promise<string> {
|
|
94
|
+
// a bare repository's working copy has no `worktree` (and refuses to be asked for one)
|
|
95
|
+
const top =
|
|
96
|
+
"worktree" in this.workingCopy && this.worktreeAccess
|
|
97
|
+
? await worktreeHostPath(this.workingCopy)
|
|
98
|
+
: undefined;
|
|
99
|
+
if (top !== undefined) return top;
|
|
100
|
+
const layout = await hookHostOf(this.workingCopy).layout();
|
|
101
|
+
const root = (layout?.files as { rootDirectory?: string } | undefined)?.rootDirectory;
|
|
102
|
+
if (!layout || !root) {
|
|
103
|
+
throw new GitApiError("git maintenance needs the repository's path on the host");
|
|
104
|
+
}
|
|
105
|
+
const rest = layout.gitDir.replace(/^\/+|\/+$/g, "");
|
|
106
|
+
const path = `${root.replace(/\/+$/, "")}${rest ? `/${rest}` : ""}`;
|
|
107
|
+
const environment = hostEnvironmentOf(this.workingCopy);
|
|
108
|
+
return (await environment?.realPath?.(path).catch(() => undefined)) ?? path;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
/** A config command over this working copy, aimed at `--config-file`, else at `scope`. */
|
|
112
|
+
protected async config(
|
|
113
|
+
file: string | undefined,
|
|
114
|
+
scope: "local" | "global" | "all",
|
|
115
|
+
): Promise<ConfigCommand> {
|
|
116
|
+
const command = new ConfigCommand(this.workingCopy).setCompatibility(
|
|
117
|
+
this.v243 ? "2.43" : "2.56",
|
|
118
|
+
);
|
|
119
|
+
if (file !== undefined) return command.setFile(file);
|
|
120
|
+
if (scope === "local") return command;
|
|
121
|
+
if (scope === "all") return command;
|
|
122
|
+
// 2.43's `git_global_config(&user, &xdg)` writes `~/.gitconfig` (or $GIT_CONFIG_GLOBAL)
|
|
123
|
+
// even where only the XDG file exists; 2.5x's `git_global_config()` is ConfigCommand's
|
|
124
|
+
if (!this.v243) return command.setScope("global");
|
|
125
|
+
const environment = hostEnvironmentOf(this.workingCopy);
|
|
126
|
+
const path = environment?.globalConfig ?? expandUserPath("~/.gitconfig", environment);
|
|
127
|
+
if (path === undefined) throw new Death(128, ["fatal: $HOME not set"]);
|
|
128
|
+
return command.setFile(path);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* `repo_config_get_string_multi` (or a config set of one file): the values, or undefined
|
|
133
|
+
* when a key without a value makes git refuse the list (`error: missing value for ...`).
|
|
134
|
+
*/
|
|
135
|
+
protected async repoValues(file: string | undefined): Promise<string[] | undefined> {
|
|
136
|
+
const values = await (await this.config(file, "all")).get(KEY).callValues();
|
|
137
|
+
if (values.some((v) => v === undefined)) {
|
|
138
|
+
this.stderrLines.push(`error: missing value for '${KEY}'`);
|
|
139
|
+
return undefined;
|
|
140
|
+
}
|
|
141
|
+
return values as string[];
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/** `repo_config_set`: the repository's config set, or git's death. */
|
|
145
|
+
protected async setLocal(key: string, value: string): Promise<void> {
|
|
146
|
+
const outcome = await (await this.config(undefined, "local")).set(key, value).call();
|
|
147
|
+
if (outcome.exitCode !== 0) {
|
|
148
|
+
throw new Death(128, [
|
|
149
|
+
...lines(outcome.stderr),
|
|
150
|
+
`fatal: could not set '${key}' to '${value}'`,
|
|
151
|
+
]);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/** maintenance_register's body after its options: the local settings, then the path. */
|
|
156
|
+
protected async register(file: string | undefined): Promise<void> {
|
|
157
|
+
const path = await this.maintPath();
|
|
158
|
+
await this.setLocal("maintenance.auto", "false");
|
|
159
|
+
const strategy = await (await this.config(undefined, "all"))
|
|
160
|
+
.get("maintenance.strategy")
|
|
161
|
+
.callValues();
|
|
162
|
+
if (strategy.length === 0) await this.setLocal("maintenance.strategy", "incremental");
|
|
163
|
+
const values = await this.repoValues(undefined);
|
|
164
|
+
if (values?.includes(path)) return;
|
|
165
|
+
const outcome = await (await this.config(file, "global")).add(KEY, path).call();
|
|
166
|
+
if (outcome.exitCode !== 0) {
|
|
167
|
+
throw new Death(128, [
|
|
168
|
+
...lines(outcome.stderr),
|
|
169
|
+
`fatal: unable to add '${KEY}' value of '${path}'`,
|
|
170
|
+
]);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* update_background_schedule: under `<objects>/schedule.lock`, every available scheduler
|
|
176
|
+
* but the one enabled told to disable (their failures ignored), then the chosen one to
|
|
177
|
+
* enable. Returns git's result: 0, or -1 for a failure.
|
|
178
|
+
*/
|
|
179
|
+
protected async updateSchedule(enable: MaintenanceSchedulerName | undefined): Promise<number> {
|
|
180
|
+
const objects = await this.hooks.commonGitFile("objects");
|
|
181
|
+
if (!objects) throw new GitApiError("git maintenance needs a files repository");
|
|
182
|
+
const atomic = atomicFilesOver(objects.files, objects.path);
|
|
183
|
+
if (!(await atomic.createExclusive("schedule.lock", new Uint8Array(0)))) {
|
|
184
|
+
if (this.v243) {
|
|
185
|
+
this.stderrLines.push("error: another process is scheduling background maintenance");
|
|
186
|
+
} else {
|
|
187
|
+
// absolute_path("<objects>/schedule"): the objects directory as git names it, from
|
|
188
|
+
// where git runs (the worktree top, the git directory when bare)
|
|
189
|
+
const display = await objectsDirectoryDisplay(this.hooks, this.workingCopy);
|
|
190
|
+
const base = display.startsWith("/") ? display : `${await this.maintPath()}/${display}`;
|
|
191
|
+
const lockPath = `${base}/schedule.lock`;
|
|
192
|
+
this.stderrLines.push(
|
|
193
|
+
`error: unable to create '${lockPath}': File exists.`,
|
|
194
|
+
"",
|
|
195
|
+
"Another scheduled git-maintenance(1) process seems to be running in this",
|
|
196
|
+
"repository. Please make sure no other maintenance processes are running and",
|
|
197
|
+
"then try again. If it still fails, a git-maintenance(1) process may have",
|
|
198
|
+
"crashed in this repository earlier: remove the file manually to continue.",
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
return -1;
|
|
202
|
+
}
|
|
203
|
+
try {
|
|
204
|
+
const host = hostEnvironmentOf(this.workingCopy)?.maintenanceScheduler;
|
|
205
|
+
if (!host) return enable === undefined ? 0 : -1;
|
|
206
|
+
for (const scheduler of SCHEDULERS) {
|
|
207
|
+
if (scheduler === enable) continue;
|
|
208
|
+
if (!(await host.isAvailable(scheduler))) continue;
|
|
209
|
+
// git ignores what disabling another scheduler returns, but prints its errors
|
|
210
|
+
await this.askScheduler(this.request(scheduler, false));
|
|
211
|
+
}
|
|
212
|
+
if (enable === undefined) return 0;
|
|
213
|
+
return (await this.askScheduler(this.request(enable, true))) ? 0 : -1;
|
|
214
|
+
} finally {
|
|
215
|
+
await atomic.remove("schedule.lock");
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
private request(
|
|
220
|
+
scheduler: MaintenanceSchedulerName,
|
|
221
|
+
enable: boolean,
|
|
222
|
+
): MaintenanceScheduleRequest {
|
|
223
|
+
const v243 = this.v243;
|
|
224
|
+
return {
|
|
225
|
+
scheduler,
|
|
226
|
+
enable,
|
|
227
|
+
frequencies: FREQUENCIES,
|
|
228
|
+
command: (frequency) => [
|
|
229
|
+
...(v243 ? [] : ["-c", "credential.interactive=false", "-c", "core.askPass=true"]),
|
|
230
|
+
"for-each-repo",
|
|
231
|
+
...(v243 ? [] : ["--keep-going"]),
|
|
232
|
+
`--config=${KEY}`,
|
|
233
|
+
"maintenance",
|
|
234
|
+
"run",
|
|
235
|
+
`--schedule=${frequency}`,
|
|
236
|
+
],
|
|
237
|
+
minute: Math.floor(Math.random() * 60),
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
/** One scheduler update: whether it succeeded, its `error:` lines printed. */
|
|
242
|
+
private async askScheduler(request: MaintenanceScheduleRequest): Promise<boolean> {
|
|
243
|
+
const host = hostEnvironmentOf(this.workingCopy)?.maintenanceScheduler;
|
|
244
|
+
if (!host) return false;
|
|
245
|
+
const outcome = await host.updateSchedule(request);
|
|
246
|
+
if (outcome === undefined || outcome === true) return true;
|
|
247
|
+
if (outcome === false) return false;
|
|
248
|
+
this.stderrLines.push(...(outcome.errors ?? []));
|
|
249
|
+
return outcome.ok;
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
function lines(text: string): string[] {
|
|
254
|
+
return text === "" ? [] : text.replace(/\n$/, "").split("\n");
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
/**
|
|
258
|
+
* `git maintenance register [--config-file <path>]`: `maintenance.auto=false` and, when no
|
|
259
|
+
* strategy is configured, `maintenance.strategy=incremental` in the repository's config,
|
|
260
|
+
* then the repository's path added to `maintenance.repo` of the global configuration (or of
|
|
261
|
+
* {@link setConfigFile}) unless the whole configuration already lists it.
|
|
262
|
+
*/
|
|
263
|
+
export class MaintenanceRegisterCommand extends MaintenanceScheduleBase {
|
|
264
|
+
private configFile?: string;
|
|
265
|
+
|
|
266
|
+
/**
|
|
267
|
+
* `--config-file <path>`: the file the path is added to, an absolute host path or one
|
|
268
|
+
* relative to the worktree top. The "already registered" check still reads the whole
|
|
269
|
+
* configuration, as git's does.
|
|
270
|
+
*/
|
|
271
|
+
setConfigFile(path: string | undefined): this {
|
|
272
|
+
this.checkCallable();
|
|
273
|
+
this.configFile = path;
|
|
274
|
+
return this;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
protected async run(): Promise<number> {
|
|
278
|
+
await this.register(this.configFile);
|
|
279
|
+
return 0;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/**
|
|
284
|
+
* `git maintenance unregister [--config-file <path>] [--force]`: the repository's path
|
|
285
|
+
* removed from `maintenance.repo` of the global configuration (or of {@link setConfigFile},
|
|
286
|
+
* the only file then read), the section dropped when it empties. Dies
|
|
287
|
+
* `repository '<path>' is not registered` (128) when the configuration does not list it,
|
|
288
|
+
* unless {@link setForce}.
|
|
289
|
+
*/
|
|
290
|
+
export class MaintenanceUnregisterCommand extends MaintenanceScheduleBase {
|
|
291
|
+
private configFile?: string;
|
|
292
|
+
private force = false;
|
|
293
|
+
|
|
294
|
+
/** `--config-file <path>`: the only file read and written (absolute, or from the worktree top). */
|
|
295
|
+
setConfigFile(path: string | undefined): this {
|
|
296
|
+
this.checkCallable();
|
|
297
|
+
this.configFile = path;
|
|
298
|
+
return this;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
/** `--force`: success even when the repository is not registered. */
|
|
302
|
+
setForce(force: boolean): this {
|
|
303
|
+
this.checkCallable();
|
|
304
|
+
this.force = force;
|
|
305
|
+
return this;
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
protected async run(): Promise<number> {
|
|
309
|
+
const path = await this.maintPath();
|
|
310
|
+
const values = await this.repoValues(this.configFile);
|
|
311
|
+
if (values?.includes(path)) {
|
|
312
|
+
const outcome = await (await this.config(this.configFile, "global"))
|
|
313
|
+
.unset(KEY)
|
|
314
|
+
.setValuePattern(path)
|
|
315
|
+
.setFixedValue(true)
|
|
316
|
+
.setAll(true)
|
|
317
|
+
.call();
|
|
318
|
+
// CONFIG_NOTHING_SET (5): listed by another file than the one edited, fatal even forced
|
|
319
|
+
if (outcome.exitCode !== 0 && (!this.force || outcome.exitCode === 5)) {
|
|
320
|
+
throw new Death(128, [
|
|
321
|
+
...lines(outcome.stderr),
|
|
322
|
+
`fatal: unable to unset '${KEY}' value of '${path}'`,
|
|
323
|
+
]);
|
|
324
|
+
}
|
|
325
|
+
} else if (!this.force) {
|
|
326
|
+
throw new Death(128, [`fatal: repository '${path}' is not registered`]);
|
|
327
|
+
}
|
|
328
|
+
return 0;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/** `--scheduler` values git takes (`parse_scheduler`, case-insensitive). */
|
|
333
|
+
function parseScheduler(value: string): MaintenanceSchedulerName | "auto" | undefined {
|
|
334
|
+
switch (value.toLowerCase()) {
|
|
335
|
+
case "auto":
|
|
336
|
+
return "auto";
|
|
337
|
+
case "cron":
|
|
338
|
+
case "crontab":
|
|
339
|
+
return "crontab";
|
|
340
|
+
case "systemd":
|
|
341
|
+
case "systemd-timer":
|
|
342
|
+
return "systemctl";
|
|
343
|
+
case "launchctl":
|
|
344
|
+
return "launchctl";
|
|
345
|
+
case "schtasks":
|
|
346
|
+
return "schtasks";
|
|
347
|
+
default:
|
|
348
|
+
return undefined;
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* `git maintenance start [--scheduler=<scheduler>]`: the host scheduler
|
|
354
|
+
* ({@link GitHostEnvironment.maintenanceScheduler}) told to remove the runs of every other
|
|
355
|
+
* scheduler it has and to schedule the hourly, daily and weekly runs on the chosen one, then
|
|
356
|
+
* the repository registered ({@link MaintenanceRegisterCommand}). `auto` (the default) picks
|
|
357
|
+
* by the host's `systemName` as git does by its build: launchctl on Darwin, schtasks on
|
|
358
|
+
* Windows, systemd timers else crontab on Linux, crontab elsewhere.
|
|
359
|
+
*/
|
|
360
|
+
export class MaintenanceStartCommand extends MaintenanceScheduleBase {
|
|
361
|
+
private scheduler = "auto";
|
|
362
|
+
|
|
363
|
+
/** `--scheduler=<scheduler>`: auto, crontab (cron), systemd (systemd-timer), launchctl, schtasks. */
|
|
364
|
+
setScheduler(scheduler: string): this {
|
|
365
|
+
this.checkCallable();
|
|
366
|
+
this.scheduler = scheduler;
|
|
367
|
+
return this;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
protected async run(): Promise<number> {
|
|
371
|
+
const parsed = parseScheduler(this.scheduler);
|
|
372
|
+
if (parsed === undefined) {
|
|
373
|
+
throw new Death(129, [`error: unrecognized --scheduler argument '${this.scheduler}'`]);
|
|
374
|
+
}
|
|
375
|
+
const scheduler = await this.resolve(parsed);
|
|
376
|
+
if (!(await this.available(scheduler))) {
|
|
377
|
+
throw new Death(128, [`fatal: ${scheduler} scheduler is not available`]);
|
|
378
|
+
}
|
|
379
|
+
if ((await this.updateSchedule(scheduler)) !== 0) {
|
|
380
|
+
throw new Death(128, ["fatal: failed to set up maintenance schedule"]);
|
|
381
|
+
}
|
|
382
|
+
await this.register(undefined);
|
|
383
|
+
return 0;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
private async available(scheduler: MaintenanceSchedulerName): Promise<boolean> {
|
|
387
|
+
const host = hostEnvironmentOf(this.workingCopy)?.maintenanceScheduler;
|
|
388
|
+
return host ? await host.isAvailable(scheduler) : false;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
/** git's `resolve_scheduler`, by the host's system instead of git's build. */
|
|
392
|
+
private async resolve(
|
|
393
|
+
scheduler: MaintenanceSchedulerName | "auto",
|
|
394
|
+
): Promise<MaintenanceSchedulerName> {
|
|
395
|
+
if (scheduler !== "auto") return scheduler;
|
|
396
|
+
const system = (hostEnvironmentOf(this.workingCopy) as GitHostEnvironment | undefined)
|
|
397
|
+
?.systemName;
|
|
398
|
+
if (system === "Darwin") return "launchctl";
|
|
399
|
+
if (system !== undefined && /^windows/i.test(system)) return "schtasks";
|
|
400
|
+
if (system === "Linux") {
|
|
401
|
+
if (await this.available("systemctl")) return "systemctl";
|
|
402
|
+
if (await this.available("crontab")) return "crontab";
|
|
403
|
+
throw new Death(128, ["fatal: neither systemd timers nor crontab are available"]);
|
|
404
|
+
}
|
|
405
|
+
return "crontab";
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* `git maintenance stop`: the host scheduler told to remove the runs from every scheduler it
|
|
411
|
+
* has. The repository stays registered, as git leaves it. Exit 0 even with no scheduler
|
|
412
|
+
* (nothing to remove) or when a removal fails; 255 when another process holds the lock.
|
|
413
|
+
*/
|
|
414
|
+
export class MaintenanceStopCommand extends MaintenanceScheduleBase {
|
|
415
|
+
protected async run(): Promise<number> {
|
|
416
|
+
return (await this.updateSchedule(undefined)) === 0 ? 0 : 255;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
@@ -584,6 +584,11 @@ export class MergeCommand extends GitCommand<MergeResult> {
|
|
|
584
584
|
return this;
|
|
585
585
|
}
|
|
586
586
|
|
|
587
|
+
/** git sets `warn_on_auto_comment_char`: 2.5x warns of `core.commentChar=auto` here. */
|
|
588
|
+
protected override autoCommentCharWarningEntryPoints(): readonly string[] {
|
|
589
|
+
return ["call"];
|
|
590
|
+
}
|
|
591
|
+
|
|
587
592
|
/**
|
|
588
593
|
* Execute the merge.
|
|
589
594
|
*
|
|
@@ -674,7 +679,9 @@ export class MergeCommand extends GitCommand<MergeResult> {
|
|
|
674
679
|
{
|
|
675
680
|
const targetTree = await this.commits.getTree(mergeHead);
|
|
676
681
|
const target = await flatTree(this.trees, targetTree);
|
|
682
|
+
// pull_into_void's checkout_fast_forward: the commit merged, no ref
|
|
677
683
|
const refused = await switchTrees(this.context(worktree), new Map(), target, {
|
|
684
|
+
metadata: { treeish: mergeHead },
|
|
678
685
|
action: "merge",
|
|
679
686
|
operation: "merge",
|
|
680
687
|
targetTree,
|
|
@@ -723,6 +730,7 @@ export class MergeCommand extends GitCommand<MergeResult> {
|
|
|
723
730
|
const targetTree = await this.commits.getTree(to);
|
|
724
731
|
const target = await flatTree(this.trees, targetTree);
|
|
725
732
|
const refused = await switchTrees(this.context(worktree), head, target, {
|
|
733
|
+
metadata: { treeish: to },
|
|
726
734
|
action: "merge",
|
|
727
735
|
operation: "merge",
|
|
728
736
|
targetTree,
|
|
@@ -1063,7 +1071,9 @@ export class MergeCommand extends GitCommand<MergeResult> {
|
|
|
1063
1071
|
const headTree = await flatTree(this.trees, await this.commits.getTree(headId));
|
|
1064
1072
|
const srcTreeId = await this.commits.getTree(srcId);
|
|
1065
1073
|
const srcTree = await flatTree(this.trees, srcTreeId);
|
|
1074
|
+
// checkout_fast_forward's init_checkout_metadata: the commit merged, no ref
|
|
1066
1075
|
const refused = await switchTrees(this.context(worktree), headTree, srcTree, {
|
|
1076
|
+
metadata: { treeish: srcId },
|
|
1067
1077
|
action: "merge",
|
|
1068
1078
|
operation: "merge",
|
|
1069
1079
|
targetTree: srcTreeId,
|