diff options
author | Jakub Narebski <jnareb@gmail.com> | 2010-10-13 13:33:48 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-10-13 09:40:19 -0700 |
commit | 7e00dc58d14a5f8ea229e5a0acf5f019028e3a40 (patch) | |
tree | 03144155da157e38cc294558f0552b0d52902231 /gitweb | |
parent | ae5e97ec40a36408a8f90973c23e6143741ec732 (diff) | |
download | git-7e00dc58d14a5f8ea229e5a0acf5f019028e3a40.tar.gz |
gitweb: Fix bug in evaluate_path_info
There was bug in parsing "project/:/file" and "project/:/" path_info
URLs, with implicit HEAD as 'hash_base'.
For such URLs the refname is empty, and before this fix regexp for
parsing path_info fragment assumed that it is always non-empty.
Refname cannot contain ':', as per 'git check-ref-format'.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb')
-rwxr-xr-x | gitweb/gitweb.perl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index e5910ce8f9..c4d3e0846a 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -780,10 +780,10 @@ sub evaluate_path_info { 'history', ); - # we want to catch + # we want to catch, among others # [$hash_parent_base[:$file_parent]..]$hash_parent[:$file_name] my ($parentrefname, $parentpathname, $refname, $pathname) = - ($path_info =~ /^(?:(.+?)(?::(.+))?\.\.)?(.+?)(?::(.+))?$/); + ($path_info =~ /^(?:(.+?)(?::(.+))?\.\.)?([^:]+?)?(?::(.+))?$/); # first, analyze the 'current' part if (defined $pathname) { |