Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Rada <marada@uwaterloo.ca>2009-08-25 08:59:48 +0400
committerJunio C Hamano <gitster@pobox.com>2009-08-26 03:33:06 +0400
commit34b31a8d5f48283ec3039777b24706585b4f9d41 (patch)
tree43bad3d433286b6f7b157cd1a3532db30144d177 /gitweb/gitweb.perl
parentcbdefb5ac43a1a34e71121a7a6a6434f0b8aa1cf (diff)
gitweb: improve snapshot error handling
The last check in the second block of checks in the &git_snapshot routine is never executed because the second to last check is a superset of the last check. Switch the order of the last two checks. It has the advantage of giving clients a more specific reason why they cannot get a snapshot format if the format they have chosen is disabled. Signed-off-by: Mark Rada <marada@uwaterloo.ca> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'gitweb/gitweb.perl')
-rwxr-xr-xgitweb/gitweb.perl4
1 files changed, 2 insertions, 2 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index 84659f5672..b453ed0452 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -5175,10 +5175,10 @@ sub git_snapshot {
die_error(400, "Invalid snapshot format parameter");
} elsif (!exists($known_snapshot_formats{$format})) {
die_error(400, "Unknown snapshot format");
- } elsif (!grep($_ eq $format, @snapshot_fmts)) {
- die_error(403, "Unsupported snapshot format");
} elsif ($known_snapshot_formats{$format}{'disabled'}) {
die_error(403, "Snapshot format not allowed");
+ } elsif (!grep($_ eq $format, @snapshot_fmts)) {
+ die_error(403, "Unsupported snapshot format");
}
if (!defined $hash) {