Skip to content

Commit eead187

Browse files
author
Rodrigo Farias
committed
Gitweb: handle branch names with '+' character
1 parent 8bbc17d commit eead187

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

SourceGitweb/SourceGitweb.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,9 @@ public function precommit( ) {
117117
}
118118

119119
public function commit( $p_repo, $p_data ) {
120+
# Handle branch names with '+' character
121+
$p_data = str_replace('_plus_', '+', $p_data);
122+
120123
# The -d option from curl requires you to encode your own data.
121124
# Once it reaches here it is decoded. Hence we split by a space
122125
# were as the curl command uses a '+' character instead.

SourceGitweb/post-receive.tmpl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
# Licensed under the MIT license
55

66
read LINE
7+
8+
# Handle branch names with '+' character
9+
LINE=`echo $LINE | sed -e 's/+/_plus_/g'`
10+
711
LINE=`echo $LINE | sed -e 's/ /+/g'`
812

913
URL="http://localhost/mantisbt/plugin.php?page=Source/checkin"

0 commit comments

Comments
 (0)