Skip to content

Commit

Permalink
Fix Bitbucket compare links. (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jule- authored and cookpete committed Oct 8, 2018
1 parent 5bf8c49 commit 2b4aa45
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ function getCompareLink (from, to, remote) {
return null
}
if (/bitbucket/.test(remote.hostname)) {
return `${remote.url}/compare/${to}%0D${from}`
return `${remote.url}/compare/${to}..${from}`
}
return `${remote.url}/compare/${from}...${to}`
}
Expand Down
4 changes: 2 additions & 2 deletions test/releases.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('parseReleases', () => {

it('parses bitbucket releases', () => {
const releases = parseReleases(commits, remotes.bitbucket, null, options)
expect(releases[0].href).to.equal('https://bitbucket.org/user/repo/compare/v1.0.0%0Dv0.1.0')
expect(releases[0].href).to.equal('https://bitbucket.org/user/repo/compare/v1.0.0..v0.1.0')
})

it('sorts releases in the correct order', () => {
Expand All @@ -33,7 +33,7 @@ describe('parseReleases', () => {

it('includes tag prefix in compare urls', () => {
const releases = parseReleases(commits, remotes.bitbucket, null, { ...options, tagPrefix: 'prefix-' })
expect(releases[0].href).to.equal('https://bitbucket.org/user/repo/compare/prefix-v1.0.0%0Dprefix-v0.1.0')
expect(releases[0].href).to.equal('https://bitbucket.org/user/repo/compare/prefix-v1.0.0..prefix-v0.1.0')
})

it('supports a version override', () => {
Expand Down

0 comments on commit 2b4aa45

Please sign in to comment.