fix: verify the local branch is up to date with the remote one

This commit is contained in:
pvdlg
2018-05-01 09:59:57 -04:00
committed by Pierre Vanduynslager
parent a11da0d5e3
commit d15905c0d5
5 changed files with 106 additions and 3 deletions
+12
View File
@@ -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,
};