diff options
author | Giuseppe Bilotta <giuseppe.bilotta@gmail.com> | 2010-11-11 13:26:15 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-11-17 13:02:19 -0800 |
commit | 0e65699992ddaf68d9d1c30ad8cd1e418cf1bc52 (patch) | |
tree | 128e9cf81b664772e66d2456c95edc9e1d880215 /gitweb | |
parent | bb60776063f0575c1a880cd606b7470e36a7cd86 (diff) | |
download | git-0e65699992ddaf68d9d1c30ad8cd1e418cf1bc52.tar.gz |
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>
Diffstat (limited to 'gitweb')
-rwxr-xr-x | gitweb/gitweb.perl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index bf387572bf..6e7a66368d 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -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(@_); } @@ -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 = ""; } |