@matheusbsbs / matheus-bagliano / commits / 2e458e0575
Fork 0

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>

Gordon Hopper committed Nov 8, 2007 at 13:15 UTC 2e458e0575de6478693586d387f71873d280b934
1 file changed +2 -1
git-cvsimport.perl
+2 -1
@@ -223,7 +223,8 @@ sub conn {
223 }
224 }
225
226 - $user="anonymous" unless defined $user;
226 + # if username is not explicit in CVSROOT, then use current user, as cvs would
227 + $user=(getlogin() || $ENV{'LOGNAME'} || $ENV{'USER'} || "anonymous") unless $user;
228 my $rr2 = "-";
229 unless ($port) {
230 $rr2 = ":pserver:$user\@$serv:$repo";