]> Lady’s Gitweb - Gitweb/commit
gitweb: Simplify snapshot format detection logic in evaluate_path_info
authorJakub Narebski <redacted>
Mon, 11 May 2009 17:42:47 +0000 (19:42 +0200)
committerLady <redacted>
Mon, 6 Apr 2026 04:50:38 +0000 (00:50 -0400)
commit7d255b8dc1ebe1fa235fe0342ed212e7850d760fa5669fe125225bfa6d0a9a45
tree5e0b894249e3a78c0419afc7dd9ddc685fa141970a8493f88177f7c1a993cf6f
parent23edf6c6b83a0c58c8e13da33d389a70264eb18a91173ae019ed59548fc19277
gitweb: Simplify snapshot format detection logic in evaluate_path_info

This issue was caught by perlcritic in harsh severity level noticing
that catch variable was used outside conditional thanks to the
Perl::Critic::Policy::RegularExpressions::ProhibitCaptureWithoutTest
policy.  See "Perl Best Practices", chapter 12. Regular Expressions,
section 12.15. Captured Values:

   Pattern matches that fail never assign anything to $1, $2, etc.,
   nor do they leave those variables undefined. After an unsuccessful
   pattern match, the numeric capture variables remain exactly as they
   were before the match was attempted.

New version is in my opinion much easier to understand; previous
version worked correctly due to the fact that we returned from loop
on first found match.

Signed-off-by: Jakub Narebski <redacted>
Acked-by: Giuseppe Bilotta <redacted>
Signed-off-by: Junio C Hamano <redacted>
gitweb.perl
This page took 0.20998 seconds and 4 git commands to generate.