fix: correct git merge-base error code handling
This commit is contained in:
committed by
Gregor Martynus
parent
20245b733a
commit
4352144a98
+7
-1
@@ -36,9 +36,15 @@ async function gitTags() {
|
||||
*/
|
||||
async function isRefInHistory(ref) {
|
||||
try {
|
||||
return (await execa('git', ['merge-base', '--is-ancestor', ref, 'HEAD'])).code === 0;
|
||||
await execa('git', ['merge-base', '--is-ancestor', ref, 'HEAD']);
|
||||
return true;
|
||||
} catch (err) {
|
||||
if (err.code === 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
debug(err);
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user