mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-31 21:52:54 +00:00
fix(server): return project suggestion roots in the form project.add stores
Git reports Windows repo roots with forward slashes, so an added suggestion kept showing because its path never matched the new project's root.
This commit is contained in:
@@ -88,7 +88,8 @@ describe("listProjectSuggestions", () => {
|
||||
let gitService: WorkspaceGitServiceImpl;
|
||||
|
||||
beforeEach(() => {
|
||||
root = realpathSync(mkdtempSync(path.join(tmpdir(), "project-suggestions-")));
|
||||
// The native realpath expands Windows short names (RUNNER~1), which git reports in full.
|
||||
root = realpathSync.native(mkdtempSync(path.join(tmpdir(), "project-suggestions-")));
|
||||
gitService = new WorkspaceGitServiceImpl({
|
||||
logger: createTestLogger(),
|
||||
paseoHome: path.join(root, ".paseo"),
|
||||
|
||||
@@ -118,7 +118,8 @@ async function resolveProjectRoot(
|
||||
return null;
|
||||
}
|
||||
const checkout = await workspaceGitService.getCheckout(cwd);
|
||||
const rootPath = checkout.mainRepoRoot ?? checkout.worktreeRoot ?? cwd;
|
||||
// Git reports Windows roots with forward slashes; resolve to the form project.add keys by.
|
||||
const rootPath = resolve(checkout.mainRepoRoot ?? checkout.worktreeRoot ?? cwd);
|
||||
if (rootPath !== cwd && !(await isDirectory(rootPath))) {
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user