aboutsummaryrefslogtreecommitdiffstats
path: root/gitweb
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-01-29 13:18:50 -0800
committerJunio C Hamano <gitster@pobox.com>2012-01-29 13:18:50 -0800
commit77cdf0f802f23d409a773bd5f8a736f50ae8baf5 (patch)
tree71a4541fee9ab258d4cdc22b69a0d20a7e2b3d6e /gitweb
parent7b718fbf17f5b51887d420e6edc9dcb7b0c0f83c (diff)
parent18ab83e8568878edc3f6680ebdf439ccaa5bf5db (diff)
downloadgit-77cdf0f802f23d409a773bd5f8a736f50ae8baf5.tar.gz
Merge branch 'jn/gitweb-unspecified-action'
* jn/gitweb-unspecified-action: gitweb: Fix actionless dispatch for non-existent objects
Diffstat (limited to 'gitweb')
-rwxr-xr-xgitweb/gitweb.perl4
1 files changed, 3 insertions, 1 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index abb5a79afc..9cf7e714a9 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -1123,8 +1123,10 @@ sub dispatch {
if (!defined $action) {
if (defined $hash) {
$action = git_get_type($hash);
+ $action or die_error(404, "Object does not exist");
} elsif (defined $hash_base && defined $file_name) {
$action = git_get_type("$hash_base:$file_name");
+ $action or die_error(404, "File or directory does not exist");
} elsif (defined $project) {
$action = 'summary';
} else {
@@ -2391,7 +2393,7 @@ sub get_feed_info {
return unless (defined $project);
# some views should link to OPML, or to generic project feed,
# or don't have specific feed yet (so they should use generic)
- return if ($action =~ /^(?:tags|heads|forks|tag|search)$/x);
+ return if (!$action || $action =~ /^(?:tags|heads|forks|tag|search)$/x);
my $branch;
# branches refs uses 'refs/heads/' prefix (fullname) to differentiate