diff --git a/lib/plugin/GitBase.js b/lib/plugin/GitBase.js index 39272088..eb974f84 100644 --- a/lib/plugin/GitBase.js +++ b/lib/plugin/GitBase.js @@ -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; } diff --git a/test/github.js b/test/github.js index 8d8d5270..2b1eb4a4 100644 --- a/test/github.js +++ b/test/github.js @@ -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' };