fix: fetch all tags even if the repo is not shallow
This commit is contained in:
+4
-4
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user