Skip to content

Commit 4f10027

Browse files
authored
Use 3-dot compare URL for GitHub (#35)
1 parent 7bf011c commit 4f10027

File tree

3 files changed

+25
-25
lines changed

3 files changed

+25
-25
lines changed

src/Url/GithubGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function getCompareUrl(PackageInterface $initialPackage, PackageInterface
2020
$targetMaintainer = $this->getUser($targetPackage);
2121
$targetVersion = ($baseMaintainer !== $targetMaintainer ? $targetMaintainer.':' : '').$this->getCompareRef($targetPackage);
2222

23-
return sprintf('%s/compare/%s..%s', $baseUrl, $this->getCompareRef($initialPackage), $targetVersion);
23+
return sprintf('%s/compare/%s...%s', $baseUrl, $this->getCompareRef($initialPackage), $targetVersion);
2424
}
2525

2626
/**

tests/Command/DiffCommandTest.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -140,15 +140,15 @@ public function outputDataProvider()
140140
),
141141
'Markdown with URLs' => array(
142142
<<<OUTPUT
143-
| Prod Packages | Operation | Base | Target | Link |
144-
|----------------------------|------------|-------|--------|--------------------------------------------|
145-
| [a/package-1](github.com) | New | - | 1.0.0 | [Compare](github.com/releases/tag/1.0.0) |
146-
| [a/package-2](github.com) | Upgraded | 1.0.0 | 1.2.0 | [Compare](github.com/compare/1.0.0..1.2.0) |
147-
| [a/package-3](github.com) | Removed | 0.1.1 | - | [Compare](github.com/releases/tag/0.1.1) |
148-
| [a/package-4](gitlab.org) | Removed | 0.1.1 | - | [Compare](gitlab.org/tags/0.1.1) |
149-
| [a/package-5](gitlab2.org) | Removed | 0.1.1 | - | [Compare](gitlab2.org/tags/0.1.1) |
150-
| a/package-6 | Removed | 0.1.1 | - | |
151-
| [a/package-7](github.com) | Downgraded | 1.2.0 | 1.0.0 | [Compare](github.com/compare/1.2.0..1.0.0) |
143+
| Prod Packages | Operation | Base | Target | Link |
144+
|----------------------------|------------|-------|--------|---------------------------------------------|
145+
| [a/package-1](github.com) | New | - | 1.0.0 | [Compare](github.com/releases/tag/1.0.0) |
146+
| [a/package-2](github.com) | Upgraded | 1.0.0 | 1.2.0 | [Compare](github.com/compare/1.0.0...1.2.0) |
147+
| [a/package-3](github.com) | Removed | 0.1.1 | - | [Compare](github.com/releases/tag/0.1.1) |
148+
| [a/package-4](gitlab.org) | Removed | 0.1.1 | - | [Compare](gitlab.org/tags/0.1.1) |
149+
| [a/package-5](gitlab2.org) | Removed | 0.1.1 | - | [Compare](gitlab2.org/tags/0.1.1) |
150+
| a/package-6 | Removed | 0.1.1 | - | |
151+
| [a/package-7](github.com) | Downgraded | 1.2.0 | 1.0.0 | [Compare](github.com/compare/1.2.0...1.0.0) |
152152
153153
154154
OUTPUT
@@ -161,15 +161,15 @@ public function outputDataProvider()
161161
),
162162
'Markdown with URLs and custom gitlab domains' => array(
163163
<<<OUTPUT
164-
| Prod Packages | Operation | Base | Target | Link |
165-
|----------------------------|------------|-------|--------|--------------------------------------------|
166-
| [a/package-1](github.com) | New | - | 1.0.0 | [Compare](github.com/releases/tag/1.0.0) |
167-
| [a/package-2](github.com) | Upgraded | 1.0.0 | 1.2.0 | [Compare](github.com/compare/1.0.0..1.2.0) |
168-
| [a/package-3](github.com) | Removed | 0.1.1 | - | [Compare](github.com/releases/tag/0.1.1) |
169-
| [a/package-4](gitlab.org) | Removed | 0.1.1 | - | [Compare](gitlab.org/tags/0.1.1) |
170-
| [a/package-5](gitlab2.org) | Removed | 0.1.1 | - | [Compare](gitlab2.org/tags/0.1.1) |
171-
| [a/package-6](gitlab3.org) | Removed | 0.1.1 | - | [Compare](gitlab3.org/tags/0.1.1) |
172-
| [a/package-7](github.com) | Downgraded | 1.2.0 | 1.0.0 | [Compare](github.com/compare/1.2.0..1.0.0) |
164+
| Prod Packages | Operation | Base | Target | Link |
165+
|----------------------------|------------|-------|--------|---------------------------------------------|
166+
| [a/package-1](github.com) | New | - | 1.0.0 | [Compare](github.com/releases/tag/1.0.0) |
167+
| [a/package-2](github.com) | Upgraded | 1.0.0 | 1.2.0 | [Compare](github.com/compare/1.0.0...1.2.0) |
168+
| [a/package-3](github.com) | Removed | 0.1.1 | - | [Compare](github.com/releases/tag/0.1.1) |
169+
| [a/package-4](gitlab.org) | Removed | 0.1.1 | - | [Compare](gitlab.org/tags/0.1.1) |
170+
| [a/package-5](gitlab2.org) | Removed | 0.1.1 | - | [Compare](gitlab2.org/tags/0.1.1) |
171+
| [a/package-6](gitlab3.org) | Removed | 0.1.1 | - | [Compare](gitlab3.org/tags/0.1.1) |
172+
| [a/package-7](github.com) | Downgraded | 1.2.0 | 1.0.0 | [Compare](github.com/compare/1.2.0...1.0.0) |
173173
174174
175175
OUTPUT

tests/Url/GithubGeneratorTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -70,32 +70,32 @@ public function compareUrlProvider()
7070
'same maintainer' => array(
7171
$this->getPackageWithSource('acme/package', '3.12.0', 'https://github.com/acme/package.git'),
7272
$this->getPackageWithSource('acme/package', '3.12.1', 'https://github.com/acme/package.git'),
73-
'https://github.com/acme/package/compare/3.12.0..3.12.1',
73+
'https://github.com/acme/package/compare/3.12.0...3.12.1',
7474
),
7575
'without .git' => array(
7676
$this->getPackageWithSource('acme/package', '3.12.0', 'https://github.com/acme/package'),
7777
$this->getPackageWithSource('acme/package', '3.12.1', 'https://github.com/acme/package'),
78-
'https://github.com/acme/package/compare/3.12.0..3.12.1',
78+
'https://github.com/acme/package/compare/3.12.0...3.12.1',
7979
),
8080
'dev versions' => array(
8181
$this->getPackageWithSource('acme/package', 'dev-master', 'https://github.com/acme/package.git', 'd46283075d76ed244f7825b378eeb1cee246af73'),
8282
$this->getPackageWithSource('acme/package', 'dev-master', 'https://github.com/acme/package.git', '9b860214d58c48b5cbe99bdb17914d0eb723c9cd'),
83-
'https://github.com/acme/package/compare/d462830..9b86021',
83+
'https://github.com/acme/package/compare/d462830...9b86021',
8484
),
8585
'invalid or short reference' => array(
8686
$this->getPackageWithSource('acme/package', 'dev-master', 'https://github.com/acme/package.git', 'd462830'),
8787
$this->getPackageWithSource('acme/package', 'dev-master', 'https://github.com/acme/package.git', '1'),
88-
'https://github.com/acme/package/compare/d462830..1',
88+
'https://github.com/acme/package/compare/d462830...1',
8989
),
9090
'compare with base fork' => array(
9191
$this->getPackageWithSource('acme/package', '3.12.0', 'https://github.com/IonBazan/package.git'),
9292
$this->getPackageWithSource('acme/package', '3.12.1', 'https://github.com/acme/package.git'),
93-
'https://github.com/IonBazan/package/compare/3.12.0..acme:3.12.1',
93+
'https://github.com/IonBazan/package/compare/3.12.0...acme:3.12.1',
9494
),
9595
'compare with head fork' => array(
9696
$this->getPackageWithSource('acme/package', '3.12.0', 'https://github.com/acme/package.git'),
9797
$this->getPackageWithSource('acme/package', '3.12.1', 'https://github.com/IonBazan/package.git'),
98-
'https://github.com/acme/package/compare/3.12.0..IonBazan:3.12.1',
98+
'https://github.com/acme/package/compare/3.12.0...IonBazan:3.12.1',
9999
),
100100
'compare with different repository provider' => array(
101101
$this->getPackageWithSource('acme/package', '3.12.0', 'https://github.com/acme/package.git'),

0 commit comments

Comments
 (0)