Skip to content

Commit

Permalink
gitweb: Fix snapshots requested via PATH_INFO
Browse files Browse the repository at this point in the history
Fix the detection of the requested snapshot format, which failed for
PATH_INFO URLs since the references to the hashes which describe the
supported snapshot formats weren't dereferenced appropriately.

Signed-off-by: Holger Weiß <holger@zedat.fu-berlin.de>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Holger Weiß authored and Junio C Hamano committed Apr 20, 2009
1 parent 21590d5 commit ccb4b53
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -688,10 +688,10 @@ sub evaluate_path_info {
# extensions. Allowed extensions are both the defined suffix
# (which includes the initial dot already) and the snapshot
# format key itself, with a prepended dot
while (my ($fmt, %opt) = each %known_snapshot_formats) {
while (my ($fmt, $opt) = each %known_snapshot_formats) {
my $hash = $refname;
my $sfx;
$hash =~ s/(\Q$opt{'suffix'}\E|\Q.$fmt\E)$//;
$hash =~ s/(\Q$opt->{'suffix'}\E|\Q.$fmt\E)$//;
next unless $sfx = $1;
# a valid suffix was found, so set the snapshot format
# and reset the hash parameter
Expand Down

0 comments on commit ccb4b53

Please sign in to comment.