git-cvsimport: fix handling of user name when it is not set in CVSROOT

The cvs programs do not default to "anonymous" as the user name, but use the
currently logged in user.  This patch more closely matches the cvs behavior.

Signed-off-by: Gordon Hopper <g.hopper@computer.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Gordon Hopper 2007-11-08 13:15:20 -07:00 committed by Junio C Hamano
parent c238dad407
commit 2e458e0575

View file

@ -223,7 +223,8 @@ sub conn {
}
}
$user="anonymous" unless defined $user;
# if username is not explicit in CVSROOT, then use current user, as cvs would
$user=(getlogin() || $ENV{'LOGNAME'} || $ENV{'USER'} || "anonymous") unless $user;
my $rr2 = "-";
unless ($port) {
$rr2 = ":pserver:$user\@$serv:$repo";