Skip to content

Commit

Permalink
fix(Git): Fix clearServer
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Klehr <[email protected]>
  • Loading branch information
marcelklehr committed Mar 5, 2025
1 parent 8b104c5 commit b1a12a7
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/lib/adapters/Git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -276,11 +276,12 @@ export default class GitAdapter extends CachingAdapter {
}
}

async clearAllLocks(): Promise<void> {
const tags = await git.listTags({ fs: this.fs, dir: this.dir })
async clearAllLocks(fs:FS = null): Promise<void> {
fs = fs || this.fs
const tags = await git.listTags({ fs, dir: this.dir })
const lockTags = tags.filter(tag => tag.startsWith('floccus-lock-'))
for (const tag of lockTags) {
await git.push({ fs: this.fs, http, dir: this.dir, ref: tag, delete: true, onAuth: () => this.onAuth() })
await git.push({ fs, http, dir: this.dir, ref: tag, delete: true, onAuth: () => this.onAuth() })
}
}

Expand Down Expand Up @@ -378,7 +379,7 @@ export default class GitAdapter extends CachingAdapter {
depth: 10,
onAuth: () => this.onAuth()
})
await this.clearAllLocks()
await this.clearAllLocks(fs)
}
}

Expand Down

0 comments on commit b1a12a7

Please sign in to comment.