File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed
Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -1123,8 +1123,10 @@ sub dispatch {
11231123 if (!defined $action ) {
11241124 if (defined $hash ) {
11251125 $action = git_get_type($hash );
1126+ $action or die_error(404, " Object does not exist" );
11261127 } elsif (defined $hash_base && defined $file_name ) {
11271128 $action = git_get_type(" $hash_base :$file_name " );
1129+ $action or die_error(404, " File or directory does not exist" );
11281130 } elsif (defined $project ) {
11291131 $action = ' summary' ;
11301132 } else {
@@ -2391,7 +2393,7 @@ sub get_feed_info {
23912393 return unless (defined $project );
23922394 # some views should link to OPML, or to generic project feed,
23932395 # or don't have specific feed yet (so they should use generic)
2394- return if ($action =~ / ^(?:tags|heads|forks|tag|search)$ /x );
2396+ return if (! $action || $action =~ / ^(?:tags|heads|forks|tag|search)$ /x );
23952397
23962398 my $branch ;
23972399 # branches refs uses 'refs/heads/' prefix (fullname) to differentiate
Original file line number Diff line number Diff line change @@ -474,6 +474,14 @@ test_expect_success \
474474 ' path_info: project/branch:dir/' \
475475 ' gitweb_run "" "/.git/master:foo/"'
476476
477+ test_expect_success \
478+ ' path_info: project/branch (non-existent)' \
479+ ' gitweb_run "" "/.git/non-existent"'
480+
481+ test_expect_success \
482+ ' path_info: project/branch:filename (non-existent branch)' \
483+ ' gitweb_run "" "/.git/non-existent:non-existent"'
484+
477485test_expect_success \
478486 ' path_info: project/branch:file (non-existent)' \
479487 ' gitweb_run "" "/.git/master:non-existent"'
You can’t perform that action at this time.
0 commit comments