Fix getRemotes for promisor remotes

The printout for promisor remotes (from partial clones) does not end in "(fetch)". Instead, it ends in "(fetch) [filter=filterType]".

This commit changes getRemotes to use a regex instead of `endsWith()` to account for this case.

Co-Authored-By: Sky <2097064+skyrossm@users.noreply.github.com>
This commit is contained in:
mkafrin 2023-07-14 19:30:04 -04:00
parent 42132b82bb
commit 139c110221

View file

@ -25,7 +25,7 @@ export async function getRemotes(
const output = result.stdout
const lines = output.split('\n')
const remotes = lines
.filter(x => x.endsWith('(fetch)'))
.filter(x => /\(fetch\)( \[.+\])?$/.test(x))
.map(x => x.split(/\s+/))
.map(x => ({ name: x[0], url: x[1] }))