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 @@ -1122,8 +1122,10 @@ sub dispatch {
11221122 if (!defined $action ) {
11231123 if (defined $hash ) {
11241124 $action = git_get_type($hash );
1125+ $action or die_error(404, " Object does not exist" );
11251126 } elsif (defined $hash_base && defined $file_name ) {
11261127 $action = git_get_type(" $hash_base :$file_name " );
1128+ $action or die_error(404, " File or directory does not exist" );
11271129 } elsif (defined $project ) {
11281130 $action = ' summary' ;
11291131 } else {
@@ -2364,7 +2366,7 @@ sub get_feed_info {
23642366 return unless (defined $project );
23652367 # some views should link to OPML, or to generic project feed,
23662368 # or don't have specific feed yet (so they should use generic)
2367- return if ($action =~ / ^(?:tags|heads|forks|tag|search)$ /x );
2369+ return if (! $action || $action =~ / ^(?:tags|heads|forks|tag|search)$ /x );
23682370
23692371 my $branch ;
23702372 # branches refs uses 'refs/heads/' prefix (fullname) to differentiate
Original file line number Diff line number Diff line change @@ -403,6 +403,14 @@ test_expect_success \
403403 ' path_info: project/branch:dir/' \
404404 ' gitweb_run "" "/.git/master:foo/"'
405405
406+ test_expect_success \
407+ ' path_info: project/branch (non-existent)' \
408+ ' gitweb_run "" "/.git/non-existent"'
409+
410+ test_expect_success \
411+ ' path_info: project/branch:filename (non-existent branch)' \
412+ ' gitweb_run "" "/.git/non-existent:non-existent"'
413+
406414test_expect_success \
407415 ' path_info: project/branch:file (non-existent)' \
408416 ' gitweb_run "" "/.git/master:non-existent"'
You can’t perform that action at this time.
0 commit comments