@matheusbsbs / matheus-bagliano / commits / 56973d20c1
Fork 0

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>

Adam Roben committed Apr 25, 2007 at 12:42 UTC 56973d20c181abdc5cc13eab976733feec0c590b
1 file changed +4
git-svn.perl
+4
@@ -1064,7 +1064,10 @@ sub init_remote_config {
1064
1065 sub find_by_url { # repos_root and, path are optional
1066 my ($class, $full_url, $repos_root, $path) = @_;
1067 +
1068 return undef unless defined $full_url;
1069 + remove_username($full_url);
1070 + remove_username($repos_root) if defined $repos_root;
1071 my $remotes = read_all_remotes();
1072 if (defined $full_url && defined $repos_root && !defined $path) {
1073 $path = $full_url;
@@ -1072,6 +1075,7 @@ sub find_by_url { # repos_root and, path are optional
1075 }
1076 foreach my $repo_id (keys %$remotes) {
1077 my $u = $remotes->{$repo_id}->{url} or next;
1078 + remove_username($u);
1079 next if defined $repos_root && $repos_root ne $u;
1080
1081 my $fetch = $remotes->{$repo_id}->{fetch} || {};