summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1174768)
raw | patch | inline | side by side (parent: 1174768)
author | Torsten Schmutzler <git-ts@theblacksun.eu> | |
Thu, 6 May 2010 20:20:43 +0000 (22:20 +0200) | ||
committer | Eric Wong <normalperson@yhbt.net> | |
Sun, 9 May 2010 08:25:19 +0000 (01:25 -0700) |
git-check-ref-format(1) describes names which
cannot be used as refnames for git. Some are
legal branchnames in subversion however.
Mangle the not yet handled cases.
Signed-off-by: Torsten Schmutzler <git-ts@theblacksun.eu>
Acked-by: Eric Wong <normalperson@yhbt.net>
cannot be used as refnames for git. Some are
legal branchnames in subversion however.
Mangle the not yet handled cases.
Signed-off-by: Torsten Schmutzler <git-ts@theblacksun.eu>
Acked-by: Eric Wong <normalperson@yhbt.net>
git-svn.perl | patch | blob | history | |
t/t9118-git-svn-funky-branch-names.sh | patch | blob | history |
diff --git a/git-svn.perl b/git-svn.perl
index 74d86128ccb063d6aa7e6303a2c6c15739fde1e9..b3b6964f95976ba885a277de9d463a2443dd3147 100755 (executable)
--- a/git-svn.perl
+++ b/git-svn.perl
# .. becomes %2E%2E
$refname =~ s{\.\.}{%2E%2E}g;
+ # trailing dots and .lock are not allowed
+ # .$ becomes %2E and .lock becomes %2Elock
+ $refname =~ s{\.(?=$|lock$)}{%2E};
+
+ # the sequence @{ is used to access the reflog
+ # @{ becomes %40{
+ $refname =~ s{\@\{}{%40\{}g;
+
return $refname;
}
index ac52bff0ef540bce48e4ee02a53adbbec3662939..7d7acc30b4a64ba97afe06e03c65ebca4ca7f242 100755 (executable)
"$svnrepo/pr ject/branches/more fun plugin!" &&
svn_cmd cp -m "scary" "$svnrepo/pr ject/branches/fun plugin" \
"$svnrepo/pr ject/branches/$scary_uri" &&
+ svn_cmd cp -m "leading dot" "$svnrepo/pr ject/trunk" \
+ "$svnrepo/pr ject/branches/.leading_dot" &&
+ svn_cmd cp -m "trailing dot" "$svnrepo/pr ject/trunk" \
+ "$svnrepo/pr ject/branches/trailing_dot." &&
+ svn_cmd cp -m "trailing .lock" "$svnrepo/pr ject/trunk" \
+ "$svnrepo/pr ject/branches/trailing_dotlock.lock" &&
+ svn_cmd cp -m "reflog" "$svnrepo/pr ject/trunk" \
+ "$svnrepo/pr ject/branches/not-a@{0}reflog" &&
start_httpd
'
git rev-parse "refs/remotes/fun%20plugin" &&
git rev-parse "refs/remotes/more%20fun%20plugin!" &&
git rev-parse "refs/remotes/$scary_ref" &&
+ git rev-parse "refs/remotes/%2Eleading_dot" &&
+ git rev-parse "refs/remotes/trailing_dot%2E" &&
+ git rev-parse "refs/remotes/trailing_dotlock%2Elock" &&
+ git rev-parse "refs/remotes/not-a%40{0}reflog" &&
cd ..
'
cd ..
'
+test_expect_success 'test dcommit to trailing_dotlock branch' '
+ cd project &&
+ git reset --hard "refs/remotes/trailing_dotlock%2Elock" &&
+ echo who names branches like this anyway? >> foo &&
+ git commit -m "bar" -- foo &&
+ git svn dcommit &&
+ cd ..
+ '
+
stop_httpd
test_done