From ddcea96c14f501eb1bf95bd4fc23070ace4e3b96 Mon Sep 17 00:00:00 2001 From: Davie Date: Mon, 18 Mar 2024 13:26:26 +0000 Subject: [PATCH] fix: only use worktree remote when editing --- packages/source-git-repo/src/Repo.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/source-git-repo/src/Repo.ts b/packages/source-git-repo/src/Repo.ts index 78d9dd61..b88a2800 100644 --- a/packages/source-git-repo/src/Repo.ts +++ b/packages/source-git-repo/src/Repo.ts @@ -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}'` @@ -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}`);