summaryrefslogtreecommitdiff
path: root/git-svn.perl
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-04-07 00:08:03 -0700
committerJunio C Hamano <gitster@pobox.com>2008-04-07 00:16:08 -0700
commitf61cc48d289755065813db1fbbd18e6bb0836076 (patch)
treec220221a070706e91b0f107f23baed2062454311 /git-svn.perl
parenta1c0dca43a3513574e5bebb38989671960cdaf35 (diff)
downloadgit-f61cc48d289755065813db1fbbd18e6bb0836076.tar.gz
git-svn: fix following renamed paths when tracking a single path
When using git-svn to follow only a single (empty) path per svn-remote (i.e. not using --stdlayout), following the history of a renamed path was broken in c586879cdfa4f8181a14e953a9152a4639eef333. This reverts the regression for the single (emtpy) path per svn-remote case. To avoid breaking the tests in a committed revision, this is an addendum to a patch originally submitted by Santhosh Kumar Mani <santhoshmani@gmail.com>: > git-svn: add test for renamed directory fetch > > This test tries to fetch a directory which had renames in the > history from a SVN repository. [ew: unneccesary dependency on the starting an HTTP server removed from Santhosh's original test.] Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl5
1 files changed, 3 insertions, 2 deletions
diff --git a/git-svn.perl b/git-svn.perl
index 1b44cbe106..81afb5cfcd 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -2239,12 +2239,13 @@ sub find_parent_branch {
# just grow a tail if we're not unique enough :x
$ref_id .= '-' while find_ref($ref_id);
print STDERR "Initializing parent: $ref_id\n";
- my ($u, $p) = ($new_url, '');
+ my ($u, $p, $repo_id) = ($new_url, '', $ref_id);
if ($u =~ s#^\Q$url\E(/|$)##) {
$p = $u;
$u = $url;
+ $repo_id = $self->{repo_id};
}
- $gs = Git::SVN->init($u, $p, $self->{repo_id}, $ref_id, 1);
+ $gs = Git::SVN->init($u, $p, $repo_id, $ref_id, 1);
}
my ($r0, $parent) = $gs->find_rev_before($r, 1);
if (!defined $r0 || !defined $parent) {