From: Junio C Hamano Date: Fri, 06 May 2016 22:21:55 GMT Subject: Re: [PATCH] gitweb: fix link to parent diff with pathinfo Message-ID: In-Reply-To: <1462529978-31322-1-git-send-email-rbraun@sceen.net> Richard Braun writes: > Signed-off-by: Richard Braun > --- Could you justify your change with a bit more than "fix"? That is, gitweb, when used with PATH_INFO, shows a link to parent diff like [fill in the blank]. However, it is wrong because [fill in the blank]. Make it show it like [fill in the blank]. Because [fill in the blank], delete 'hash_parent' element from the %params hash once we used it; otherwise [fill in the blank to describe "this bad thing happens"]. or something like that. Thanks. > gitweb/gitweb.perl | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl > index 05d7910..f7f7936 100755 > --- a/gitweb/gitweb.perl > +++ b/gitweb/gitweb.perl > @@ -1423,7 +1423,12 @@ sub href { > delete $params{'hash'}; > delete $params{'hash_base'}; > } elsif (defined $params{'hash'}) { > - $href .= esc_path_info($params{'hash'}); > + if (defined $params{'hash_parent'}) { > + $href .= esc_path_info($params{'hash_parent'}); > + delete $params{'hash_parent'}; > + } else { > + $href .= esc_path_info($params{'hash'}); > + } > delete $params{'hash'}; > }