diff options
author | Eric Wong <e@80x24.org> | 2016-03-14 21:23:28 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-04-05 18:58:27 +0000 |
commit | 7d88f5491d5c0d68842fbc4b5e4ca4afc93903ef (patch) | |
tree | d789ec7e9d4d44d1e2c7337e5918cd327982bdf5 /lib/PublicInbox/RepobrowseGitSummary.pm | |
parent | f8c5a8adc893960030ce2e8aad14872fb0aacb91 (diff) | |
download | public-inbox-7d88f5491d5c0d68842fbc4b5e4ca4afc93903ef.tar.gz |
git.git uses README.md, nowadays, but older revisions used plain old README. Handle both out-of-the box.
Diffstat (limited to 'lib/PublicInbox/RepobrowseGitSummary.pm')
-rw-r--r-- | lib/PublicInbox/RepobrowseGitSummary.pm | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/PublicInbox/RepobrowseGitSummary.pm b/lib/PublicInbox/RepobrowseGitSummary.pm index 0dffd5cc..3ddfbe74 100644 --- a/lib/PublicInbox/RepobrowseGitSummary.pm +++ b/lib/PublicInbox/RepobrowseGitSummary.pm @@ -70,13 +70,13 @@ sub emit_summary { # some people will use README.md or even README.sh here... my $readme = $repo_info->{readme}; - defined $readme or $readme = 'README'; - my $doc = $git->cat_file('HEAD:'.$readme); - if (defined $doc) { - $fh->write('<pre>' . - readme_path_links($rel, $readme) . " (HEAD)\n\n"); - $fh->write(utf8_html($$doc)); - $fh->write('</pre>'); + defined $readme or $readme = [ 'README', 'README.md' ]; + $readme = [ $readme ] if (ref($readme) ne 'ARRAY'); + foreach my $r (@$readme) { + my $doc = $git->cat_file('HEAD:'.$r); + defined $doc or next; + $fh->write('<pre>' . readme_path_links($rel, $r) . + " (HEAD)\n\n" . utf8_html($$doc) . '</pre>'); } $fh->write('</body></html>'); $fh->close; |