diff options
author | Deskin Miller <deskinm@umich.edu> | 2008-12-01 21:43:00 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-12-03 01:54:24 -0800 |
commit | a0fbc87cff6ae80c5b5be84201bc53252533b1fb (patch) | |
tree | 74a1a8ec7bdb55050e1b1e893b0e527aea89fba2 /t | |
parent | git-stash: use git rev-parse -q (diff) | |
download | tgif-a0fbc87cff6ae80c5b5be84201bc53252533b1fb.tar.xz |
git-svn: Make branch use correct svn-remote
The 'branch' subcommand incorrectly had the svn-remote to use hardcoded
as 'svn', the default remote name. This meant that branches derived
from other svn-remotes would try to use the branch and tag configuration
for the 'svn' remote, potentially copying would-be branches to the wrong
place in SVN, into the branch namespace for another project.
Fix this by using the remote name extracted from the svn info for the
specified git ref. Add a testcase for this behaviour.
[jc: squashed in a fix to test from Michael J Gruber for older svn (1.4)]
Signed-off-by: Deskin Miller <deskinm@umich.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t9128-git-svn-cmd-branch.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t9128-git-svn-cmd-branch.sh b/t/t9128-git-svn-cmd-branch.sh index 47c4d4d938..252daa7e1a 100755 --- a/t/t9128-git-svn-cmd-branch.sh +++ b/t/t9128-git-svn-cmd-branch.sh @@ -56,4 +56,23 @@ test_expect_success 'git svn branch tests' ' 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 |