hillclimb 0.9.2 → 0.9.4
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.
|
@@ -160,7 +160,7 @@ async function repoIdentity(repoRoot) {
|
|
|
160
160
|
}
|
|
161
161
|
async function logHeal(level, message) {
|
|
162
162
|
try {
|
|
163
|
-
const { appendLog: appendLog2 } = await import("./log-
|
|
163
|
+
const { appendLog: appendLog2 } = await import("./log-UZPPBFMO.js");
|
|
164
164
|
appendLog2(level, message);
|
|
165
165
|
} catch {
|
|
166
166
|
}
|
|
@@ -182,7 +182,7 @@ function matchByPath(projects, resolved) {
|
|
|
182
182
|
var healMisses = /* @__PURE__ */ new Set();
|
|
183
183
|
async function healRenamedProject(file, resolved) {
|
|
184
184
|
const dead = Object.entries(file.projects).filter(
|
|
185
|
-
([key]) =>
|
|
185
|
+
([key]) => pathIsGone(path.resolve(key))
|
|
186
186
|
);
|
|
187
187
|
if (dead.length === 0) return null;
|
|
188
188
|
const missKey = `${configPath()}|${resolved}`;
|
|
@@ -288,11 +288,26 @@ async function matchLinkedWorktree(projects, resolved) {
|
|
|
288
288
|
}
|
|
289
289
|
return null;
|
|
290
290
|
}
|
|
291
|
+
function hasNestedGitFile(root, target) {
|
|
292
|
+
let dir = target;
|
|
293
|
+
while (dir !== root && dir.startsWith(root + path.sep)) {
|
|
294
|
+
try {
|
|
295
|
+
if (fs.statSync(path.join(dir, ".git")).isFile()) return true;
|
|
296
|
+
} catch {
|
|
297
|
+
}
|
|
298
|
+
dir = path.dirname(dir);
|
|
299
|
+
}
|
|
300
|
+
return false;
|
|
301
|
+
}
|
|
291
302
|
async function findProjectForCwd(cwd) {
|
|
292
303
|
const file = await loadProjects();
|
|
293
304
|
const resolved = path.resolve(cwd);
|
|
294
305
|
const match = matchByPath(file.projects, resolved);
|
|
295
306
|
if (match) {
|
|
307
|
+
if (hasNestedGitFile(match.repoRoot, resolved)) {
|
|
308
|
+
const nested = await matchLinkedWorktree(file.projects, resolved);
|
|
309
|
+
if (nested) return nested;
|
|
310
|
+
}
|
|
296
311
|
await backfillIdentity(file, match);
|
|
297
312
|
return { repoRoot: match.repoRoot, config: match.config };
|
|
298
313
|
}
|
|
@@ -383,5 +398,6 @@ export {
|
|
|
383
398
|
configPath,
|
|
384
399
|
loadProjects,
|
|
385
400
|
upsertProject,
|
|
401
|
+
hasNestedGitFile,
|
|
386
402
|
findProjectForCwd
|
|
387
403
|
};
|