go-git icon indicating copy to clipboard operation
go-git copied to clipboard

failure to identify "repo not found" on bitbucket server

Open noam-codefresh opened this issue 3 years ago • 0 comments

when i try to clone a repository that does not exist on my on-prem bitbucket server, the server returns http 200 with the following body:

ERR Repository not found\nThe requested repository does not exist, or you do not have permission to\naccess it.

the go-git library expects a 200 response to contain only git hashes (hexadecimal values), and fails decoding the response when it encounters the 2nd character R. as a result, the library fails to identify the failre as "repo not found" it seems like this is more of a bug in bitbucket server behavior, but maybe the go-git library can be a bit more flexible with its expectations, and handle this a bit better?

tested on bitbucket server 6.10 and 8.2. it does not happen with bitbucket cloud service.

noam-codefresh avatar Jul 11 '22 09:07 noam-codefresh