Skip to content

Commit

Permalink
gitweb: refactor repository URL printing
Browse files Browse the repository at this point in the history
Factor out the code to display the repository URL(s) from summary view
into a format_rep_url() routine.

Signed-off-by: Giuseppe Bilotta <[email protected]>
Acked-by: Jakub Narebski <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
Oblomov authored and gitster committed Nov 17, 2010
1 parent bb60776 commit 0e65699
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion gitweb/gitweb.perl
Original file line number Diff line number Diff line change
Expand Up @@ -3797,6 +3797,11 @@ sub git_print_header_div {
"\n</div>\n";
}

sub format_repo_url {
my ($name, $url) = @_;
return "<tr class=\"metadata_url\"><td>$name</td><td>$url</td></tr>\n";
}

sub print_local_time {
print format_local_time(@_);
}
Expand Down Expand Up @@ -5180,7 +5185,7 @@ sub git_summary {
@url_list = map { "$_/$project" } @git_base_url_list unless @url_list;
foreach my $git_url (@url_list) {
next unless $git_url;
print "<tr class=\"metadata_url\"><td>$url_tag</td><td>$git_url</td></tr>\n";
print format_repo_url($url_tag, $git_url);
$url_tag = "";
}

Expand Down

0 comments on commit 0e65699

Please sign in to comment.