From 1c2a4f5addce479c619057c6cdc841802139982f Mon Sep 17 00:00:00 2001 From: Martin Waitz Date: Wed, 16 Aug 2006 00:24:30 +0200 Subject: [PATCH] gitweb: consolidate action URL generation. Use the href() function instead of string concatenation to generate most URLs to our own CGI. This is a work in progress, not everything has been converted yet. Signed-off-by: Martin Waitz Signed-off-by: Junio C Hamano --- gitweb/gitweb.perl | 171 ++++++++++++++++++++++----------------------- 1 file changed, 84 insertions(+), 87 deletions(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index 1471d4dad..37a6284fc 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -388,7 +388,7 @@ sub format_log_line_html { if ($line =~ m/([0-9a-fA-F]{40})/) { my $hash_text = $1; if (git_get_type($hash_text) eq "commit") { - my $link = $cgi->a({-class => "text", -href => "$my_uri?" . esc_param("p=$project;a=commit;h=$hash_text")}, $hash_text); + my $link = $cgi->a({-class => "text", -href => href(action=>"commit", hash=>$hash_text)}, $hash_text); $line =~ s/$hash_text/$link/; } } @@ -425,16 +425,15 @@ sub format_ref_marker { # format, perhaps shortened and with markers, title line sub format_subject_html { - my ($long, $short, $query, $extra) = @_; + my ($long, $short, $href, $extra) = @_; $extra = '' unless defined($extra); if (length($short) < length($long)) { - return $cgi->a({-href => "$my_uri?" . esc_param($query), - -class => "list", -title => $long}, + return $cgi->a({-href => $href, -class => "list", + -title => $long}, esc_html($short) . $extra); } else { - return $cgi->a({-href => "$my_uri?" . esc_param($query), - -class => "list"}, + return $cgi->a({-href => $href, -class => "list"}, esc_html($long) . $extra); } } @@ -998,8 +997,7 @@ EOF if (defined $project) { printf(''."\n", - esc_param($project), - esc_param("$my_uri?p=$project;a=rss")); + esc_param($project), href(action=>"rss")); } print "\n" . @@ -1010,7 +1008,7 @@ EOF "\n"; print $cgi->a({-href => esc_param($home_link)}, $home_link_str) . " / "; if (defined $project) { - print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=summary")}, esc_html($project)); + print $cgi->a({-href => href(action=>"summary")}, esc_html($project)); if (defined $action) { print " / $action"; } @@ -1047,7 +1045,7 @@ sub git_footer_html { if (defined $descr) { print "\n"; } - print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=rss"), -class => "rss_logo"}, "RSS") . "\n"; + print $cgi->a({-href => href(action=>"rss"), -class => "rss_logo"}, "RSS") . "\n"; } else { print $cgi->a({-href => "$my_uri?" . esc_param("a=opml"), -class => "rss_logo"}, "OPML") . "\n"; } @@ -1082,27 +1080,25 @@ sub git_print_page_nav { @navs = grep { $_ ne $suppress } @navs; } - my %arg = map { $_, ''} @navs; + my %arg = map { $_ => {action=>$_} } @navs; if (defined $head) { for (qw(commit commitdiff)) { - $arg{$_} = ";h=$head"; + $arg{$_}{hash} = $head; } if ($current =~ m/^(tree | log | shortlog | commit | commitdiff | search)$/x) { for (qw(shortlog log)) { - $arg{$_} = ";h=$head"; + $arg{$_}{hash} = $head; } } } - $arg{tree} .= ";h=$treehead" if defined $treehead; - $arg{tree} .= ";hb=$treebase" if defined $treebase; + $arg{tree}{hash} = $treehead if defined $treehead; + $arg{tree}{hash_base} = $treebase if defined $treebase; print "
\n" . (join " | ", - map { $_ eq $current - ? $_ - : $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=$_$arg{$_}")}, "$_") - } - @navs); + map { $_ eq $current ? + $_ : $cgi->a({-href => href(%{$arg{$_}})}, "$_") + } @navs); print "
\n$extra
\n" . "
\n"; } @@ -1113,14 +1109,14 @@ sub format_paging_nav { if ($hash ne $head || $page) { - $paging_nav .= $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=$action")}, "HEAD"); + $paging_nav .= $cgi->a({-href => href(action=>$action)}, "HEAD"); } else { $paging_nav .= "HEAD"; } if ($page > 0) { $paging_nav .= " ⋅ " . - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=$action;h=$hash;pg=" . ($page-1)), + $cgi->a({-href => href(action=>$action, hash=>$hash, page=>$page-1), -accesskey => "p", -title => "Alt-p"}, "prev"); } else { $paging_nav .= " ⋅ prev"; @@ -1128,7 +1124,7 @@ sub format_paging_nav { if ($nrevs >= (100 * ($page+1)-1)) { $paging_nav .= " ⋅ " . - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=$action;h=$hash;pg=" . ($page+1)), + $cgi->a({-href => href(action=>$action, hash=>$hash, page=>$page+1), -accesskey => "n", -title => "Alt-n"}, "next"); } else { $paging_nav .= " ⋅ next"; @@ -1142,15 +1138,16 @@ sub format_paging_nav { sub git_print_header_div { my ($action, $title, $hash, $hash_base) = @_; - my $rest = ''; + my %args = (); - $rest .= ";h=$hash" if $hash; - $rest .= ";hb=$hash_base" if $hash_base; + $args{action} = $action; + $args{hash} = $hash if $hash; + $args{hash_base} = $hash_base if $hash_base; print "
\n" . - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=$action$rest"), - -class => "title"}, $title ? $title : $action) . "\n" . - "
\n"; + $cgi->a({-href => href(%args), -class => "title"}, + $title ? $title : $action) . + "\n\n"; } sub git_print_page_path { @@ -1161,7 +1158,7 @@ sub git_print_page_path { print "
/
\n"; } elsif (defined $type && $type eq 'blob') { print "
" . - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob_plain;f=$file_name")}, esc_html($name)) . "
\n"; + $cgi->a({-href => href(action=>"blob_plain", file_name=>$file_name)}, esc_html($name)) . "
\n"; } else { print "
" . esc_html($name) . "
\n"; } @@ -1208,22 +1205,22 @@ sub git_difftree_body { $mode_chng = sprintf(" with mode: %04o", (oct $to_mode) & 0777); } print "" . - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$to_id;hb=$hash;f=$file"), + $cgi->a({-href => href(action=>"blob", hash=>$to_id, hash_base=>$hash, file_name=>$file), -class => "list"}, esc_html($file)) . "\n" . "[new " . file_type($to_mode) . "$mode_chng]\n" . "" . - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$to_id;hb=$hash;f=$file")}, "blob") . + $cgi->a({-href => href(action=>"blob", hash=>$to_id, hash_base=>$hash, file_name=>$file)}, "blob") . "\n"; } elsif ($status eq "D") { # deleted print "" . - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$from_id;hb=$parent;f=$file"), + $cgi->a({-href => href(action=>"blob", hash=>$from_id, hash_base=>$parent, file_name=>$file), -class => "list"}, esc_html($file)) . "\n" . "[deleted " . file_type($from_mode). "]\n" . "" . - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$from_id;hb=$parent;f=$file")}, "blob") . " | " . - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=history;hb=$parent;f=$file")}, "history") . + $cgi->a({-href => href(action=>"blob", hash=>$from_id, hash_base=>$parent, file_name=>$file)}, "blob") . " | " . + $cgi->a({-href => href(action=>"history", hash_base=>$parent, file_name=>$file)}, "history") . "\n" } elsif ($status eq "M" || $status eq "T") { # modified, or type changed @@ -1244,20 +1241,20 @@ sub git_difftree_body { } print ""; if ($to_id ne $from_id) { # modified - print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blobdiff;h=$to_id;hp=$from_id;hb=$hash;f=$file"), + print $cgi->a({-href => href(action=>"blobdiff", hash=>$to_id, hash_parent=>$from_id, hash_base=>$hash, file_name=>$file), -class => "list"}, esc_html($file)); } else { # mode changed - print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$to_id;hb=$hash;f=$file"), + print $cgi->a({-href => href(action=>"blob", hash=>$to_id, hash_base=>$hash, file_name=>$file), -class => "list"}, esc_html($file)); } print "\n" . "$mode_chnge\n" . "" . - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$to_id;hb=$hash;f=$file")}, "blob"); + $cgi->a({-href => href(action=>"blob", hash=>$to_id, hash_base=>$hash, file_name=>$file)}, "blob"); if ($to_id ne $from_id) { # modified - print " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blobdiff;h=$to_id;hp=$from_id;hb=$hash;f=$file")}, "diff"); + print $cgi->a({-href => href(action=>"blobdiff", hash=>$to_id, hash_parent=>$from_id, hash_base=>$hash, file_name=>$file)}, "diff"); } - print " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=history;hb=$hash;f=$file")}, "history") . "\n"; + print " | " . $cgi->a({-href => href(action=>"history", hash_base=>$hash, file_name=>$file)}, "history") . "\n"; print "\n"; } elsif ($status eq "R") { # renamed @@ -1267,14 +1264,14 @@ sub git_difftree_body { $mode_chng = sprintf(", mode: %04o", (oct $to_mode) & 0777); } print "" . - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$to_id;hb=$hash;f=$to_file"), + $cgi->a({-href => href(action=>"blob", hash=>$to_id, hash_base=>$hash, file_name=>$to_file), -class => "list"}, esc_html($to_file)) . "\n" . "[moved from " . - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$from_id;hb=$parent;f=$from_file"), + $cgi->a({-href => href(action=>"blob", hash=>$from_id, hash_base=>$parent, file_name=>$from_file), -class => "list"}, esc_html($from_file)) . " with " . (int $similarity) . "% similarity$mode_chng]\n" . "" . - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$to_id;hb=$hash;f=$to_file")}, "blob"); + $cgi->a({-href => href(action=>"blob", hash=>$to_id, hash_base=>$hash, file_name=>$to_file)}, "blob"); if ($to_id ne $from_id) { print " | " . $cgi->a({-href => "$my_uri?" . @@ -1289,14 +1286,14 @@ sub git_difftree_body { $mode_chng = sprintf(", mode: %04o", (oct $to_mode) & 0777); } print "" . - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$to_id;hb=$hash;f=$to_file"), + $cgi->a({-href => href(action=>"blob", hash=>$to_id, hash_base=>$hash, file_name=>$to_file), -class => "list"}, esc_html($to_file)) . "\n" . "[copied from " . - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$from_id;hb=$parent;f=$from_file"), + $cgi->a({-href => href(action=>"blob", hash=>$from_id, hash_base=>$parent, file_name=>$from_file), -class => "list"}, esc_html($from_file)) . " with " . (int $similarity) . "% similarity$mode_chng]\n" . "" . - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$to_id;hb=$hash;f=$to_file")}, "blob"); + $cgi->a({-href => href(action=>"blob", hash=>$to_id, hash_base=>$hash, file_name=>$to_file)}, "blob"); if ($to_id ne $from_id) { print " | " . $cgi->a({-href => "$my_uri?" . @@ -1332,11 +1329,11 @@ sub git_shortlog_body { print "$co{'age_string_date'}\n" . "" . esc_html(chop_str($co{'author_name'}, 10)) . "\n" . ""; - print format_subject_html($co{'title'}, $co{'title_short'}, "p=$project;a=commit;h=$commit", $ref); + print format_subject_html($co{'title'}, $co{'title_short'}, href(action=>"commit", hash=>$commit), $ref); print "\n" . "" . - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$commit")}, "commit") . " | " . - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commitdiff;h=$commit")}, "commitdiff") . + $cgi->a({-href => href(action=>"commit", hash=>$commit)}, "commit") . " | " . + $cgi->a({-href => href(action=>"commitdiff", hash=>$commit)}, "commitdiff") . "\n" . "\n"; } @@ -1378,12 +1375,12 @@ sub git_history_body { "" . esc_html(chop_str($co{'author_name'}, 15, 3)) . "\n" . ""; # originally git_history used chop_str($co{'title'}, 50) - print format_subject_html($co{'title'}, $co{'title_short'}, "p=$project;a=commit;h=$commit", $ref); + print format_subject_html($co{'title'}, $co{'title_short'}, href(action=>"commit", hash=>$commit), $ref); print "\n" . "" . - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$commit")}, "commit") . " | " . - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commitdiff;h=$commit")}, "commitdiff") . " | " . - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=$ftype;hb=$commit;f=$file_name")}, $ftype); + $cgi->a({-href => href(action=>"commit", hash=>$commit)}, "commit") . " | " . + $cgi->a({-href => href(action=>"commitdiff", hash=>$commit)}, "commitdiff") . " | " . + $cgi->a({-href => href(action=>$ftype, hash_base=>$commit, file_name=>$file_name)}, $ftype); if ($ftype eq 'blob') { my $blob_current = git_get_hash_by_path($hash_base, $file_name); @@ -1391,7 +1388,7 @@ sub git_history_body { if (defined $blob_current && defined $blob_parent && $blob_current ne $blob_parent) { print " | " . - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blobdiff;h=$blob_current;hp=$blob_parent;hb=$commit;f=$file_name")}, + $cgi->a({-href => href(action=>"blobdiff", hash=>$blob_current, hash_parent=>$blob_parent, hash_base=>$commit, file_name=>$file_name)}, "diff to current"); } } @@ -1431,28 +1428,28 @@ sub git_tags_body { $alternate ^= 1; print "$tag{'age'}\n" . "" . - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=$tag{'reftype'};h=$tag{'refid'}"), + $cgi->a({-href => href(action=>$tag{'reftype'}, hash=>$tag{'refid'}), -class => "list"}, "" . esc_html($tag{'name'}) . "") . "\n" . ""; if (defined $comment) { - print format_subject_html($comment, $comment_short, "p=$project;a=tag;h=$tag{'id'}"); + print format_subject_html($comment, $comment_short, href(action=>"tag", hash=>$tag{'id'})); } print "\n" . ""; if ($tag{'type'} eq "tag") { - print $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=tag;h=$tag{'id'}")}, "tag"); + print $cgi->a({-href => href(action=>"tag", hash=>$tag{'id'})}, "tag"); } else { print " "; } print "\n" . "" . " | " . - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=$tag{'reftype'};h=$tag{'refid'}")}, $tag{'reftype'}); + $cgi->a({-href => href(action=>$tag{'reftype'}, hash=>$tag{'refid'})}, $tag{'reftype'}); if ($tag{'reftype'} eq "commit") { - print " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=shortlog;h=$tag{'name'}")}, "shortlog") . - " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=log;h=$tag{'refid'}")}, "log"); + print " | " . $cgi->a({-href => href(action=>"shortlog", hash=>$tag{'name'})}, "shortlog") . + " | " . $cgi->a({-href => href(action=>"log", hash=>$tag{'refid'})}, "log"); } elsif ($tag{'reftype'} eq "blob") { - print " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob_plain;h=$tag{'refid'}")}, "raw"); + print " | " . $cgi->a({-href => href(action=>"blob_plain", hash=>$tag{'refid'})}, "raw"); } print "\n" . ""; @@ -1485,12 +1482,12 @@ sub git_heads_body { $alternate ^= 1; print "$tag{'age'}\n" . ($tag{'id'} eq $head ? "" : "") . - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=shortlog;h=$tag{'name'}"), + $cgi->a({-href => href(action=>"shortlog", hash=>$tag{'name'}), -class => "list"}, "" . esc_html($tag{'name'}) . "") . "\n" . "" . - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=shortlog;h=$tag{'name'}")}, "shortlog") . " | " . - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=log;h=$tag{'name'}")}, "log") . + $cgi->a({-href => href(action=>"shortlog", hash=>$tag{'name'})}, "shortlog") . " | " . + $cgi->a({-href => href(action=>"log", hash=>$tag{'name'})}, "log") . "\n" . ""; } @@ -1714,20 +1711,20 @@ sub git_summary { close $fd; git_print_header_div('shortlog'); git_shortlog_body(\@revlist, 0, 15, $refs, - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=shortlog")}, "...")); + $cgi->a({-href => href(action=>"shortlog")}, "...")); my $taglist = git_get_refs_list("refs/tags"); if (defined @$taglist) { git_print_header_div('tags'); git_tags_body($taglist, 0, 15, - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=tags")}, "...")); + $cgi->a({-href => href(action=>"tags")}, "...")); } my $headlist = git_get_refs_list("refs/heads"); if (defined @$headlist) { git_print_header_div('heads'); git_heads_body($headlist, $head, 0, 15, - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=heads")}, "...")); + $cgi->a({-href => href(action=>"heads")}, "...")); } git_footer_html(); @@ -1743,8 +1740,8 @@ sub git_tag { "\n" . "\n" . "\n" . - "\n" . - "\n" . + "\n" . + "\n" . "\n"; if (defined($tag{'author'})) { my %ad = parse_date($tag{'epoch'}, $tag{'tz'}); @@ -1783,8 +1780,8 @@ sub git_blame2 { or die_error(undef, "Open git-blame failed"); git_header_html(); my $formats_nav = - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$hash;hb=$hash_base;f=$file_name")}, "blob") . - " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blame;f=$file_name")}, "head"); + $cgi->a({-href => href(action=>"blobl", hash=>$hash, hash_base=>$hash_base, file_name=>$file_name)}, "blob") . + " | " . $cgi->a({-href => href(action=>"blame", file_name=>$file_name)}, "head"); git_print_page_nav('','', $hash_base,$co{'tree'},$hash_base, $formats_nav); git_print_header_div('commit', esc_html($co{'title'}), $hash_base); git_print_page_path($file_name, $ftype); @@ -1810,7 +1807,7 @@ sub git_blame2 { } print "\n"; print "\n"; + $cgi->a({-href => href(action=>"commit", hash=>$full_rev, file_name=>$file_name)}, esc_html($rev)) . "\n"; print "\n"; print "\n"; print "\n"; @@ -1837,8 +1834,8 @@ sub git_blame { or die_error(undef, "Open git-annotate failed"); git_header_html(); my $formats_nav = - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;h=$hash;hb=$hash_base;f=$file_name")}, "blob") . - " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blame;f=$file_name")}, "head"); + $cgi->a({-href => href(action=>"blobl", hash=>$hash, hash_base=>$hash_base, file_name=>$file_name)}, "blob") . + " | " . $cgi->a({-href => href(action=>"blame", file_name=>$file_name)}, "head"); git_print_page_nav('','', $hash_base,$co{'tree'},$hash_base, $formats_nav); git_print_header_div('commit', esc_html($co{'title'}), $hash_base); git_print_page_path($file_name, 'blob'); @@ -1893,7 +1890,7 @@ HTML print < - + @@ -1989,13 +1986,13 @@ sub git_blob { if (defined $hash_base && (my %co = parse_commit($hash_base))) { if (defined $file_name) { if ($have_blame) { - $formats_nav .= $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blame;h=$hash;hb=$hash_base;f=$file_name")}, "blame") . " | "; + $formats_nav .= $cgi->a({-href => href(action=>"blame", hash=>$hash, hash_base=>$hash_base, file_name=>$file_name)}, "blame") . " | "; } $formats_nav .= - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob_plain;h=$hash;f=$file_name")}, "plain") . - " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob;hb=HEAD;f=$file_name")}, "head"); + $cgi->a({-href => href(action=>"blob_plain", hash=>$hash, file_name=>$file_name)}, "plain") . + " | " . $cgi->a({-href => href(action=>"blob", hash_base=>"HEAD", file_name=>$file_name)}, "head"); } else { - $formats_nav .= $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blob_plain;h=$hash")}, "plain"); + $formats_nav .= $cgi->a({-href => href(action=>"blob_plain", hash=>$hash)}, "plain"); } git_print_page_nav('','', $hash_base,$co{'tree'},$hash_base, $formats_nav); git_print_header_div('commit', esc_html($co{'title'}), $hash_base); @@ -2139,8 +2136,8 @@ sub git_log { $commit); print "
\n" . "
\n" . - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$commit")}, "commit") . - " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commitdiff;h=$commit")}, "commitdiff") . + $cgi->a({-href => href(action=>"commit", hash=>$commit)}, "commit") . + " | " . $cgi->a({-href => href(action=>"commitdiff", hash=>$commit)}, "commitdiff") . "
\n" . "
\n" . "" . esc_html($co{'author_name'}) . " [$ad{'rfc2822'}]
\n" . @@ -2197,7 +2194,7 @@ sub git_commit { my $formats_nav = ''; if (defined $file_name && defined $co{'parent'}) { my $parent = $co{'parent'}; - $formats_nav .= $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=blame;hb=$parent;f=$file_name")}, "blame"); + $formats_nav .= $cgi->a({-href => href(action=>"blame", hash_parent=>$parent, file_name=>$file_name)}, "blame"); } git_header_html(undef, $expires); git_print_page_nav('commit', defined $co{'parent'} ? '' : 'commitdiff', @@ -2227,19 +2224,19 @@ sub git_commit { print "
" . "" . "" . - "" . "\n"; my $parents = $co{'parents'}; foreach my $par (@$parents) { print "" . "" . - "" . + "" . "" . "\n"; } -- 2.26.2
object" . $cgi->a({-class => "list", -href => "$my_uri?" . esc_param("p=$project;a=$tag{'type'};h=$tag{'object'}")}, $tag{'object'}) . "" . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=$tag{'type'};h=$tag{'object'}")}, $tag{'type'}) . "" . $cgi->a({-class => "list", -href => href(action=>$tag{'type'}, hash=>$tag{'object'})}, $tag{'object'}) . "" . $cgi->a({-href => href(action=>$tag{'type'}, hash=>$tag{'object'})}, $tag{'type'}) . "
" . - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$full_rev;f=$file_name")}, esc_html($rev)) . "" . esc_html($lineno) . "" . esc_html($data) . "
$short_rev..$long_rev)}" class="text">$short_rev.. $age_str $author $lineno
tree" . - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=tree;h=$co{'tree'};hb=$hash"), class => "list"}, $co{'tree'}) . + $cgi->a({-href => href(action=>"tree", hash=>$co{'tree'}, hash_base=>$hash), class => "list"}, $co{'tree'}) . "" . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=tree;h=$co{'tree'};hb=$hash")}, "tree") . + "" . $cgi->a({-href => href(action=>"tree", hash=>$co{'tree'}, hash_base=>$hash)}, "tree") . "
parent" . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$par"), class => "list"}, $par) . "" . $cgi->a({-href => href(action=>"commit", hash=>$par), class => "list"}, $par) . "" . - $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commit;h=$par")}, "commit") . - " | " . $cgi->a({-href => "$my_uri?" . esc_param("p=$project;a=commitdiff;h=$hash;hp=$par")}, "commitdiff") . + $cgi->a({-href => href(action=>"commit", hash=>$par)}, "commit") . + " | " . $cgi->a({-href => href(action=>"commitdiff", hash=>$hash, hash_parent=>$par)}, "commitdiff") . "