From: Giuseppe Bilotta Date: Thu, 11 Nov 2010 12:26:15 +0000 (+0100) Subject: gitweb: refactor repository URL printing X-Git-Url: https://git.ladys.computer/Gitweb/commitdiff_plain/49732e00c641b8dfa02202c4ed2c3716909650cdc9ddc01494f4e1e758c2db0e?ds=sidebyside 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 Acked-by: Jakub Narebski Signed-off-by: Junio C Hamano --- diff --git a/gitweb.perl b/gitweb.perl index 589cd08..85110d6 100755 --- a/gitweb.perl +++ b/gitweb.perl @@ -3796,6 +3796,11 @@ sub git_print_header_div { "\n\n"; } +sub format_repo_url { + my ($name, $url) = @_; + return "$name$url\n"; +} + sub print_local_time { print format_local_time(@_); } @@ -5179,7 +5184,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 "$url_tag$git_url\n"; + print format_repo_url($url_tag, $git_url); $url_tag = ""; }