From: Gordon Hopper Date: Thu, 8 Nov 2007 20:15:20 +0000 (-0700) Subject: git-cvsimport: fix handling of user name when it is not set in CVSROOT X-Git-Tag: v1.5.4-rc0~215^2 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=2e458e0575de6478693586d387f71873d280b934;p=git.git 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 Signed-off-by: Junio C Hamano --- diff --git a/git-cvsimport.perl b/git-cvsimport.perl index e4bc2b54f..efa6a0c41 100755 --- a/git-cvsimport.perl +++ b/git-cvsimport.perl @@ -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";