worktree-add 1.3.9 → 1.3.10
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/cli/format-diverged-branch-message.d.ts +8 -0
- package/dist/cli/format-diverged-branch-message.d.ts.map +1 -0
- package/dist/cli/format-diverged-branch-message.js +20 -0
- package/dist/cli/format-diverged-branch-message.js.map +1 -0
- package/dist/cli/run-worktree-add.d.ts.map +1 -1
- package/dist/cli/run-worktree-add.js +6 -17
- package/dist/cli/run-worktree-add.js.map +1 -1
- package/dist/cli.d.ts +0 -8
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +0 -8
- package/dist/cli.js.map +1 -1
- package/dist/git/create-worktree.d.ts +0 -3
- package/dist/git/create-worktree.d.ts.map +1 -1
- package/dist/git/create-worktree.js +25 -18
- package/dist/git/create-worktree.js.map +1 -1
- package/dist/git/git.d.ts +0 -51
- package/dist/git/git.d.ts.map +1 -1
- package/dist/git/git.js +2 -55
- package/dist/git/git.js.map +1 -1
- package/dist/git/worktree-discovery.d.ts +0 -12
- package/dist/git/worktree-discovery.d.ts.map +1 -1
- package/dist/git/worktree-discovery.js +33 -32
- package/dist/git/worktree-discovery.js.map +1 -1
- package/dist/output/create-status-logger.d.ts +1 -0
- package/dist/output/create-status-logger.d.ts.map +1 -1
- package/dist/output/create-status-logger.js +5 -0
- package/dist/output/create-status-logger.js.map +1 -1
- package/dist/output/get-status-logger.d.ts.map +1 -1
- package/dist/output/get-status-logger.js +2 -10
- package/dist/output/get-status-logger.js.map +1 -1
- package/dist/project/install-commands.d.ts +2 -13
- package/dist/project/install-commands.d.ts.map +1 -1
- package/dist/project/install-commands.js +2 -12
- package/dist/project/install-commands.js.map +1 -1
- package/dist/project/next.d.ts +0 -5
- package/dist/project/next.d.ts.map +1 -1
- package/dist/project/next.js +0 -5
- package/dist/project/next.js.map +1 -1
- package/dist/project/package-manager-commands.d.ts +2 -6
- package/dist/project/package-manager-commands.d.ts.map +1 -1
- package/dist/project/package-manager-commands.js +2 -6
- package/dist/project/package-manager-commands.js.map +1 -1
- package/dist/project/package-manager-name.d.ts +6 -0
- package/dist/project/package-manager-name.d.ts.map +1 -0
- package/dist/project/package-manager-name.js +5 -0
- package/dist/project/package-manager-name.js.map +1 -0
- package/dist/project/package-manager.d.ts +0 -8
- package/dist/project/package-manager.d.ts.map +1 -1
- package/dist/project/package-manager.js +0 -15
- package/dist/project/package-manager.js.map +1 -1
- package/dist/project/setup.d.ts +0 -8
- package/dist/project/setup.d.ts.map +1 -1
- package/dist/project/setup.js +0 -9
- package/dist/project/setup.js.map +1 -1
- package/dist/worktree/destination-directory.d.ts +0 -8
- package/dist/worktree/destination-directory.d.ts.map +1 -1
- package/dist/worktree/destination-directory.js +59 -48
- package/dist/worktree/destination-directory.js.map +1 -1
- package/dist/worktree/file-patterns.d.ts +0 -5
- package/dist/worktree/file-patterns.d.ts.map +1 -1
- package/dist/worktree/file-patterns.js +0 -6
- package/dist/worktree/file-patterns.js.map +1 -1
- package/dist/worktree/untracked-file-copy.d.ts +0 -8
- package/dist/worktree/untracked-file-copy.d.ts.map +1 -1
- package/dist/worktree/untracked-file-copy.js +0 -8
- package/dist/worktree/untracked-file-copy.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
interface FormatDivergedBranchMessageOptions {
|
|
2
|
+
readonly branch: string;
|
|
3
|
+
readonly ahead: number;
|
|
4
|
+
readonly behind: number;
|
|
5
|
+
}
|
|
6
|
+
export declare function formatDivergedBranchMessage({ branch, ahead, behind }: FormatDivergedBranchMessageOptions): string;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=format-diverged-branch-message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-diverged-branch-message.d.ts","sourceRoot":"","sources":["../../src/cli/format-diverged-branch-message.ts"],"names":[],"mappings":"AAAA,UAAU,kCAAkC;IAC1C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAID,wBAAgB,2BAA2B,CAAC,EAC1C,MAAM,EACN,KAAK,EACL,MAAM,EACP,EAAE,kCAAkC,GAAG,MAAM,CAoB7C"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const quoteForShell = (value) => `'${value.replaceAll("'", "'\"'\"'")}'`;
|
|
2
|
+
export function formatDivergedBranchMessage({ branch, ahead, behind, }) {
|
|
3
|
+
const branchForShell = quoteForShell(branch);
|
|
4
|
+
const archivedBranchForShell = quoteForShell(`${branch}-old`);
|
|
5
|
+
return (`Local branch '${branch}' and origin/${branch} have diverged (ahead by ${ahead} and behind by ${behind}).\n` +
|
|
6
|
+
"This can mean either a stale local branch-name collision or legitimate local commits plus new remote commits.\n" +
|
|
7
|
+
"Refusing to reuse the local branch automatically.\n" +
|
|
8
|
+
"Note: commands below use POSIX shell quoting. On Windows cmd.exe/PowerShell, adapt quoting for your shell.\n" +
|
|
9
|
+
"If you want to keep local commits, use your local branch directly:\n" +
|
|
10
|
+
` git worktree add -- <path> ${branchForShell}\n` +
|
|
11
|
+
` # or merge/rebase '${branch}' with origin/${branch}, then retry.\n` +
|
|
12
|
+
"To work on the remote branch, run:\n" +
|
|
13
|
+
" git fetch origin --prune\n" +
|
|
14
|
+
" # if '<branch>-old' already exists, pick a different archive name.\n" +
|
|
15
|
+
` git branch -m -- ${branchForShell} ${archivedBranchForShell}\n` +
|
|
16
|
+
" # or delete the stale local branch instead:\n" +
|
|
17
|
+
` # git branch -D -- ${branchForShell}\n` +
|
|
18
|
+
` worktree-add -- ${branchForShell}`);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=format-diverged-branch-message.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-diverged-branch-message.js","sourceRoot":"","sources":["../../src/cli/format-diverged-branch-message.ts"],"names":[],"mappings":"AAMA,MAAM,aAAa,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,EAAE,SAAS,CAAC,GAAG,CAAC;AAEzF,MAAM,UAAU,2BAA2B,CAAC,EAC1C,MAAM,EACN,KAAK,EACL,MAAM,GAC6B;IACnC,MAAM,cAAc,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;IAC7C,MAAM,sBAAsB,GAAG,aAAa,CAAC,GAAG,MAAM,MAAM,CAAC,CAAC;IAE9D,OAAO,CACL,iBAAiB,MAAM,gBAAgB,MAAM,4BAA4B,KAAK,kBAAkB,MAAM,MAAM;QAC5G,iHAAiH;QACjH,qDAAqD;QACrD,8GAA8G;QAC9G,sEAAsE;QACtE,gCAAgC,cAAc,IAAI;QAClD,wBAAwB,MAAM,iBAAiB,MAAM,iBAAiB;QACtE,sCAAsC;QACtC,8BAA8B;QAC9B,wEAAwE;QACxE,sBAAsB,cAAc,IAAI,sBAAsB,IAAI;QAClE,iDAAiD;QACjD,wBAAwB,cAAc,IAAI;QAC1C,qBAAqB,cAAc,EAAE,CACtC,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-worktree-add.d.ts","sourceRoot":"","sources":["../../src/cli/run-worktree-add.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"run-worktree-add.d.ts","sourceRoot":"","sources":["../../src/cli/run-worktree-add.ts"],"names":[],"mappings":"AAcA,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,CAAC;IACxB,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAED,wBAAsB,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAuG1F"}
|
|
@@ -7,10 +7,10 @@ import { exitWithMessage } from "../git/git.js";
|
|
|
7
7
|
import { createWorktree } from "../git/create-worktree.js";
|
|
8
8
|
import { fetchRemoteBranch } from "../git/fetch-remote-branch.js";
|
|
9
9
|
import { cleanupWorktree } from "./cleanup-worktree.js";
|
|
10
|
+
import { formatDivergedBranchMessage } from "./format-diverged-branch-message.js";
|
|
10
11
|
import { openWorktreeApps } from "./open-worktree-apps.js";
|
|
11
12
|
import { registerSigintHandler } from "./register-sigint-handler.js";
|
|
12
13
|
import { resolveWorktreeContext } from "./resolve-worktree-context.js";
|
|
13
|
-
const quoteForShell = (value) => `'${value.replaceAll("'", "'\"'\"'")}'`;
|
|
14
14
|
export async function runWorktreeAdd(branchRaw, options) {
|
|
15
15
|
const dryRun = options.dryRun ?? false;
|
|
16
16
|
const verbose = options.verbose ?? false;
|
|
@@ -66,22 +66,11 @@ export async function runWorktreeAdd(branchRaw, options) {
|
|
|
66
66
|
}
|
|
67
67
|
if (remoteStatus.status === "diverged") {
|
|
68
68
|
const { ahead, behind } = remoteStatus.divergence;
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
"Note: commands below use POSIX shell quoting. On Windows cmd.exe/PowerShell, adapt quoting for your shell.\n" +
|
|
75
|
-
"If you want to keep local commits, use your local branch directly:\n" +
|
|
76
|
-
` git worktree add -- <path> ${branchForShell}\n` +
|
|
77
|
-
` # or merge/rebase '${context.branch}' with origin/${context.branch}, then retry.\n` +
|
|
78
|
-
"To work on the remote branch, run:\n" +
|
|
79
|
-
" git fetch origin --prune\n" +
|
|
80
|
-
" # if '<branch>-old' already exists, pick a different archive name.\n" +
|
|
81
|
-
` git branch -m -- ${branchForShell} ${archivedBranchForShell}\n` +
|
|
82
|
-
" # or delete the stale local branch instead:\n" +
|
|
83
|
-
` # git branch -D -- ${branchForShell}\n` +
|
|
84
|
-
` worktree-add -- ${branchForShell}`);
|
|
69
|
+
exitWithMessage(formatDivergedBranchMessage({
|
|
70
|
+
branch: context.branch,
|
|
71
|
+
ahead,
|
|
72
|
+
behind,
|
|
73
|
+
}));
|
|
85
74
|
}
|
|
86
75
|
// Only treat origin as existing when confirmed; "unknown" remains false.
|
|
87
76
|
const remoteBranchExists = remoteStatus.status === "exists";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"run-worktree-add.js","sourceRoot":"","sources":["../../src/cli/run-worktree-add.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,sCAAsC,CAAC;AAC/E,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,+BAA+B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+BAA+B,CAAC;AAWvE,MAAM,
|
|
1
|
+
{"version":3,"file":"run-worktree-add.js","sourceRoot":"","sources":["../../src/cli/run-worktree-add.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AACvE,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MAAM;SACP,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,eAAe,CAAC,gBAAgB,CAAC,CAAC;QAClC,MAAM,KAAK,CAAC;IACd,CAAC;YAAS,CAAC;QACT,uBAAuB,EAAE,CAAC;IAC5B,CAAC;AACH,CAAC"}
|
package/dist/cli.d.ts
CHANGED
|
@@ -1,11 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env -S node --experimental-strip-types
|
|
2
|
-
/**
|
|
3
|
-
* worktree-add.ts
|
|
4
|
-
*
|
|
5
|
-
* Create or reuse a Git worktree for <branch> as a sibling of the current worktree.
|
|
6
|
-
* Note: the destination is placed next to whichever worktree you run this from,
|
|
7
|
-
* except for submodule checkouts inside a superproject, where it is placed
|
|
8
|
-
* outside the superproject to avoid nesting the new worktree inside the parent repo.
|
|
9
|
-
*/
|
|
10
2
|
export {};
|
|
11
3
|
//# sourceMappingURL=cli.d.ts.map
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
CHANGED
|
@@ -1,12 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env -S node --experimental-strip-types
|
|
2
|
-
/**
|
|
3
|
-
* worktree-add.ts
|
|
4
|
-
*
|
|
5
|
-
* Create or reuse a Git worktree for <branch> as a sibling of the current worktree.
|
|
6
|
-
* Note: the destination is placed next to whichever worktree you run this from,
|
|
7
|
-
* except for submodule checkouts inside a superproject, where it is placed
|
|
8
|
-
* outside the superproject to avoid nesting the new worktree inside the parent repo.
|
|
9
|
-
*/
|
|
10
2
|
import { Command } from "@commander-js/extra-typings";
|
|
11
3
|
import packageJson from "../package.json" with { type: "json" };
|
|
12
4
|
import { runWorktreeAdd } from "./cli/run-worktree-add.js";
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,WAAW,MAAM,iBAAiB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAG3D,SAAS,UAAU,CAAC,GAAW,EAAE,QAA8B;IAC7D,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC;AACpC,CAAC;AAED,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE;KAC1B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;KACtB,WAAW,CACV,2IAA2I,CAC5I;KACA,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC;KAC5B,QAAQ,CAAC,UAAU,EAAE,8BAA8B,CAAC;KACpD,MAAM,CAAC,kBAAkB,EAAE,0CAA0C,EAAE,UAAU,CAAC;KAClF,MAAM,CACL,WAAW,EACX,iHAAiH,CAClH;KACA,MAAM,CAAC,WAAW,EAAE,oDAAoD,CAAC;KACzE,MAAM,CAAC,WAAW,EAAE,+CAA+C,CAAC;KACpE,MAAM,CAAC,eAAe,EAAE,6CAA6C,CAAC;KACtE,MAAM,CAAC,WAAW,EAAE,kCAAkC,CAAC;KACvD,kBAAkB,CAAC,yCAAyC,CAAC;KAC7D,wBAAwB,EAAE;KAC1B,WAAW,CACV,OAAO,EACP;;;;;;;;;;;;;;;;CAgBH,CACE;KACA,MAAM,CAAC,KAAK,EAAE,MAAc,EAAE,OAAmB,EAAE,EAAE;IACpD,IAAI,CAAC;QACH,MAAM,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC;IAAC,OAAO,KAAc,EAAE,CAAC;QACxB,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;YACpB,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACvB,CAAC;aAAM,CAAC;YACN,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YACvE,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACzB,CAAC;QACD,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC;AACH,CAAC,CAAC,CAAC;AAEL,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC;IACxB,MAAM,OAAO,CAAC,UAAU,EAAE,CAAC;AAC7B,CAAC"}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import type { StatusLogger } from "../output/create-status-logger.js";
|
|
2
|
-
/**
|
|
3
|
-
* Create a worktree for the given branch at the specified destination.
|
|
4
|
-
*/
|
|
5
2
|
export declare function createWorktree(branch: string, destinationDirectory: string, options?: {
|
|
6
3
|
remoteBranchExists?: boolean;
|
|
7
4
|
dryRun?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-worktree.d.ts","sourceRoot":"","sources":["../../src/git/create-worktree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;
|
|
1
|
+
{"version":3,"file":"create-worktree.d.ts","sourceRoot":"","sources":["../../src/git/create-worktree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAgBtE,wBAAgB,cAAc,CAC5B,MAAM,EAAE,MAAM,EACd,oBAAoB,EAAE,MAAM,EAC5B,OAAO,CAAC,EAAE;IACR,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB,GACA,IAAI,CAkDN"}
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
import { getStatusLogger } from "../output/get-status-logger.js";
|
|
2
2
|
import { git, localBranchExists, normalizeBranchName, remoteBranchExists } from "./git.js";
|
|
3
3
|
import { extractDiagnosticLine } from "./extract-diagnostic-line.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
const runGitWorktreeCommand = (args, options) => {
|
|
5
|
+
options.logger.step(`${options.dryRun ? "Would run " : ""}git ${args.join(" ")}`);
|
|
6
|
+
if (options.dryRun) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
git(...args);
|
|
10
|
+
};
|
|
7
11
|
export function createWorktree(branch, destinationDirectory, options) {
|
|
8
12
|
const logger = getStatusLogger(options?.logger);
|
|
9
13
|
const dryRun = options?.dryRun ?? false;
|
|
10
14
|
const normalized = normalizeBranchName(branch);
|
|
11
15
|
if (localBranchExists(normalized)) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
git("worktree", "add", "--", destinationDirectory, `refs/heads/${normalized}`);
|
|
16
|
+
runGitWorktreeCommand(["worktree", "add", "--", destinationDirectory, `refs/heads/${normalized}`], {
|
|
17
|
+
dryRun,
|
|
18
|
+
logger,
|
|
19
|
+
});
|
|
17
20
|
return;
|
|
18
21
|
}
|
|
19
22
|
let branchExistsOnOrigin = options?.remoteBranchExists;
|
|
@@ -27,17 +30,21 @@ export function createWorktree(branch, destinationDirectory, options) {
|
|
|
27
30
|
}
|
|
28
31
|
}
|
|
29
32
|
if (branchExistsOnOrigin) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
runGitWorktreeCommand([
|
|
34
|
+
"worktree",
|
|
35
|
+
"add",
|
|
36
|
+
"--track",
|
|
37
|
+
"-b",
|
|
38
|
+
normalized,
|
|
39
|
+
"--",
|
|
40
|
+
destinationDirectory,
|
|
41
|
+
`origin/${normalized}`,
|
|
42
|
+
], { dryRun, logger });
|
|
39
43
|
return;
|
|
40
44
|
}
|
|
41
|
-
|
|
45
|
+
runGitWorktreeCommand(["worktree", "add", "-b", normalized, "--", destinationDirectory], {
|
|
46
|
+
dryRun,
|
|
47
|
+
logger,
|
|
48
|
+
});
|
|
42
49
|
}
|
|
43
50
|
//# sourceMappingURL=create-worktree.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-worktree.js","sourceRoot":"","sources":["../../src/git/create-worktree.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,GAAG,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC3F,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE
|
|
1
|
+
{"version":3,"file":"create-worktree.js","sourceRoot":"","sources":["../../src/git/create-worktree.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAE,GAAG,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAC3F,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAErE,MAAM,qBAAqB,GAAG,CAC5B,IAAc,EACd,OAAkD,EAC5C,EAAE;IACR,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAClF,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;QACnB,O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,EAAE,IAAI,EAAE,oBAAoB,CAAC,EAAE;QACvF,MAAM;QACN,MAAM;KACP,CAAC,CAAC;AACL,CAAC"}
|
package/dist/git/git.d.ts
CHANGED
|
@@ -1,69 +1,18 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Run a git command synchronously and return its trimmed stdout.
|
|
3
|
-
* Any failure causes the script to throw.
|
|
4
|
-
* @param args Git command arguments. If the last argument is an object with a `cwd` property,
|
|
5
|
-
* it will be used as the working directory for the command.
|
|
6
|
-
*/
|
|
7
1
|
export declare function git(...arguments_: [...string[], {
|
|
8
2
|
cwd?: string;
|
|
9
3
|
}] | string[]): string;
|
|
10
|
-
/**
|
|
11
|
-
* Normalize a Git branch reference to a simple branch name.
|
|
12
|
-
*
|
|
13
|
-
* This helper trims surrounding whitespace and removes common prefixes so the
|
|
14
|
-
* resulting string matches the short local branch name used by refs under
|
|
15
|
-
* `refs/heads/`.
|
|
16
|
-
*/
|
|
17
4
|
export declare function normalizeBranchName(name: string): string;
|
|
18
|
-
/**
|
|
19
|
-
* Check if a local branch exists by verifying its ref.
|
|
20
|
-
*/
|
|
21
5
|
export declare function localBranchExists(branch: string): boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Check if a remote branch exists on origin.
|
|
24
|
-
*
|
|
25
|
-
* Note: this function may throw on network/auth failures or when the `origin`
|
|
26
|
-
* remote is missing/misconfigured. Callers that want a degraded-mode fallback
|
|
27
|
-
* should wrap it in try/catch.
|
|
28
|
-
*/
|
|
29
6
|
export declare function remoteBranchExists(branch: string): boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Fetch a branch from origin into the remote-tracking ref.
|
|
32
|
-
*
|
|
33
|
-
* This does not update any local branch heads.
|
|
34
|
-
*/
|
|
35
7
|
export declare function fetchOriginBranch(branch: string): void;
|
|
36
|
-
/**
|
|
37
|
-
* Get the current head commit for a local branch.
|
|
38
|
-
*/
|
|
39
8
|
export declare function getLocalBranchHead(branch: string): string | undefined;
|
|
40
|
-
/**
|
|
41
|
-
* Get the current head commit for a remote-tracking branch.
|
|
42
|
-
*/
|
|
43
9
|
export declare function getRemoteBranchHead(branch: string): string | undefined;
|
|
44
10
|
export declare function getAheadBehindCounts(localHead: string, remoteHead: string): {
|
|
45
11
|
ahead: number;
|
|
46
12
|
behind: number;
|
|
47
13
|
};
|
|
48
|
-
/**
|
|
49
|
-
* Convert an arbitrary string to a filesystem-safe single path segment.
|
|
50
|
-
*
|
|
51
|
-
* Use this helper when constructing directory names from branch names or other
|
|
52
|
-
* user-provided identifiers.
|
|
53
|
-
*/
|
|
54
14
|
export declare function toSafePathSegment(input: string): string;
|
|
55
|
-
/**
|
|
56
|
-
* Check if a file exists at the given path.
|
|
57
|
-
*/
|
|
58
15
|
export declare function fileExists(p: string): Promise<boolean>;
|
|
59
|
-
/**
|
|
60
|
-
* Print an error message and exit the process with status 1.
|
|
61
|
-
*/
|
|
62
16
|
export declare function exitWithMessage(message: string): never;
|
|
63
|
-
/**
|
|
64
|
-
* Prompts user for yes/no confirmation
|
|
65
|
-
* @param message The message to display to the user
|
|
66
|
-
* @returns Promise<boolean> - true if user confirms, false otherwise
|
|
67
|
-
*/
|
|
68
17
|
export declare function confirm(message: string): Promise<boolean>;
|
|
69
18
|
//# sourceMappingURL=git.d.ts.map
|
package/dist/git/git.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/git/git.ts"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../../src/git/git.ts"],"names":[],"mappings":"AAIA,wBAAgB,GAAG,CAAC,GAAG,UAAU,EAAE,CAAC,GAAG,MAAM,EAAE,EAAE;IAAE,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,MAAM,EAAE,GAAG,MAAM,CA0BrF;AAED,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAOxD;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAQzD;AAGD,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAK1D;AAGD,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAItD;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAOrE;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAOtE;AAED,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACjB;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CASnC;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAOvD;AAED,wBAAsB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAO5D;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAItD;AAeD,wBAAsB,OAAO,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAI/D"}
|
package/dist/git/git.js
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
import { spawnSync } from "node:child_process";
|
|
2
2
|
import * as fs from "node:fs/promises";
|
|
3
3
|
import * as readline from "node:readline/promises";
|
|
4
|
-
/**
|
|
5
|
-
* Run a git command synchronously and return its trimmed stdout.
|
|
6
|
-
* Any failure causes the script to throw.
|
|
7
|
-
* @param args Git command arguments. If the last argument is an object with a `cwd` property,
|
|
8
|
-
* it will be used as the working directory for the command.
|
|
9
|
-
*/
|
|
10
4
|
export function git(...arguments_) {
|
|
11
5
|
let cwd;
|
|
12
6
|
let gitArguments;
|
|
13
|
-
// Check if the last argument is an options object
|
|
14
7
|
const lastArgument = arguments_.at(-1);
|
|
15
8
|
if (lastArgument && typeof lastArgument === "object" && "cwd" in lastArgument) {
|
|
16
9
|
cwd = lastArgument.cwd;
|
|
@@ -34,13 +27,6 @@ export function git(...arguments_) {
|
|
|
34
27
|
}
|
|
35
28
|
return result.stdout.trim();
|
|
36
29
|
}
|
|
37
|
-
/**
|
|
38
|
-
* Normalize a Git branch reference to a simple branch name.
|
|
39
|
-
*
|
|
40
|
-
* This helper trims surrounding whitespace and removes common prefixes so the
|
|
41
|
-
* resulting string matches the short local branch name used by refs under
|
|
42
|
-
* `refs/heads/`.
|
|
43
|
-
*/
|
|
44
30
|
export function normalizeBranchName(name) {
|
|
45
31
|
const trimmed = name.trim();
|
|
46
32
|
return trimmed
|
|
@@ -49,9 +35,6 @@ export function normalizeBranchName(name) {
|
|
|
49
35
|
.replace(/^remotes\/origin\//u, "")
|
|
50
36
|
.replace(/^origin\//u, "");
|
|
51
37
|
}
|
|
52
|
-
/**
|
|
53
|
-
* Check if a local branch exists by verifying its ref.
|
|
54
|
-
*/
|
|
55
38
|
export function localBranchExists(branch) {
|
|
56
39
|
try {
|
|
57
40
|
const normalized = normalizeBranchName(branch);
|
|
@@ -62,32 +45,19 @@ export function localBranchExists(branch) {
|
|
|
62
45
|
return false;
|
|
63
46
|
}
|
|
64
47
|
}
|
|
65
|
-
|
|
66
|
-
* Check if a remote branch exists on origin.
|
|
67
|
-
*
|
|
68
|
-
* Note: this function may throw on network/auth failures or when the `origin`
|
|
69
|
-
* remote is missing/misconfigured. Callers that want a degraded-mode fallback
|
|
70
|
-
* should wrap it in try/catch.
|
|
71
|
-
*/
|
|
48
|
+
// Network/auth failures surface so callers must choose whether offline fallback is allowed.
|
|
72
49
|
export function remoteBranchExists(branch) {
|
|
73
50
|
const normalized = normalizeBranchName(branch);
|
|
74
51
|
// Use a fully-qualified ref to avoid option-parsing ambiguity for branch
|
|
75
52
|
// names starting with '-'.
|
|
76
53
|
return Boolean(git("ls-remote", "--heads", "origin", `refs/heads/${normalized}`));
|
|
77
54
|
}
|
|
78
|
-
|
|
79
|
-
* Fetch a branch from origin into the remote-tracking ref.
|
|
80
|
-
*
|
|
81
|
-
* This does not update any local branch heads.
|
|
82
|
-
*/
|
|
55
|
+
// Fetch only refreshes the remote-tracking ref; local branch heads stay untouched.
|
|
83
56
|
export function fetchOriginBranch(branch) {
|
|
84
57
|
const normalized = normalizeBranchName(branch);
|
|
85
58
|
const refspec = `+refs/heads/${normalized}:refs/remotes/origin/${normalized}`;
|
|
86
59
|
git("fetch", "origin", "--", refspec);
|
|
87
60
|
}
|
|
88
|
-
/**
|
|
89
|
-
* Get the current head commit for a local branch.
|
|
90
|
-
*/
|
|
91
61
|
export function getLocalBranchHead(branch) {
|
|
92
62
|
try {
|
|
93
63
|
const normalized = normalizeBranchName(branch);
|
|
@@ -97,9 +67,6 @@ export function getLocalBranchHead(branch) {
|
|
|
97
67
|
return undefined;
|
|
98
68
|
}
|
|
99
69
|
}
|
|
100
|
-
/**
|
|
101
|
-
* Get the current head commit for a remote-tracking branch.
|
|
102
|
-
*/
|
|
103
70
|
export function getRemoteBranchHead(branch) {
|
|
104
71
|
try {
|
|
105
72
|
const normalized = normalizeBranchName(branch);
|
|
@@ -119,12 +86,6 @@ export function getAheadBehindCounts(localHead, remoteHead) {
|
|
|
119
86
|
behind: Number.isNaN(behind) ? 0 : behind,
|
|
120
87
|
};
|
|
121
88
|
}
|
|
122
|
-
/**
|
|
123
|
-
* Convert an arbitrary string to a filesystem-safe single path segment.
|
|
124
|
-
*
|
|
125
|
-
* Use this helper when constructing directory names from branch names or other
|
|
126
|
-
* user-provided identifiers.
|
|
127
|
-
*/
|
|
128
89
|
export function toSafePathSegment(input) {
|
|
129
90
|
return input
|
|
130
91
|
.trim()
|
|
@@ -133,9 +94,6 @@ export function toSafePathSegment(input) {
|
|
|
133
94
|
.replaceAll(/\.+$/gu, "")
|
|
134
95
|
.replaceAll(/-+/gu, "-");
|
|
135
96
|
}
|
|
136
|
-
/**
|
|
137
|
-
* Check if a file exists at the given path.
|
|
138
|
-
*/
|
|
139
97
|
export async function fileExists(p) {
|
|
140
98
|
try {
|
|
141
99
|
await fs.access(p);
|
|
@@ -145,17 +103,11 @@ export async function fileExists(p) {
|
|
|
145
103
|
return false;
|
|
146
104
|
}
|
|
147
105
|
}
|
|
148
|
-
/**
|
|
149
|
-
* Print an error message and exit the process with status 1.
|
|
150
|
-
*/
|
|
151
106
|
export function exitWithMessage(message) {
|
|
152
107
|
console.error(message);
|
|
153
108
|
// eslint-disable-next-line unicorn/no-process-exit -- This is a CLI helper function
|
|
154
109
|
process.exit(1);
|
|
155
110
|
}
|
|
156
|
-
/**
|
|
157
|
-
* Prompt for input and return the user's response.
|
|
158
|
-
*/
|
|
159
111
|
async function prompt(message) {
|
|
160
112
|
const rl = readline.createInterface({
|
|
161
113
|
input: process.stdin,
|
|
@@ -168,11 +120,6 @@ async function prompt(message) {
|
|
|
168
120
|
rl.close();
|
|
169
121
|
}
|
|
170
122
|
}
|
|
171
|
-
/**
|
|
172
|
-
* Prompts user for yes/no confirmation
|
|
173
|
-
* @param message The message to display to the user
|
|
174
|
-
* @returns Promise<boolean> - true if user confirms, false otherwise
|
|
175
|
-
*/
|
|
176
123
|
export async function confirm(message) {
|
|
177
124
|
const answer = await prompt(`${message} [y/N] `);
|
|
178
125
|
const normalized = answer.trim().toLowerCase();
|
package/dist/git/git.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../src/git/git.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACvC,OAAO,KAAK,QAAQ,MAAM,wBAAwB,CAAC;AAEnD
|
|
1
|
+
{"version":3,"file":"git.js","sourceRoot":"","sources":["../../src/git/git.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,KAAK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orktreeRoot(): string;
|
|
7
2
|
export declare function getSuperprojectRoot(): string | undefined;
|
|
8
|
-
/**
|
|
9
|
-
* Get the repository name from the main visible repository directory.
|
|
10
|
-
*/
|
|
11
3
|
export declare function getRepositoryName(): string;
|
|
12
|
-
/**
|
|
13
|
-
* Find the worktree path where the given branch is currently checked out.
|
|
14
|
-
* Returns the worktree path if found, otherwise undefined.
|
|
15
|
-
*/
|
|
16
4
|
export declare function findWorktreeByBranchName(branchName: string): string | undefined;
|
|
17
5
|
//# sourceMappingURL=worktree-discovery.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worktree-discovery.d.ts","sourceRoot":"","sources":["../../src/git/worktree-discovery.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"worktree-discovery.d.ts","sourceRoot":"","sources":["../../src/git/worktree-discovery.ts"],"names":[],"mappings":"AAKA,wBAAgB,sBAAsB,IAAI,MAAM,CAE/C;AAyDD,wBAAgB,mBAAmB,IAAI,MAAM,GAAG,SAAS,CA0BxD;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,wBAAgB,wBAAwB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAgC/E"}
|
|
@@ -1,36 +1,42 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* worktree-discovery.ts
|
|
3
|
-
*
|
|
4
|
-
* Utilities for parsing Git worktree information
|
|
5
|
-
*/
|
|
6
1
|
import path from "node:path";
|
|
7
2
|
import { git } from "./git.js";
|
|
8
3
|
const MAX_SUPERPROJECT_NESTING = 10;
|
|
9
4
|
export function getCurrentWorktreeRoot() {
|
|
10
5
|
return git("rev-parse", "--show-toplevel");
|
|
11
6
|
}
|
|
12
|
-
function getGitCommonDirectory() {
|
|
13
|
-
const repoRoot = getCurrentWorktreeRoot();
|
|
7
|
+
function getGitCommonDirectory(repoRoot) {
|
|
14
8
|
const commonDirectory = git("rev-parse", "--git-common-dir", {
|
|
15
9
|
cwd: repoRoot,
|
|
16
10
|
});
|
|
17
11
|
return path.resolve(repoRoot, commonDirectory);
|
|
18
12
|
}
|
|
13
|
+
function getConfiguredWorktree(commonDirectory) {
|
|
14
|
+
return git("config", "--file", path.join(commonDirectory, "config"), "--default", "", "--get", "core.worktree");
|
|
15
|
+
}
|
|
16
|
+
function getPrimaryWorktreePath(worktreeList) {
|
|
17
|
+
const primaryWorktreeLine = worktreeList
|
|
18
|
+
.split(/\n/u)
|
|
19
|
+
.find((line) => line.startsWith("worktree "));
|
|
20
|
+
return primaryWorktreeLine === undefined
|
|
21
|
+
? undefined
|
|
22
|
+
: path.resolve(primaryWorktreeLine.replace(/^worktree\s+/u, "").trim());
|
|
23
|
+
}
|
|
24
|
+
function resolveMainWorktreePath(repoRoot, commonDirectory, configuredWorktree, worktreeList) {
|
|
25
|
+
if (configuredWorktree.length > 0) {
|
|
26
|
+
return path.resolve(commonDirectory, configuredWorktree);
|
|
27
|
+
}
|
|
28
|
+
const primaryWorktreePath = getPrimaryWorktreePath(worktreeList);
|
|
29
|
+
if (primaryWorktreePath === undefined) {
|
|
30
|
+
return repoRoot;
|
|
31
|
+
}
|
|
32
|
+
return primaryWorktreePath === commonDirectory ? repoRoot : primaryWorktreePath;
|
|
33
|
+
}
|
|
19
34
|
function getMainWorktreePath() {
|
|
20
35
|
const repoRoot = getCurrentWorktreeRoot();
|
|
21
|
-
const commonDirectory = getGitCommonDirectory();
|
|
22
|
-
const configuredWorktree =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
.split(/\n/u)
|
|
26
|
-
.find((line) => line.startsWith("worktree "));
|
|
27
|
-
if (primaryWorktreeLine === undefined) {
|
|
28
|
-
return repoRoot;
|
|
29
|
-
}
|
|
30
|
-
const primaryWorktreePath = path.resolve(primaryWorktreeLine.replace(/^worktree\s+/u, "").trim());
|
|
31
|
-
return primaryWorktreePath === commonDirectory ? repoRoot : primaryWorktreePath;
|
|
32
|
-
}
|
|
33
|
-
return path.resolve(commonDirectory, configuredWorktree);
|
|
36
|
+
const commonDirectory = getGitCommonDirectory(repoRoot);
|
|
37
|
+
const configuredWorktree = getConfiguredWorktree(commonDirectory);
|
|
38
|
+
const worktreeList = configuredWorktree.length === 0 ? git("worktree", "list", "--porcelain") : "";
|
|
39
|
+
return resolveMainWorktreePath(repoRoot, commonDirectory, configuredWorktree, worktreeList);
|
|
34
40
|
}
|
|
35
41
|
export function getSuperprojectRoot() {
|
|
36
42
|
let currentDirectory = getCurrentWorktreeRoot();
|
|
@@ -52,23 +58,18 @@ export function getSuperprojectRoot() {
|
|
|
52
58
|
}
|
|
53
59
|
throw new Error(`Expected at most ${MAX_SUPERPROJECT_NESTING} nested superprojects while resolving the topmost superproject`);
|
|
54
60
|
}
|
|
55
|
-
/**
|
|
56
|
-
* Get the repository name from the main visible repository directory.
|
|
57
|
-
*/
|
|
58
61
|
export function getRepositoryName() {
|
|
59
62
|
return path.basename(getMainWorktreePath());
|
|
60
63
|
}
|
|
61
|
-
/**
|
|
62
|
-
* Find the worktree path where the given branch is currently checked out.
|
|
63
|
-
* Returns the worktree path if found, otherwise undefined.
|
|
64
|
-
*/
|
|
65
64
|
export function findWorktreeByBranchName(branchName) {
|
|
66
|
-
const
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
const
|
|
65
|
+
const repoRoot = getCurrentWorktreeRoot();
|
|
66
|
+
const commonDirectory = getGitCommonDirectory(repoRoot);
|
|
67
|
+
const configuredWorktree = getConfiguredWorktree(commonDirectory);
|
|
68
|
+
const worktreeList = git("worktree", "list", "--porcelain");
|
|
69
|
+
const mainWorktreePath = resolveMainWorktreePath(repoRoot, commonDirectory, configuredWorktree, worktreeList);
|
|
70
|
+
const worktreeLines = worktreeList.split(/\n/u);
|
|
70
71
|
let currentWorktreePath;
|
|
71
|
-
for (const line of
|
|
72
|
+
for (const line of worktreeLines) {
|
|
72
73
|
if (line.startsWith("worktree ")) {
|
|
73
74
|
const listedWorktreePath = path.resolve(line.replace(/^worktree\s+/u, "").trim());
|
|
74
75
|
currentWorktreePath =
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worktree-discovery.js","sourceRoot":"","sources":["../../src/git/worktree-discovery.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"worktree-discovery.js","sourceRoot":"","sources":["../../src/git/worktree-discovery.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAE/B,MAAM,wBAAwB,GAAG,EAAE,CAAC;AAEpC,MAAM,UAAU,sBAAsB;IACpC,OAAO,GAAG,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAC;AAC7C,CAAC;AAED,SAAS,qBAAqB,CAAC,QAAgB;IAC7C,MAAM,eAAe,GAAG,GAAG,CAAC,WAAW,EAAE,kBAAkB,EAAE;QAC3D,GAAG,EAAE,QAAQ;KACd,CAAC,CAAC;IACH,OAAO,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC;AACjD,CAAC;AAED,SAAS,qBAAqB,CAAC,eAAuB;IACpD,OAAO,GAAG,CACR,QAAQ,EACR,QAAQ,EACR,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,QAAQ,CAAC,EACpC,WAAW,EACX,EAAE,EACF,OAAO,EACP,eAAe,CAChB,CAAC;AACJ,CAAC;AAED,SAAS,sBAAsB,CAAC,YAAoB;IAClD,MAAM,mBAAmB,GAAG,YAAY;SACrC,KAAK,CAAC,KAAK,CAAC;SACZ,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC;IAChD,OAAO,mBAAmB,KAAK,SAAS;QACtC,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CA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YAClF,mBAAmB;gBACjB,kBAAkB,KAAK,eAAe,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,kBAAkB,CAAC;QACnF,CAAC;aAAM,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,mBAAmB,EAAE,CAAC;YAC7D,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;YAC/D,MAAM,SAAS,GAAG,eAAe,CAAC,UAAU,CAAC,aAAa,CAAC;gBACzD,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,aAAa,CAAC,MAAM,CAAC;gBAC7C,CAAC,CAAC,eAAe,CAAC;YACpB,IAAI,SAAS,KAAK,UAAU,EAAE,CAAC;gBAC7B,OAAO,mBAAmB,CAAC;YAC7B,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -10,5 +10,6 @@ interface StatusLoggerOptions {
|
|
|
10
10
|
readonly decorate: boolean;
|
|
11
11
|
}
|
|
12
12
|
export declare function createStatusLogger(options: StatusLoggerOptions): StatusLogger;
|
|
13
|
+
export declare const fallbackStatusLogger: StatusLogger;
|
|
13
14
|
export {};
|
|
14
15
|
//# sourceMappingURL=create-status-logger.d.ts.map
|