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 SHA1 hash linking (#2143) #2293

Merged
merged 1 commit into from
Aug 12, 2017
Merged

Commits on Aug 11, 2017

  1. Fix SHA1 hash linking (go-gitea#2143)

    This changes the regex to look for a hash from 7 to 40 characters,
    to match the use of abbreviated hash lookups in both git and github.
    The restriction of not being a pure number is also removed because
    1234567 is now considered a valid abbreviated hash, as is deadbeef.
    
    A note has been added to the top of the code to state that the
    literal regex match is fine, but no extra validation is currently
    performed so some false positives are expected.
    
    A future change could ensure that the hash exists in the repository
    before rendering it as a link, although this might incur a slight
    performance penalty.
    
    Reverts part of commit 4a46613 and fixes go-gitea#2053.
    rsmarples authored and lunny committed Aug 11, 2017
    Configuration menu
    Copy the full SHA
    c8a5adb View commit details
    Browse the repository at this point in the history