Skip to content

Commit

Permalink
git-cvsimport: fix handling of user name when it is not set in CVSROOT
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Gordon Hopper authored and Junio C Hamano committed Nov 9, 2007
1 parent c238dad commit 2e458e0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion git-cvsimport.perl
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down

0 comments on commit 2e458e0

Please sign in to comment.