Skip to content

Commit 55cb1b2

Browse files
Revert "[11.5] Add from_project_id to Repositories::compare (#652)"
This reverts commit 6f6c297.
1 parent 50b3700 commit 55cb1b2

File tree

2 files changed

+5
-27
lines changed

2 files changed

+5
-27
lines changed

src/Api/Repositories.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -403,25 +403,20 @@ public function postCommitBuildStatus($project_id, string $sha, string $state, a
403403
}
404404

405405
/**
406-
* @param int|string $project_id
407-
* @param string $fromShaOrMaster
408-
* @param string $toShaOrMaster
409-
* @param bool $straight
410-
* @param string|null $fromProjectId
406+
* @param int|string $project_id
407+
* @param string $fromShaOrMaster
408+
* @param string $toShaOrMaster
409+
* @param bool $straight
411410
*
412411
* @return mixed
413412
*/
414-
public function compare($project_id, string $fromShaOrMaster, string $toShaOrMaster, bool $straight = false, string $fromProjectId = null)
413+
public function compare($project_id, string $fromShaOrMaster, string $toShaOrMaster, bool $straight = false)
415414
{
416415
$params = [
417416
'from' => self::encodePath($fromShaOrMaster),
418417
'to' => self::encodePath($toShaOrMaster),
419418
'straight' => self::encodePath($straight ? 'true' : 'false'),
420419
];
421-
422-
if (null !== $fromProjectId) {
423-
$params['from_project_id'] = self::encodePath($fromProjectId);
424-
}
425420

426421
return $this->get($this->getProjectPath($project_id, 'repository/compare'), $params);
427422
}

tests/Api/RepositoriesTest.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -541,23 +541,6 @@ public function shouldNotCompareStraight(): void
541541
$this->assertEquals($expectedArray, $api->compare(1, 'master', 'feature'));
542542
}
543543

544-
/**
545-
* @test
546-
*/
547-
public function shouldCompareWithFromProjectId(): void
548-
{
549-
$expectedArray = ['commit' => 'object'];
550-
551-
$api = $this->getApiMock();
552-
$api->expects($this->once())
553-
->method('get')
554-
->with('projects/1/repository/compare', ['from' => 'master', 'to' => 'feature', 'straight' => 'true', 'from_project_id' => '123'])
555-
->will($this->returnValue($expectedArray))
556-
;
557-
558-
$this->assertEquals($expectedArray, $api->compare(1, 'master', 'feature', true, '123'));
559-
}
560-
561544
/**
562545
* @test
563546
*/

0 commit comments

Comments
 (0)