Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit736fece

Browse files
author
Gauvain Pocentek
committed
Fix URL encoding on branch methods
Fixes#493
1 parent86a8251 commit736fece

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎gitlab/v4/objects.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,8 @@ def protect(self, developers_can_push=False, developers_can_merge=False,
882882
GitlabAuthenticationError: If authentication is not correct
883883
GitlabProtectError: If the branch could not be protected
884884
"""
885-
path='%s/%s/protect'% (self.manager.path,self.get_id())
885+
id=self.get_id().replace('/','%2F')
886+
path='%s/%s/protect'% (self.manager.path,id)
886887
post_data= {'developers_can_push':developers_can_push,
887888
'developers_can_merge':developers_can_merge}
888889
self.manager.gitlab.http_put(path,post_data=post_data,**kwargs)
@@ -900,7 +901,8 @@ def unprotect(self, **kwargs):
900901
GitlabAuthenticationError: If authentication is not correct
901902
GitlabProtectError: If the branch could not be unprotected
902903
"""
903-
path='%s/%s/unprotect'% (self.manager.path,self.get_id())
904+
id=self.get_id().replace('/','%2F')
905+
path='%s/%s/unprotect'% (self.manager.path,id)
904906
self.manager.gitlab.http_put(path,**kwargs)
905907
self._attrs['protected']=False
906908

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp