From 7863c612f402268b5978683f44adad3a7a867613 Mon Sep 17 00:00:00 2001 From: Jakub Narebski Date: Thu, 14 Feb 2008 09:22:30 +0100 Subject: [PATCH 1/2] gitweb: Fix bug in href(..., -replay=>1) when using 'pathinfo' form URLs generated by href(..., -replay=>1) (which includes 'next page' links and alternate view links) didn't set project info correctly when current page URL is in pathinfo form. This resulted in broken links such like: http://www.example.com/w/ARRAY(0x85a5318)?a=shortlog;pg=1 if the 'pathinfo' feature was used, or http://www.example.com/w/?a=shortlog;pg=1 if it wasn't, instead of correct: http://www.example.com/w/project.git?a=shortlog;pg=1 This was caused by the fact that href() always replays params in the arrayref form, were they multivalued or singlevalued, and the code dealing with 'pathinfo' feature couldn't deal with $params{'project'} being arrayref. Setting $params{'project'} is moved before replaying params; this ensures that 'project' parameter is processed correctly. Noticed-by: Peter Oberndorfer Noticed-by: Wincent Colaiuta Signed-off-by: Jakub Narebski Signed-off-by: Junio C Hamano --- gitweb/gitweb.perl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl index ae2d05763f..b582332f45 100755 --- a/gitweb/gitweb.perl +++ b/gitweb/gitweb.perl @@ -611,6 +611,8 @@ (%) ); my %mapping = @mapping; + $params{'project'} = $project unless exists $params{'project'}; + if ($params{-replay}) { while (my ($name, $symbol) = each %mapping) { if (!exists $params{$name}) { @@ -620,8 +622,6 @@ (%) } } - $params{'project'} = $project unless exists $params{'project'}; - my ($use_pathinfo) = gitweb_check_feature('pathinfo'); if ($use_pathinfo) { # use PATH_INFO for project name From c36c5b845e1958bad1b69ee42e3da926de4f948b Mon Sep 17 00:00:00 2001 From: Marc-Andre Lureau Date: Wed, 12 Mar 2008 21:54:21 +0200 Subject: [PATCH 2/2] git-cvsimport: fix merging with remote parent branch commit-tree fails when specifying a remote name (via -r option) and one of the parent branch has a name. Prefixing with "$remote/" fix it. Signed-off-by: Marc-Andre Lureau Signed-off-by: Junio C Hamano --- git-cvsimport.perl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-cvsimport.perl b/git-cvsimport.perl index 9516242338..8093996e25 100755 --- a/git-cvsimport.perl +++ b/git-cvsimport.perl @@ -730,7 +730,7 @@ sub commit { next unless $logmsg =~ $rx && $1; my $mparent = $1 eq 'HEAD' ? $opt_o : $1; if (my $sha1 = get_headref("$remote/$mparent")) { - push @commit_args, '-p', $mparent; + push @commit_args, '-p', "$remote/$mparent"; print "Merge parent branch: $mparent\n" if $opt_v; } }