]> Lady’s Gitweb - Gitweb/blobdiff - gitweb.perl
gitweb: Simplify snapshot format detection logic in evaluate_path_info
[Gitweb] / gitweb.perl
index 80475c218436f8583c50f00128df19999d4bd82393710cd2aad623d803d192ab..acc010d89008505e5bcfe039c0366c9218758ab0efa4c631b4bde0606cd1c259 100755 (executable)
@@ -691,9 +691,10 @@ sub evaluate_path_info {
                # format key itself, with a prepended dot
                while (my ($fmt, $opt) = each %known_snapshot_formats) {
                        my $hash = $refname;
-                       my $sfx;
-                       $hash =~ s/(\Q$opt->{'suffix'}\E|\Q.$fmt\E)$//;
-                       next unless $sfx = $1;
+                       unless ($hash =~ s/(\Q$opt->{'suffix'}\E|\Q.$fmt\E)$//) {
+                               next;
+                       }
+                       my $sfx = $1;
                        # a valid suffix was found, so set the snapshot format
                        # and reset the hash parameter
                        $input_params{'snapshot_format'} = $fmt;
This page took 0.236592 seconds and 4 git commands to generate.