Skip to content

Commit

Permalink
Merge branch 'ag/lock' of https://github.com/kitspace/kitspace-v2
Browse files Browse the repository at this point in the history
  • Loading branch information
Kitspace Auto-Merge Bot committed Jul 22, 2023
2 parents e2df457 + 7801aba commit 6e025f9
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions processor/src/queues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,24 +194,31 @@ async function sync(gitDir, checkoutDir) {
}

log.debug('Pulling updates for', gitDir)
await sh`cd ${checkoutDir} && git pull`.catch(err => {
try {
await sh`cd ${checkoutDir} && git pull`
} catch (err) {
// repos with no branches yet will create this error
if (
err.stderr ===
"Your configuration specifies to merge with the ref 'refs/heads/master'\nfrom the remote, but no such ref was fetched.\n"
) {
log.warn('repo without any branches', checkoutDir)
done()
return
}
done(err)
})
return
}
} else {
log.debug('Cloning ', gitDir)
await sh`git clone ${gitDir} ${checkoutDir}`.catch(err => {
try {
await sh`git clone ${gitDir} ${checkoutDir}`
} catch (err) {
if (err.stderr) {
done(err)
return
}
})
}
log.debug('Cloned into', checkoutDir)
if (registryHash != null) {
await sh`cd ${checkoutDir} && git checkout ${registryHash}`
Expand Down

0 comments on commit 6e025f9

Please sign in to comment.