{"thread":{"id":"14864","subject":"[PATCH 1/2] Fix multi-glob assertion in git-svn","startedAt":"2008-08-06T19:55:42Z","lastAt":"2008-08-06T19:55:42Z","messageCount":1,"participants":["Marcus Griep"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"86366","messageId":"489A01BE.7080201@griep.us","threadId":"14864","inReplyTo":null,"subject":"[PATCH 1/2] Fix multi-glob assertion in git-svn","fromName":"Marcus Griep","fromEmail":"marcus@griep.us","sentAt":"2008-08-06T19:55:42Z","receivedAt":"2008-08-06T19:55:42Z","isPatch":true,"sender":{"key":"marcus@griep.us","avatar":"https://gravatar.com/avatar/0a841f2aad3f9a38c9bcf87a567c2a1751cb08924bae1bc46ee171395bcf9794?d=mp&s=160"},"body":"From 81b736f4a815ebded8978e63f2cba393528a57e0 Mon Sep 17 00:00:00 2001\nFrom: Marcus Griep <marcus@griep.us>\nDate: Tue, 5 Aug 2008 15:45:05 -0400\nSubject: [PATCH 1/2] Fix multi-glob assertion in git-svn\n\nSigned-off-by: Marcus Griep <marcus@griep.us>\n---\n git-svn.perl            |    5 +++--\n t/t9108-git-svn-glob.sh |   19 +++++++++++++++++++\n 2 files changed, 22 insertions(+), 2 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex cf6dbbc..95d11c2 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -4904,14 +4904,15 @@ sub new {\n        my ($class, $glob) = @_;\n        my $re = $glob;\n        $re =~ s!/+$!!g; # no need for trailing slashes\n-       my $nr = ($re =~ s!^(.*)\\*(.*)$!\\(\\[^/\\]+\\)!g);\n-       my ($left, $right) = ($1, $2);\n+       my $nr = $re =~ tr/*/*/;\n        if ($nr > 1) {\n                die \"Only one '*' wildcard expansion \",\n                    \"is supported (got $nr): '$glob'\\n\";\n        } elsif ($nr == 0) {\n                die \"One '*' is needed for glob: '$glob'\\n\";\n        }\n+       $re =~ s!^(.*)\\*(.*)$!\\(\\[^/\\]+\\)!g;\n+       my ($left, $right) = ($1, $2);\n        $re = quotemeta($left) . $re . quotemeta($right);\n        if (length $left && !($left =~ s!/+$!!g)) {\n                die \"Missing trailing '/' on left side of: '$glob' ($left)\\n\";\ndiff --git a/t/t9108-git-svn-glob.sh b/t/t9108-git-svn-glob.sh\nindex f6f71d0..ef6d88e 100755\n--- a/t/t9108-git-svn-glob.sh\n+++ b/t/t9108-git-svn-glob.sh\n@@ -83,4 +83,23 @@ test_expect_success 'test left-hand-side only globbing' '\n        cmp expect.two output.two\n        '\n\n+echo \"Only one '*' wildcard expansion is supported (got 2): 'branches/*/*'\" > expect.three\n+echo \"\" >> expect.three\n+\n+test_expect_success 'test disallow multi-globs' '\n+       git config --add svn-remote.three.url \"$svnrepo\" &&\n+       git config --add svn-remote.three.fetch trunk:refs/remotes/three/trunk &&\n+       git config --add svn-remote.three.branches \\\n+                        \"branches/*/*:refs/remotes/three/branches/*\" &&\n+       git config --add svn-remote.three.tags \\\n+                        \"tags/*/*:refs/remotes/three/tags/*\" &&\n+       cd tmp &&\n+               echo \"try try\" >> tags/end/src/b/readme &&\n+               poke tags/end/src/b/readme &&\n+               svn commit -m \"try to try\"\n+               cd .. &&\n+       test_must_fail git-svn fetch three &> stderr.three &&\n+       cmp expect.three stderr.three\n+       '\n+\n test_done\n--\n1.5.4.3\n\n-- \nMarcus Griep\nGPG Key ID: 0x5E968152\n——\nhttp://www.boohaunt.net\nאת.ψο´\n"}]}