Skip to content

Commit

Permalink
fix: only use worktree remote when editing
Browse files Browse the repository at this point in the history
  • Loading branch information
DavieReid committed Mar 19, 2024
1 parent a36a757 commit ddcea96
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions packages/source-git-repo/src/Repo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,11 +348,7 @@ export default class Repo {
console.debug(
`[Mosaic] Creating linked worktree repo '${this.#name} branch '${this.#branch}'`
);
await spawn(
'git',
['worktree', 'add', '-f', this.#dir, this.#branch, `${this.#remote}/${this.#branch}`],
this.#cloneRootDir
);
await spawn('git', ['worktree', 'add', '-f', this.#dir, this.#branch], this.#cloneRootDir);
} else {
console.debug(
`[Mosaic] Re-using linked worktree repo '${this.#name} branch '${this.#branch}'`
Expand All @@ -370,7 +366,7 @@ export default class Repo {
console.debug(`[Mosaic] Creating worktree for content save @ ${this.#dir}`);
await spawn(
'git',
['worktree', 'add', '-f', '-B', branchName, this.#dir],
['worktree', 'add', '-f', '-B', branchName, this.#dir, `${this.#remote}/${this.#branch}`],
this.#worktreeRootDir
);
console.debug(`[Mosaic] Creating linked worktree for ${sid}`);
Expand Down

0 comments on commit ddcea96

Please sign in to comment.