change hardcoded master branch in readme enumeration to HEAD
authorAndrew Lorimer <andrew@lorimer.id.au>
Mon, 24 Nov 2025 10:23:37 +0000 (21:23 +1100)
committerAndrew Lorimer <andrew@lorimer.id.au>
Mon, 24 Nov 2025 10:23:37 +0000 (21:23 +1100)
gitweb/gitweb.perl
index e60bc31ad84c11e53ba5cc621962a0501dc9b740..c8ea2dd33c5a8d64e88e831e3b7416a6d598c019 100755 (executable)
@@ -19,8 +19,8 @@
 use Text::Markdown qw(markdown);
 use CGI qw(:standard :escapeHTML -nosticky);
 use CGI::Util qw(unescape);
-#use CGI::Carp qw(fatalsToBrowser set_message);  # debugging only
-use CGI::Carp qw(set_message);                 # production
+use CGI::Carp qw(fatalsToBrowser warningsToBrowser set_message);  # debugging only
+#use CGI::Carp qw(set_message);                 # production
 use Encode;
 use Fcntl ':mode';
 use File::Find qw();
@@ -6897,7 +6897,7 @@ sub git_summary {
        # If XSS prevention is on, we don't include README.html.
        # TODO: Allow a readme in some safe format.
        if (!$prevent_xss) {
-          open my $fd, "-|", git_cmd(), "ls-tree", "master", "--name-only"
+          open my $fd, "-|", git_cmd(), "ls-tree", "HEAD", "--name-only"
             or die_error(500, "Error checking ls_tree for readme");
           my @readme_files = map { chomp; $_ } <$fd>;
           close $fd