clay-server 3.8.0 → 3.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/worktree.js +4 -0
- package/package.json +1 -1
package/lib/worktree.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
var { execFileSync } = require("child_process");
|
|
2
|
+
var fs = require("fs");
|
|
2
3
|
var path = require("path");
|
|
3
4
|
|
|
4
5
|
// Parse `git worktree list --porcelain` output into structured objects
|
|
@@ -68,6 +69,9 @@ function scanWorktrees(projectPath) {
|
|
|
68
69
|
if (wt.bare) continue;
|
|
69
70
|
var resolvedWt = path.resolve(wt.path);
|
|
70
71
|
if (resolvedWt === resolvedParent) continue;
|
|
72
|
+
// Git retains removed worktrees until `git worktree prune` runs. Do not
|
|
73
|
+
// register those stale paths as Clay projects.
|
|
74
|
+
if (!fs.existsSync(resolvedWt)) continue;
|
|
71
75
|
wt.external = !isPathInside(resolvedParent, resolvedWt);
|
|
72
76
|
wt.dirName = path.basename(wt.path);
|
|
73
77
|
results.push(wt);
|
package/package.json
CHANGED