fix: do not transform repositoryUrl if it allow to push

Even the user set Git credentials via environment variable, use the configured URL (with authentication) if it works.
This allow users to push tags and commits via ssh while still using the GitHub/GitLab API.
This commit is contained in:
Pierre Vanduynslager
2018-02-14 10:45:44 -05:00
parent 9788fcad4e
commit 305f4ee8eb
3 changed files with 19 additions and 4 deletions
+2 -2
View File
@@ -603,11 +603,11 @@ test.serial('Exit with 1 if missing permission to push to the remote repository'
// Create a git repository, set the current working directory at the root of the repo
t.log('Create git repository');
const {repositoryUrl} = await gitbox.createRepo(packageName);
await gitbox.createRepo(packageName);
await writeJson('./package.json', {
name: packageName,
version: '0.0.0-dev',
repository: {url: repositoryUrl},
repository: {url: 'http://user:wrong_pass@localhost:2080/git/unauthorized.git'},
});
/* Initial release */