summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGordon Hopper <g.hopper@computer.org>2007-11-08 13:15:20 -0700
committerJunio C Hamano <gitster@pobox.com>2007-11-09 01:23:40 -0800
commit2e458e0575de6478693586d387f71873d280b934 (patch)
treee2dc4c44b21da4977dfee5d5a0e54194b9f2b05d
parentc238dad407aec1ccf6e364f9c95e10e7f84eac8f (diff)
downloadgit-2e458e0575de6478693586d387f71873d280b934.tar.gz
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>
-rwxr-xr-xgit-cvsimport.perl3
1 files changed, 2 insertions, 1 deletions
diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index e4bc2b54f6..efa6a0c41a 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";