Skip to content

Commit b3e9593

Browse files
author
Eric Wong
committed
git svn: allow uppercase UUIDs from SVN
SVN allows uppercase A-F characters in repositories. Although `svnadmin' does not create UUIDs with uppercase by default, it is possible to change the UUID of a SVN repository and SVN itself will make no attempt to normalize them. Thanks to Esben Skovenborg for discovering this issue. Signed-off-by: Eric Wong <[email protected]>
1 parent 0b2af45 commit b3e9593

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

git-svn.perl

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,11 +1359,11 @@ sub read_repo_config {
13591359
sub extract_metadata {
13601360
my $id = shift or return (undef, undef, undef);
13611361
my ($url, $rev, $uuid) = ($id =~ /^\s*git-svn-id:\s+(.*)\@(\d+)
1362-
\s([a-f\d\-]+)$/x);
1362+
\s([a-f\d\-]+)$/ix);
13631363
if (!defined $rev || !$uuid || !$url) {
13641364
# some of the original repositories I made had
13651365
# identifiers like this:
1366-
($rev, $uuid) = ($id =~/^\s*git-svn-id:\s(\d+)\@([a-f\d\-]+)/);
1366+
($rev, $uuid) = ($id =~/^\s*git-svn-id:\s(\d+)\@([a-f\d\-]+)/i);
13671367
}
13681368
return ($url, $rev, $uuid);
13691369
}
@@ -2010,7 +2010,7 @@ sub _set_svm_vars {
20102010

20112011
chomp($src, $uuid);
20122012

2013-
$uuid =~ m{^[0-9a-f\-]{30,}$}
2013+
$uuid =~ m{^[0-9a-f\-]{30,}$}i
20142014
or die "doesn't look right - svm:uuid is '$uuid'\n";
20152015

20162016
# the '!' is used to mark the repos_root!/relative/path
@@ -2096,7 +2096,7 @@ sub svnsync {
20962096
die "doesn't look right - svn:sync-from-url is '$url'\n";
20972097

20982098
my $uuid = tmp_config('--get', "$section.svnsync-uuid");
2099-
($uuid) = ($uuid =~ m{^([0-9a-f\-]{30,})$}) or
2099+
($uuid) = ($uuid =~ m{^([0-9a-f\-]{30,})$}i) or
21002100
die "doesn't look right - svn:sync-from-uuid is '$uuid'\n";
21012101

21022102
$svnsync = { url => $url, uuid => $uuid }
@@ -2114,7 +2114,7 @@ sub svnsync {
21142114
die "doesn't look right - svn:sync-from-url is '$url'\n";
21152115

21162116
my $uuid = $rp->{'svn:sync-from-uuid'} or die $err . "uuid\n";
2117-
($uuid) = ($uuid =~ m{^([0-9a-f\-]{30,})$}) or
2117+
($uuid) = ($uuid =~ m{^([0-9a-f\-]{30,})$}i) or
21182118
die "doesn't look right - svn:sync-from-uuid is '$uuid'\n";
21192119

21202120
my $section = "svn-remote.$self->{repo_id}";
@@ -2130,7 +2130,7 @@ sub ra_uuid {
21302130
unless ($self->{ra_uuid}) {
21312131
my $key = "svn-remote.$self->{repo_id}.uuid";
21322132
my $uuid = eval { tmp_config('--get', $key) };
2133-
if (!$@ && $uuid && $uuid =~ /^([a-f\d\-]{30,})$/) {
2133+
if (!$@ && $uuid && $uuid =~ /^([a-f\d\-]{30,})$/i) {
21342134
$self->{ra_uuid} = $uuid;
21352135
} else {
21362136
die "ra_uuid called without URL\n" unless $self->{url};
@@ -2848,7 +2848,7 @@ sub make_log_entry {
28482848
die "Can't have both 'useSvmProps' and 'rewriteRoot' ",
28492849
"options set!\n";
28502850
}
2851-
my ($uuid, $r) = $headrev =~ m{^([a-f\d\-]{30,}):(\d+)$};
2851+
my ($uuid, $r) = $headrev =~ m{^([a-f\d\-]{30,}):(\d+)$}i;
28522852
# we don't want "SVM: initializing mirror for junk" ...
28532853
return undef if $r == 0;
28542854
my $svm = $self->svm;

0 commit comments

Comments
 (0)