diff options
Diffstat (limited to 'php-gitter-pr47.patch')
-rw-r--r-- | php-gitter-pr47.patch | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/php-gitter-pr47.patch b/php-gitter-pr47.patch new file mode 100644 index 0000000..007d598 --- /dev/null +++ b/php-gitter-pr47.patch @@ -0,0 +1,65 @@ +From c02d283c43151120b93e96141df1a8e465b25d8c Mon Sep 17 00:00:00 2001 +From: Remi Collet <fedora@famillecollet.com> +Date: Sun, 24 May 2015 08:31:28 +0200 +Subject: [PATCH] fix for git 2.4.x + +--- + lib/Gitter/Repository.php | 8 ++++++-- + tests/Gitter/Tests/RepositoryTest.php | 6 +++--- + 2 files changed, 9 insertions(+), 5 deletions(-) + +diff --git a/lib/Gitter/Repository.php b/lib/Gitter/Repository.php +index 7391125..a40733c 100644 +--- a/lib/Gitter/Repository.php ++++ b/lib/Gitter/Repository.php +@@ -244,7 +244,9 @@ public function getBranches() + // Since we've stripped whitespace, the result "* (detached from " + // and "* (no branch)" that is displayed in detached HEAD state + // becomes "(detachedfrom" and "(nobranch)" respectively. +- if ((strpos($branches[0], '(detachedfrom') === 0) || ($branches[0] === '(nobranch)')) { ++ if ((strpos($branches[0], '(detachedfrom') === 0) ++ || (strpos($branches[0], '(HEADdetachedat') === 0) ++ || ($branches[0] === '(nobranch)')) { + $branches = array_slice($branches, 1); + } + +@@ -264,7 +266,9 @@ public function getCurrentBranch() + + foreach ($branches as $branch) { + if ($branch[0] === '*') { +- if ((strpos($branch, '* (detached from ') === 0) || ($branch === '* (no branch)')) { ++ if ((strpos($branch, '* (detached from ') === 0) ++ || (strpos($branch, '* (HEAD detached at ') === 0) ++ || ($branch === '* (no branch)')) { + return NULL; + } + +diff --git a/tests/Gitter/Tests/RepositoryTest.php b/tests/Gitter/Tests/RepositoryTest.php +index cc6e7ef..312d041 100755 +--- a/tests/Gitter/Tests/RepositoryTest.php ++++ b/tests/Gitter/Tests/RepositoryTest.php +@@ -176,13 +176,13 @@ public function testIsGettingCurrentBranch() + { + $repository = $this->client->getRepository(self::$tmpdir . '/testrepo'); + $branch = $repository->getCurrentBranch(); +- $this->assertTrue($branch === 'master'); ++ $this->assertEquals('master', $branch); + + $commits = $repository->getCommits(); + $hash = $commits[0]->getHash(); + $repository->checkout($hash); + $new_branch = $repository->getCurrentBranch(); +- $this->assertTrue($new_branch === NULL); ++ $this->assertNull($new_branch); + + $repository->checkout($branch); + } +@@ -195,7 +195,7 @@ public function testIsGettingBranchesWhenHeadIsDetached() + $hash = $commits[0]->getHash(); + $repository->checkout($hash); + $branches = $repository->getBranches(); +- $this->assertTrue(count($branches) === 3); ++ $this->assertEquals(3, count($branches), print_r($branches, true)); + + $branch = $repository->getHead('develop'); + $repository->checkout($current_branch); |