fix: fetch all tags even if the repo is not shallow

This commit is contained in:
Pierre Vanduynslager
2018-07-02 18:38:24 -04:00
parent 2d3a5e53e9
commit 45eee4acdd
4 changed files with 29 additions and 12 deletions
+4 -4
View File
@@ -49,15 +49,15 @@ async function isRefInHistory(ref) {
}
/**
* Unshallow the git repository (retriving every commits and tags).
* Unshallow the git repository if necessary and fetch all the tags.
*
* @param {String} repositoryUrl The remote repository URL.
*/
async function unshallow(repositoryUrl) {
async function fetch(repositoryUrl) {
try {
await execa('git', ['fetch', '--unshallow', '--tags', repositoryUrl]);
} catch (err) {
debug(err);
await execa('git', ['fetch', '--tags', repositoryUrl]);
}
}
@@ -164,7 +164,7 @@ module.exports = {
gitTagHead,
gitTags,
isRefInHistory,
unshallow,
fetch,
gitHead,
repoUrl,
isGitRepo,