com karma: Ignore refs/heads/ in branchnames: lib/Git/PostReceiveHook.php
| From: | David Soria Parra | Date: | Tue, 20 Mar 2012 17:53:22 +0000 |
| Subject: | com karma: Ignore refs/heads/ in branchnames: lib/Git/PostReceiveHook.php | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-68088@lists.php.net to get a copy of this message | ||
Commit: 44ed570277e783a94f05248cb767731ed5001e68
Author: David Soria Parra <dsp@php.net> Tue, 20 Mar 2012 18:53:22 +0100
Parents: 7b8230a7dff0f8b04b92a6ab481964513afced03
Branches: refs/heads/master
Link: http://git.php.net/?p=karma.git;a=commitdiff;h=44ed570277e783a94f05248cb767731ed5001e68
Log:
Ignore refs/heads/ in branchnames
Changed paths:
M lib/Git/PostReceiveHook.php
Diff:
44ed570277e783a94f05248cb767731ed5001e68
diff --git a/lib/Git/PostReceiveHook.php b/lib/Git/PostReceiveHook.php
index 89e0a45..e1286b6 100644
--- a/lib/Git/PostReceiveHook.php
+++ b/lib/Git/PostReceiveHook.php
@@ -495,6 +495,10 @@ class PostReceiveHook extends ReceiveHook
private function sendCommitMail($revision, $branches)
{
+ $bnames = array_map(function($x) {
+ return str_replace('refs/heads/', '', $x);
+ }, $branches);
+
$info = $this->getCommitInfo($revision);
$paths = $this->getChangedPaths(escapeshellarg($revision));
$pathsString = '';
@@ -517,7 +521,7 @@ class PostReceiveHook extends ReceiveHook
}
if ($info['parents']) $message .= 'Parents: ' .
$info['parents'] . "\n";
- $message .= "\n" . "Branches: " . implode(' ', $branches) .
"\n";
+ $message .= "Branches: " . implode(' ', $bnames) . "\n";
$message .= "\n" . "Link: http://git.php.net/?p=" . $this->getRepositoryName()
. ";a=commitdiff;h=" . $revision . "\n";
$message .= "\nLog:\n" . $info['log'] . "\n";