fix: verify the local branch is up to date with the remote one
This commit is contained in:
committed by
Pierre Vanduynslager
parent
a11da0d5e3
commit
d15905c0d5
+12
@@ -131,6 +131,17 @@ async function verifyTagName(tagName) {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Verify the local branch is up to date with the remote one.
|
||||
*
|
||||
* @param {String} branch The repository branch for which to verify status.
|
||||
*
|
||||
* @return {Boolean} `true` is the HEAD of the current local branch is the same as the HEAD of the remote branch, `false` otherwise.
|
||||
*/
|
||||
async function isBranchUpToDate(branch) {
|
||||
return isRefInHistory(await execa.stdout('git', ['rev-parse', `${branch}@{u}`]));
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
gitTagHead,
|
||||
gitTags,
|
||||
@@ -143,4 +154,5 @@ module.exports = {
|
||||
tag,
|
||||
push,
|
||||
verifyTagName,
|
||||
isBranchUpToDate,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user