@@ -57,7 +57,7 @@ def write_index(target_root, base_details, patch_details, projects)
5757 end
5858
5959 env = {
60- 'comparison_url' => nil , # todo
60+ 'comparison_url' => create_comparison_url ( base_details , patch_details ) ,
6161 'base' => to_liquid ( base_details , BASE_CONFIG_NAME ) ,
6262 'patch' => to_liquid ( patch_details , PATCH_CONFIG_NAME ) ,
6363 'projects' => projects
@@ -66,9 +66,15 @@ def write_index(target_root, base_details, patch_details, projects)
6666 render_and_write ( 'project_index.html' , "#{ target_root } /index.html" , env )
6767 end
6868
69+ def create_comparison_url ( base_details , patch_details )
70+ base = CGI . escape ( base_details . branch_name )
71+ patch = CGI . escape ( patch_details . branch_last_sha )
72+ "https://github.com/pmd/pmd/compare/#{ base } ...#{ patch } "
73+ end
74+
6975 def to_liquid ( details , config_name )
7076 {
71- 'tree_url' => "https://github.com/pmd/pmd/tree/#{ details . branch_last_sha } " ,
77+ 'tree_url' => "https://github.com/pmd/pmd/tree/#{ CGI . escape ( details . branch_last_sha ) } " ,
7278 'name' => details . branch_name ,
7379 'tip' => {
7480 'sha' => details . branch_last_sha ,
0 commit comments