-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating pull request returns 500 error because of commit symbol #14470
Comments
If is this repository a public one? |
private |
I bet the issue is that the name of the branch contains exactly 40 characters |
GetCommit() assumes that all 40 char strings are SHA1s. This leads to an error if you try to do a PR on a branch which is 40 characters long. This PR attempts the SHA first - and if it fails will switch to using rev-parse. Fix go-gitea#14470 Signed-off-by: Andrew Thornton <art27@cantab.net>
Apologies for this I've predicted this issue for a very long time but haven't told anyone about it or fixed it. The provided fix is by no means perfect as a branch whose name matches the sha pattern could still collide in interesting and undefined ways and so we will need deeper testing to figure out what we want. |
GetCommit() assumes that all 40 char strings are SHA1s. This leads to an error if you try to do a PR on a branch which is 40 characters long. This PR attempts the SHA first - and if it fails will switch to using rev-parse. Fix #14470 Signed-off-by: Andrew Thornton <art27@cantab.net>
@zeripath this is also on the v1.13.3 milestones so needs a backport. |
Done it now |
Backport go-gitea#14624 GetCommit() assumes that all 40 char strings are SHA1s. This leads to an error if you try to do a PR on a branch which is 40 characters long. This PR attempts the SHA first - and if it fails will switch to using rev-parse. Fix go-gitea#14470 Signed-off-by: Andrew Thornton <art27@cantab.net>
1.14.0+dev-534-gedbc5c86d
2.26.2
docker Alpine Linux v3.12
[x]
):2021/01/26 14:11:06 ...ters/repo/compare.go:477:PrepareCompareDiff() [E] GetCommit: encoding/hex: invalid byte: U+004B 'K'
Description
...
Screenshots
The text was updated successfully, but these errors were encountered: