From b2d2d16af7ff686fb96d344daaf49653fd67366a Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Wed, 25 Jul 2007 09:31:38 +0200 Subject: [PATCH] git-p4: Fix p4 user cache population on Windows. Fall back to USERPROFILE if HOME isn't set. Signed-off-by: Simon Hausmann Signed-off-by: Marius Storm-Olsen Signed-off-by: Junio C Hamano --- contrib/fast-import/git-p4 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4 index e3404ca85..1f5a56ee7 100755 --- a/contrib/fast-import/git-p4 +++ b/contrib/fast-import/git-p4 @@ -901,7 +901,8 @@ class P4Sync(Command): % (labelDetails["label"], change)) def getUserCacheFilename(self): - return os.environ["HOME"] + "/.gitp4-usercache.txt" + home = os.environ.get("HOME", os.environ.get("USERPROFILE")) + return home + "/.gitp4-usercache.txt" def getUserMapFromPerforceServer(self): if self.userMapFromPerforceServer: -- 2.30.2