feat(FN-2944): merge fusion/fn-2944
- test(FN-2944): cover already checked out worktree conflict recovery - fix(FN-2944): recognize git already checked out worktree conflict - fix(engine): auto-recover from squash-merge orphan rebase failures Fusion-Task-Id: FN-2944
This commit is contained in:
@@ -4,3 +4,11 @@ import { join } from "node:path";
|
||||
|
||||
const tempHome = mkdtempSync(join(tmpdir(), "fn-test-home-"));
|
||||
process.env.HOME = tempHome;
|
||||
process.env.USERPROFILE = tempHome;
|
||||
if (process.platform === "win32") {
|
||||
const match = tempHome.match(/^([A-Za-z]:)(.*)$/);
|
||||
if (match) {
|
||||
process.env.HOMEDRIVE = match[1];
|
||||
process.env.HOMEPATH = match[2] || "\\";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -615,7 +615,8 @@ function resolveAgentsMdPath(cwd: string): string | undefined {
|
||||
}
|
||||
|
||||
// Fall back to global path
|
||||
const globalPath = join(homedir(), ".pi", "agent", "AGENTS.md");
|
||||
const globalHome = process.env.HOME || process.env.USERPROFILE || homedir();
|
||||
const globalPath = join(globalHome, ".pi", "agent", "AGENTS.md");
|
||||
if (existsSync(globalPath)) return globalPath;
|
||||
|
||||
return undefined;
|
||||
|
||||
Reference in New Issue
Block a user