Code

gitweb: Fix snapshots requested via PATH_INFO
authorHolger Weiß <holger@zedat.fu-berlin.de>
Tue, 31 Mar 2009 16:16:36 +0000 (18:16 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 20 Apr 2009 10:42:23 +0000 (03:42 -0700)
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>
gitweb/gitweb.perl

index 33ef190ceb99565f804783ba9fe76987ad6bea89..3f99361ed03b8d5202cb17e894c65678364fc1ed 100755 (executable)
@@ -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