@matheusbsbs / matheus-bagliano / commits / 0e65699992
Fork 0

gitweb: refactor repository URL printing

Factor out the code to display the repository URL(s) from summary view into a format_rep_url() routine. Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Acked-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Giuseppe Bilotta committed Nov 11, 2010 at 13:26 UTC 0e65699992ddaf68d9d1c30ad8cd1e418cf1bc52
1 file changed +6 -1
gitweb/gitweb.perl
+6 -1
@@ -3797,6 +3797,11 @@ sub git_print_header_div {
3797 "\n</div>\n";
3798 }
3799
3800 +sub format_repo_url {
3801 + my ($name, $url) = @_;
3802 + return "<tr class=\"metadata_url\"><td>$name</td><td>$url</td></tr>\n";
3803 +}
3804 +
3805 sub print_local_time {
3806 print format_local_time(@_);
3807 }
@@ -5180,7 +5185,7 @@ sub git_summary {
5185 @url_list = map { "$_/$project" } @git_base_url_list unless @url_list;
5186 foreach my $git_url (@url_list) {
5187 next unless $git_url;
5183 - print "<tr class=\"metadata_url\"><td>$url_tag</td><td>$git_url</td></tr>\n";
5188 + print format_repo_url($url_tag, $git_url);
5189 $url_tag = "";
5190 }
5191