git » git-arr » commit aaf2968

route: commit: match only hexadecimal rather than digits + full alphabet

author Eric Sunshine
2014-12-31 09:50:07 UTC
committer Alberto Bertogli
2015-01-11 21:18:10 UTC
parent 420afd3206d59ca76309087234f838edb32d7b8b

route: commit: match only hexadecimal rather than digits + full alphabet

A human-readable representation of a Git SHA1 commit ID is composed
only of hexadecimal digits, thus there is no need to match against
the full alphabet.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

git-arr +1 -1

diff --git a/git-arr b/git-arr
index b9c9d46..bd38324 100755
--- a/git-arr
+++ b/git-arr
@@ -217,7 +217,7 @@ def summary(repo):
 def branch(repo, bname, offset = 0):
     return dict(repo = repo.new_in_branch(bname), offset = offset)
 
-@bottle.route('/r/<repo:repo>/c/<cid:re:[0-9a-z]{5,40}>/')
+@bottle.route('/r/<repo:repo>/c/<cid:re:[0-9a-f]{5,40}>/')
 @bottle.view('commit')
 @with_utils
 def commit(repo, cid):