summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2007-11-14 14:03:27 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2007-11-14 14:03:27 -0800
commite318f607235bd5d7bc1c5c7e669380d1978cdb13 (patch)
tree69a0c142d11aa9585f9ceef84a83e33fa6af01ad
parentuser-manual: minor rewording for clarity. (diff)
parentgit-cvsimport: fix handling of user name when it is not set in CVSROOT (diff)
downloadtgif-e318f607235bd5d7bc1c5c7e669380d1978cdb13.tar.xz
Merge branch 'gh/cvsimport-user'
* gh/cvsimport-user: git-cvsimport: fix handling of user name when it is not set in CVSROOT
-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";