2010-01-23 11:30:01 +03:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Copyright (c) 2010 Jay Soffian
|
|
|
|
#
|
|
|
|
|
|
|
|
test_description='git svn fancy glob test'
|
|
|
|
|
|
|
|
. ./lib-git-svn.sh
|
|
|
|
|
|
|
|
test_expect_success 'load svn repo' "
|
|
|
|
svnadmin load -q '$rawsvnrepo' < '$TEST_DIRECTORY/t9154/svn.dump' &&
|
|
|
|
git svn init --minimize-url -T trunk '$svnrepo' &&
|
|
|
|
git svn fetch
|
|
|
|
"
|
|
|
|
|
|
|
|
test_expect_success 'add red branch' "
|
|
|
|
git config svn-remote.svn.branches 'branches/{red}:refs/remotes/*' &&
|
|
|
|
git svn fetch &&
|
|
|
|
git rev-parse refs/remotes/red &&
|
|
|
|
test_must_fail git rev-parse refs/remotes/green &&
|
|
|
|
test_must_fail git rev-parse refs/remotes/blue
|
|
|
|
"
|
|
|
|
|
Make git-svn branch patterns match complete URL
When using the {word,[...]} style of configuration for tags and branches,
it appears the intent is to only match whole path parts, since the words
in the {} pattern are meta-character quoted.
When the pattern word appears in the beginning or middle of the url,
it's matched completely, since the left side, pattern, and (non-empty)
right side are joined together with path separators.
However, when the pattern word appears at the end of the URL, the
right side is an empty pattern, and the resulting regex matches
more than just the specified pattern.
For example, if you specify something along the lines of
branches = branches/project/{release_1,release_2}
and your repository also contains "branches/project/release_1_2", you
will also get the release_1_2 branch. By restricting the match regex
with anchors, this is avoided.
Signed-off-by: Ammon Riley <ammon.riley@gmail.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
2012-08-31 02:53:57 +04:00
|
|
|
test_expect_success 'add gre branch' "
|
2014-03-21 03:17:01 +04:00
|
|
|
git config --file=.git/svn/.metadata --unset svn-remote.svn.branches-maxRev &&
|
Make git-svn branch patterns match complete URL
When using the {word,[...]} style of configuration for tags and branches,
it appears the intent is to only match whole path parts, since the words
in the {} pattern are meta-character quoted.
When the pattern word appears in the beginning or middle of the url,
it's matched completely, since the left side, pattern, and (non-empty)
right side are joined together with path separators.
However, when the pattern word appears at the end of the URL, the
right side is an empty pattern, and the resulting regex matches
more than just the specified pattern.
For example, if you specify something along the lines of
branches = branches/project/{release_1,release_2}
and your repository also contains "branches/project/release_1_2", you
will also get the release_1_2 branch. By restricting the match regex
with anchors, this is avoided.
Signed-off-by: Ammon Riley <ammon.riley@gmail.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
2012-08-31 02:53:57 +04:00
|
|
|
git config svn-remote.svn.branches 'branches/{red,gre}:refs/remotes/*' &&
|
|
|
|
git svn fetch &&
|
|
|
|
git rev-parse refs/remotes/red &&
|
|
|
|
test_must_fail git rev-parse refs/remotes/green &&
|
|
|
|
test_must_fail git rev-parse refs/remotes/blue
|
|
|
|
"
|
|
|
|
|
2010-01-23 11:30:01 +03:00
|
|
|
test_expect_success 'add green branch' "
|
2014-03-21 03:17:01 +04:00
|
|
|
git config --file=.git/svn/.metadata --unset svn-remote.svn.branches-maxRev &&
|
2010-01-23 11:30:01 +03:00
|
|
|
git config svn-remote.svn.branches 'branches/{red,green}:refs/remotes/*' &&
|
|
|
|
git svn fetch &&
|
|
|
|
git rev-parse refs/remotes/red &&
|
|
|
|
git rev-parse refs/remotes/green &&
|
|
|
|
test_must_fail git rev-parse refs/remotes/blue
|
|
|
|
"
|
|
|
|
|
|
|
|
test_expect_success 'add all branches' "
|
2014-03-21 03:17:01 +04:00
|
|
|
git config --file=.git/svn/.metadata --unset svn-remote.svn.branches-maxRev &&
|
2010-01-23 11:30:01 +03:00
|
|
|
git config svn-remote.svn.branches 'branches/*:refs/remotes/*' &&
|
|
|
|
git svn fetch &&
|
|
|
|
git rev-parse refs/remotes/red &&
|
|
|
|
git rev-parse refs/remotes/green &&
|
|
|
|
git rev-parse refs/remotes/blue
|
|
|
|
"
|
|
|
|
|
|
|
|
test_done
|