Skip to content

Commit 2009035

Browse files
author
Rodrigo Farias
committed
Gitweb: handle '+' in import_commits as well
1 parent eead187 commit 2009035

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

SourceGitweb/SourceGitweb.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,14 @@ private function import_commits( $p_repo, $p_uri_base, $p_commit_ids, $p_branch=
222222

223223
echo "Retrieving $t_commit_id ... ";
224224

225-
$t_commit_url = $this->uri_base( $p_repo ) . 'a=commit;h=' . $t_commit_id;
225+
# Handle branch names with '+' character
226+
$t_fixed_id = str_replace('+', '%2B', $t_commit_id);
227+
$t_commit_url = $this->uri_base( $p_repo ) . 'a=commit;h=' . $t_fixed_id;
226228
$t_input = url_get( $t_commit_url );
227229

228230
if ( false === $t_input ) {
229231
echo "failed.\n";
232+
echo "$t_commit_url\n"; # DEBUG
230233
continue;
231234
}
232235

0 commit comments

Comments
 (0)