Skip to content

Commit

Permalink
feat(git): add support for git url aliases (#633)
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperITMan committed Mar 28, 2020
1 parent 6de0998 commit 2647871
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/plugin/GitBase.js
Expand Up @@ -55,7 +55,7 @@ class GitBase extends Plugin {
async getRemoteUrl() {
const remoteNameOrUrl = this.options.pushRepo || (await this.getRemote()) || 'origin';
return this.isRemoteName(remoteNameOrUrl)
? this.exec(`git config --get remote.${remoteNameOrUrl}.url`, { options }).catch(() => null)
? this.exec(`git remote get-url ${remoteNameOrUrl}`, { options }).catch(() => null)
: remoteNameOrUrl;
}

Expand Down
2 changes: 1 addition & 1 deletion test/github.js
Expand Up @@ -66,7 +66,7 @@ test('should release and upload assets', async t => {
test('should release to enterprise host', async t => {
const github = factory(GitHub, { options: { github: { tokenRef } } });
const exec = sinon.stub(github.shell, 'exec').callThrough();
exec.withArgs('git config --get remote.origin.url').resolves(`https://github.example.org/user/repo`);
exec.withArgs('git remote get-url origin').resolves(`https://github.example.org/user/repo`);
exec.withArgs('git describe --tags --abbrev=0').resolves(`1.0.0`);

const remote = { api: 'https://github.example.org/api/v3', host: 'github.example.org' };
Expand Down

0 comments on commit 2647871

Please sign in to comment.