go-git / go-git

A highly extensible Git implementation in pure Go.
https://pkg.go.dev/github.com/go-git/go-git/v5
Apache License 2.0
5.84k stars 732 forks source link

failure to identify "repo not found" on bitbucket server #552

Open noam-codefresh opened 2 years ago

noam-codefresh commented 2 years ago

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.

github-actions[bot] commented 1 month ago

To help us keep things tidy and focus on the active tasks, we've introduced a stale bot to spot issues/PRs that haven't had any activity in a while.

This particular issue hasn't had any updates or activity in the past 90 days, so it's been labeled as 'stale'. If it remains inactive for the next 30 days, it'll be automatically closed.

We understand everyone's busy, but if this issue is still important to you, please feel free to add a comment or make an update to keep it active.

Thanks for your understanding and cooperation!