Skip to content

Commit

Permalink
git-svn: Ignore usernames in URLs in find_by_url
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Adam Roben authored and Junio C Hamano committed Apr 26, 2007
1 parent 03044a9 commit 56973d2
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -1064,14 +1064,18 @@ 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;
$path =~ s#^\Q$repos_root\E(?:/|$)##;
}
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} || {};
Expand Down

0 comments on commit 56973d2

Please sign in to comment.