refactor: rename origin parameters to repositoryUrl
This commit is contained in:
committed by
Pierre Vanduynslager
parent
3f614530a0
commit
a52f258fa4
+7
-7
@@ -45,7 +45,7 @@ async function isRefInHistory(ref) {
|
||||
/**
|
||||
* Unshallow the git repository (retriving every commits and tags).
|
||||
*
|
||||
* @param {String} repositoryUrl The remote repository URL with credentials.
|
||||
* @param {String} repositoryUrl The remote repository URL.
|
||||
*/
|
||||
async function unshallow(repositoryUrl) {
|
||||
await execa('git', ['fetch', '--unshallow', '--tags', repositoryUrl], {reject: false});
|
||||
@@ -83,14 +83,14 @@ async function isGitRepo() {
|
||||
/**
|
||||
* Verify the write access authorization to remote repository with push dry-run.
|
||||
*
|
||||
* @param {String} origin The remote repository URL.
|
||||
* @param {String} repositoryUrl The remote repository URL.
|
||||
* @param {String} branch The repositoru branch for which to verify write access.
|
||||
*
|
||||
* @return {Boolean} `true` is authorized to push, falsy otherwise.
|
||||
*/
|
||||
async function verifyAuth(origin, branch) {
|
||||
async function verifyAuth(repositoryUrl, branch) {
|
||||
try {
|
||||
return (await execa('git', ['push', '--dry-run', origin, `HEAD:${branch}`])).code === 0;
|
||||
return (await execa('git', ['push', '--dry-run', repositoryUrl, `HEAD:${branch}`])).code === 0;
|
||||
} catch (err) {
|
||||
debug(err);
|
||||
}
|
||||
@@ -109,12 +109,12 @@ async function tag(tagName) {
|
||||
/**
|
||||
* Push to the remote repository.
|
||||
*
|
||||
* @param {String} origin The remote repository URL.
|
||||
* @param {String} repositoryUrl The remote repository URL.
|
||||
* @param {String} branch The branch to push.
|
||||
* @throws {Error} if the push failed.
|
||||
*/
|
||||
async function push(origin, branch) {
|
||||
await execa('git', ['push', '--tags', origin, `HEAD:${branch}`]);
|
||||
async function push(repositoryUrl, branch) {
|
||||
await execa('git', ['push', '--tags', repositoryUrl, `HEAD:${branch}`]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user