Git 分支和标记无法通过API删除
问题: 将GitLab从Git 分支和标记无法通过API删除,git,curl,gitlab,gitlab-api,Git,Curl,Gitlab,Gitlab Api,问题: 将GitLab从9.3.6升级到10.3.5后,如果分支和标记删除API包含/在名称中,则该API不起作用(例如release/branch)。但它在旧版本中有效 C:\Users\test>curl.exe --request DELETE --header "PRIVATE-TOKEN:token" "https://gitlab.company.com/api/v4/projects/1582/repository/branches/test/test" {"error":"
9.3.6
升级到10.3.5
后,如果分支和标记删除API包含/在名称中,则该API不起作用(例如release/branch
)。但它在旧版本中有效
C:\Users\test>curl.exe --request DELETE --header "PRIVATE-TOKEN:token" "https://gitlab.company.com/api/v4/projects/1582/repository/branches/test/test"
{"error":"404 Not Found"}
C:\Users\test>curl.exe --request DELETE --header "PRIVATE-TOKEN:token" "https://gitlab.company.com/api/v4/projects/1582/repository/branches/testz"
C:\Users\test>curl.exe --request DELETE --header "PRIVATE-TOKEN:token" "https://gitlab.company.com/api/v4/projects/1582/repository/tags/tag/test"
{"error":"404 Not Found"}
C:\Users\test>curl.exe --request DELETE --header "PRIVATE-TOKEN:token" "https://gitlab.company.com/api/v4/projects/1582/repository/tags/tagtest"
在上面的curl数据中,我可以删除分支
testz
,但是test/test
也会在标记中抛出相同的错误。如何通过API删除这些分支?因为它是一个URL,有些字符在上下文之外是不能使用的。例如,在URL的中间没有一个“代码”>Straye} /代码>,即使该区域表示一个字符串,所以您必须使用<代码> %20 而不是<代码>
对于test/test
,您可能需要将/
替换为%2F
所以测试%2Ftest