From 6466fd9e5b6a331007acfb7739e01cf5dfbb9c5b Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Sat, 13 Jan 2024 13:11:12 +0100 Subject: [PATCH] fix(git): Specify remote repo to use for fetch Signed-off-by: Marcel Klehr --- src/lib/adapters/Git.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/adapters/Git.ts b/src/lib/adapters/Git.ts index dd3ff4dda0..5dc02bbbec 100644 --- a/src/lib/adapters/Git.ts +++ b/src/lib/adapters/Git.ts @@ -91,9 +91,9 @@ export default class GitAdapter extends CachingAdapter { await git.init({ fs, dir: this.dir }) await git.addRemote({ fs, dir: this.dir, url: this.server.url, remote: 'origin' }) Logger.log('(git) fetch from remote') - await git.fetch({ http, fs, dir: this.dir, ref: this.server.branch || 'main', depth: 10, onAuth: () => this.onAuth() }) - Logger.log('(git) checkout branch ' + (this.server.branch || 'main')) - await git.checkout({ fs, dir: this.dir, ref: this.server.branch || 'main' }) + await git.fetch({ http, fs, dir: this.dir, ref: this.server.branch, remote: 'origin', depth: 10, onAuth: () => this.onAuth() }) + Logger.log('(git) checkout branch ' + (this.server.branch)) + await git.checkout({ fs, dir: this.dir, ref: this.server.branch }) if (this.server.bookmark_file[0] === '/') { throw new SlashError()