mirror of
https://github.com/git/git.git
synced 2024-11-25 10:54:00 +08:00
Merge branch 'dm/svn-remote'
* dm/svn-remote: git-svn: Make branch use correct svn-remote
This commit is contained in:
commit
123ed65908
@ -558,7 +558,7 @@ sub cmd_branch {
|
|||||||
|
|
||||||
my ($src, $rev, undef, $gs) = working_head_info($head);
|
my ($src, $rev, undef, $gs) = working_head_info($head);
|
||||||
|
|
||||||
my $remote = Git::SVN::read_all_remotes()->{svn};
|
my $remote = Git::SVN::read_all_remotes()->{$gs->{repo_id}};
|
||||||
my $glob = $remote->{ $_tag ? 'tags' : 'branches' };
|
my $glob = $remote->{ $_tag ? 'tags' : 'branches' };
|
||||||
my ($lft, $rgt) = @{ $glob->{path} }{qw/left right/};
|
my ($lft, $rgt) = @{ $glob->{path} }{qw/left right/};
|
||||||
my $dst = join '/', $remote->{url}, $lft, $branch_name, ($rgt || ());
|
my $dst = join '/', $remote->{url}, $lft, $branch_name, ($rgt || ());
|
||||||
|
@ -56,4 +56,23 @@ test_expect_success 'git svn branch tests' '
|
|||||||
test_must_fail git svn tag tag1
|
test_must_fail git svn tag tag1
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success 'branch uses correct svn-remote' '
|
||||||
|
(svn co "$svnrepo" svn &&
|
||||||
|
cd svn &&
|
||||||
|
mkdir mirror &&
|
||||||
|
svn add mirror &&
|
||||||
|
svn copy trunk mirror/ &&
|
||||||
|
svn copy tags mirror/ &&
|
||||||
|
svn copy branches mirror/ &&
|
||||||
|
svn ci -m "made mirror" ) &&
|
||||||
|
rm -rf svn &&
|
||||||
|
git svn init -s -R mirror --prefix=mirror/ "$svnrepo"/mirror &&
|
||||||
|
git svn fetch -R mirror &&
|
||||||
|
git checkout mirror/trunk &&
|
||||||
|
base=$(git rev-parse HEAD:) &&
|
||||||
|
git svn branch -m "branch in mirror" d &&
|
||||||
|
test $base = $(git rev-parse remotes/mirror/d:) &&
|
||||||
|
test_must_fail git rev-parse remotes/d
|
||||||
|
'
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
Loading…
Reference in New Issue
Block a user