seveas / git-spindle

Abandoned command-line interface to GitHub and other central git services
Other
172 stars 35 forks source link

GitlabProtectError (404 Not Found) when [un]protecting feature and release branches #171

Closed AKalatur closed 2 years ago

AKalatur commented 6 years ago

Following commands began to fail git lab unprotect feature_name/branch_name git lab protect feature_name/branch_name after GitLab server was upgraded to 10.2.2.

Error: gitspindle.glapi.GitlabProtectError: 404: b'{"error":"404 Not Found"}'

It happens because GitLab REST API does not accept branch name which contains slash /. Slash sign should be replaced with %2F. Git-spindle creates URL from branch name that was added as a parameter to protect/unprotect command without proper encoding. url = "%s/%s/%s" % (url, self.name, action)