Skip to content

The open source coding agent.

TypeScript

fix: drop absolute flag to resolve issues when using older git versions

Aiden Clinef6262460ff33
diff --git a/packages/opencode/src/project/project.ts b/packages/opencode/src/project/project.ts
index 74e969145b7..364d8b2473c 100644
--- a/packages/opencode/src/project/project.ts
+++ b/packages/opencode/src/project/project.ts
@@ -75,18 +75,18 @@ export namespace Project {
await Storage.write<Info>(["project", "global"], project)
return project
}
- worktree = await $`git rev-parse --path-format=absolute --show-toplevel`
+ worktree = await $`git rev-parse --show-toplevel`
.quiet()
.nothrow()
.cwd(worktree)
.text()
- .then((x) => x.trim())
- const vcsDir = await $`git rev-parse --path-format=absolute --git-dir`
+ .then((x) => path.resolve(worktree, x.trim()))
+ const vcsDir = await $`git rev-parse --git-dir`
.quiet()
.nothrow()
.cwd(worktree)
.text()
- .then((x) => x.trim())
+ .then((x) => path.resolve(worktree, x.trim()))
const project: Info = {
id,
worktree,