Skip to content

Commit

Permalink
fix(git): gracefully handle rev-parse error when checking out branch
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins committed May 14, 2021
1 parent aca4798 commit 241a4bf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/util/git/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,10 @@ export async function checkoutBranch(branchName: string): Promise<CommitSha> {
return config.currentBranchSha;
} catch (err) /* istanbul ignore next */ {
checkForPlatformFailure(err);
if (err.message?.includes('fatal: ambiguous argument')) {
logger.warn({ err }, 'Failed to checkout branch');
throw new Error(TEMPORARY_ERROR);
}
throw err;
}
}
Expand Down

0 comments on commit 241a4bf

Please sign in to comment.