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 {
1122
1122
if (!defined $action ) {
1123
1123
if (defined $hash ) {
1124
1124
$action = git_get_type($hash );
1125
+ $action or die_error(404, " Object does not exist" );
1125
1126
} elsif (defined $hash_base && defined $file_name ) {
1126
1127
$action = git_get_type(" $hash_base :$file_name " );
1128
+ $action or die_error(404, " File or directory does not exist" );
1127
1129
} elsif (defined $project ) {
1128
1130
$action = ' summary' ;
1129
1131
} else {
@@ -2364,7 +2366,7 @@ sub get_feed_info {
2364
2366
return unless (defined $project );
2365
2367
# some views should link to OPML, or to generic project feed,
2366
2368
# 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 );
2368
2370
2369
2371
my $branch ;
2370
2372
# 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 \
403
403
' path_info: project/branch:dir/' \
404
404
' gitweb_run "" "/.git/master:foo/"'
405
405
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
+
406
414
test_expect_success \
407
415
' path_info: project/branch:file (non-existent)' \
408
416
' gitweb_run "" "/.git/master:non-existent"'
You can’t perform that action at this time.
0 commit comments