summaryrefslogtreecommitdiff
path: root/git-svn.perl
diff options
context:
space:
mode:
authorAdam Roben <aroben@apple.com>2007-04-25 12:42:58 -0700
committerJunio C Hamano <junkio@cox.net>2007-04-25 23:05:44 -0700
commit56973d20c181abdc5cc13eab976733feec0c590b (patch)
treec2d6f055facea75f74cb82792741fbebb8bf72f3 /git-svn.perl
parent03044a9854b006a64c5117d971b01c1d1586edd9 (diff)
downloadgit-56973d20c181abdc5cc13eab976733feec0c590b.tar.gz
git-svn: Ignore usernames in URLs in find_by_url
Usernames don't matter for the purposes of find_by_url, so always remove them before doing any comparisons. Signed-off-by: Adam Roben <aroben@apple.com> Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl4
1 files changed, 4 insertions, 0 deletions
diff --git a/git-svn.perl b/git-svn.perl
index 90f3bc18b9..7b5f8ab3be 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1064,7 +1064,10 @@ sub init_remote_config {
sub find_by_url { # repos_root and, path are optional
my ($class, $full_url, $repos_root, $path) = @_;
+
return undef unless defined $full_url;
+ remove_username($full_url);
+ remove_username($repos_root) if defined $repos_root;
my $remotes = read_all_remotes();
if (defined $full_url && defined $repos_root && !defined $path) {
$path = $full_url;
@@ -1072,6 +1075,7 @@ sub find_by_url { # repos_root and, path are optional
}
foreach my $repo_id (keys %$remotes) {
my $u = $remotes->{$repo_id}->{url} or next;
+ remove_username($u);
next if defined $repos_root && $repos_root ne $u;
my $fetch = $remotes->{$repo_id}->{fetch} || {};