Skip to content
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

Fix #3743: Fix SHA and compare regex on route file [Critical] #3851

Merged
merged 1 commit into from
Dec 22, 2016
Merged

Fix #3743: Fix SHA and compare regex on route file [Critical] #3851

merged 1 commit into from
Dec 22, 2016

Conversation

thibaultmeyer
Copy link
Contributor

Related to the issue #3743, this pull request fix the regex used on the route file for SHA and branches comparisons.

  • A SHA hash can only contains a b c d e f 0 1 2 3 4 5 6 7 8 9
  • A branch name could be smaller than 7 characters

Copy link
Contributor

@bkcsoft bkcsoft left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Breaking Fix


m.Get("/compare/:before([a-z0-9]{7,40})\\.\\.\\.:after([a-z0-9]{7,40})", repo.CompareDiff)
m.Get("/compare/:before([a-z0-9]{40})\\.\\.\\.:after([a-z0-9]{40})", repo.CompareDiff)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And now I can't compare master...develop anymore 😒

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are you sure ?

EDIT: just tested, it working!

http://127.0.0.1:3000/test/core/compare/master...develop

image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh [a-z], I read it as [a-f] 😄

@samuelson
Copy link

+1

@strk
Copy link
Contributor

strk commented Nov 7, 2016

is this also already fixed in gitea ?

@samuelson
Copy link

@unknwon
Copy link
Member

unknwon commented Dec 22, 2016

Thanks!

@unknwon unknwon merged commit 93616fe into gogs:develop Dec 22, 2016
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants