refactor: harmonize git utils function names

This commit is contained in:
Pierre Vanduynslager
2018-11-19 18:34:16 -05:00
parent e594638a96
commit 9f5645cfa0
6 changed files with 57 additions and 57 deletions
+6 -6
View File
@@ -9,7 +9,7 @@ const debug = require('debug')('semantic-release:git');
*
* @return {string} The commit sha of the tag in parameter or `null`.
*/
async function gitTagHead(tagName, execaOpts) {
async function getTagHead(tagName, execaOpts) {
try {
return await execa.stdout('git', ['rev-list', '-1', tagName], execaOpts);
} catch (error) {
@@ -25,7 +25,7 @@ async function gitTagHead(tagName, execaOpts) {
* @return {Array<String>} List of git tags.
* @throws {Error} If the `git` command fails.
*/
async function gitTags(execaOpts) {
async function getTags(execaOpts) {
return (await execa.stdout('git', ['tag'], execaOpts))
.split('\n')
.map(tag => tag.trim())
@@ -75,7 +75,7 @@ async function fetch(repositoryUrl, execaOpts) {
*
* @return {string} the sha of the HEAD commit.
*/
function gitHead(execaOpts) {
function getGitHead(execaOpts) {
return execa.stdout('git', ['rev-parse', 'HEAD'], execaOpts);
}
@@ -186,11 +186,11 @@ async function isBranchUpToDate(branch, execaOpts) {
}
module.exports = {
gitTagHead,
gitTags,
getTagHead,
getTags,
isRefInHistory,
fetch,
gitHead,
getGitHead,
repoUrl,
isGitRepo,
verifyAuth,