Skip to content

Commit

Permalink
fix(git): Specify remote repo to use for fetch
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
  • Loading branch information
marcelklehr committed Jan 13, 2024
1 parent 054bc8c commit 6466fd9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lib/adapters/Git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 6466fd9

Please sign in to comment.