@@ -22,7 +22,7 @@ public function branches($project_id, array $parameters = [])
22
22
*/
23
23
public function branch ($ project_id , $ branch_id )
24
24
{
25
- return $ this ->get ($ this ->getProjectPath ($ project_id , 'repository/branches/ ' .$ this ->encodeBranch ($ branch_id )));
25
+ return $ this ->get ($ this ->getProjectPath ($ project_id , 'repository/branches/ ' .$ this ->encodePath ($ branch_id )));
26
26
}
27
27
28
28
/**
@@ -46,7 +46,7 @@ public function createBranch($project_id, $branch, $ref)
46
46
*/
47
47
public function deleteBranch ($ project_id , $ branch )
48
48
{
49
- return $ this ->delete ($ this ->getProjectPath ($ project_id , 'repository/branches/ ' .$ this ->encodeBranch ($ branch )));
49
+ return $ this ->delete ($ this ->getProjectPath ($ project_id , 'repository/branches/ ' .$ this ->encodePath ($ branch )));
50
50
}
51
51
52
52
/**
@@ -58,7 +58,7 @@ public function deleteBranch($project_id, $branch)
58
58
*/
59
59
public function protectBranch ($ project_id , $ branch_name , $ devPush = false , $ devMerge = false )
60
60
{
61
- return $ this ->put ($ this ->getProjectPath ($ project_id , 'repository/branches/ ' .$ this ->encodeBranch ($ branch_name ).'/protect ' ), array (
61
+ return $ this ->put ($ this ->getProjectPath ($ project_id , 'repository/branches/ ' .$ this ->encodePath ($ branch_name ).'/protect ' ), array (
62
62
'developers_can_push ' => $ devPush ,
63
63
'developers_can_merge ' => $ devMerge
64
64
));
@@ -71,7 +71,7 @@ public function protectBranch($project_id, $branch_name, $devPush = false, $devM
71
71
*/
72
72
public function unprotectBranch ($ project_id , $ branch_name )
73
73
{
74
- return $ this ->put ($ this ->getProjectPath ($ project_id , 'repository/branches/ ' .$ this ->encodeBranch ($ branch_name ).'/unprotect ' ));
74
+ return $ this ->put ($ this ->getProjectPath ($ project_id , 'repository/branches/ ' .$ this ->encodePath ($ branch_name ).'/unprotect ' ));
75
75
}
76
76
77
77
/**
@@ -111,7 +111,7 @@ public function createTag($project_id, $name, $ref, $message = null)
111
111
*/
112
112
public function createRelease ($ project_id , $ tag_name , $ description )
113
113
{
114
- return $ this ->post ($ this ->getProjectPath ($ project_id , 'repository/tags/ ' . $ this ->encodeBranch ($ tag_name ) . '/release ' ), array (
114
+ return $ this ->post ($ this ->getProjectPath ($ project_id , 'repository/tags/ ' . $ this ->encodePath ($ tag_name ) . '/release ' ), array (
115
115
'id ' => $ project_id ,
116
116
'tag_name ' => $ tag_name ,
117
117
'description ' => $ description
@@ -127,7 +127,7 @@ public function createRelease($project_id, $tag_name, $description)
127
127
*/
128
128
public function updateRelease ($ project_id , $ tag_name , $ description )
129
129
{
130
- return $ this ->put ($ this ->getProjectPath ($ project_id , 'repository/tags/ ' . $ this ->encodeBranch ($ tag_name ) . '/release ' ), array (
130
+ return $ this ->put ($ this ->getProjectPath ($ project_id , 'repository/tags/ ' . $ this ->encodePath ($ tag_name ) . '/release ' ), array (
131
131
'id ' => $ project_id ,
132
132
'tag_name ' => $ tag_name ,
133
133
'description ' => $ description
@@ -279,7 +279,7 @@ public function compare($project_id, $fromShaOrMaster, $toShaOrMaster)
279
279
{
280
280
return $ this ->get ($ this ->getProjectPath (
281
281
$ project_id ,
282
- 'repository/compare?from= ' .$ this ->encodeBranch ($ fromShaOrMaster ).'&to= ' .$ this ->encodeBranch ($ toShaOrMaster )
282
+ 'repository/compare?from= ' .$ this ->encodePath ($ fromShaOrMaster ).'&to= ' .$ this ->encodePath ($ toShaOrMaster )
283
283
));
284
284
}
285
285
@@ -422,15 +422,4 @@ public function archive($project_id, $params = array(), $format = 'tar.gz')
422
422
{
423
423
return $ this ->get ($ this ->getProjectPath ($ project_id , 'repository/archive. ' .$ format ), $ params );
424
424
}
425
-
426
- /**
427
- * @param string $path
428
- * @return string
429
- */
430
- protected function encodeBranch ($ path )
431
- {
432
- $ path = $ this ->encodePath ($ path );
433
-
434
- return str_replace ('%2F ' , '/ ' , $ path );
435
- }
436
425
}
0 commit comments