# [PATCH] git-p4: Fix p4 user cache population on Windows.

2 messages from 2007-07-25 to 2007-07-25. Participants: Simon Hausmann, Junio C Hamano.
Thread: https://gitlist.dev/t/9215

## Simon Hausmann, 2007-07-25 07:31

Subject: [PATCH] git-p4: Fix p4 user cache population on Windows.
Message-ID: <200707250931.41414.simon@lst.de>
URL: https://gitlist.dev/e/200707250931.41414.simon%40lst.de

```
Fall back to USERPROFILE if HOME isn't set.

Signed-off-by: Simon Hausmann <shausman@trolltech.com>
Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
---
 contrib/fast-import/git-p4 |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index e3404ca..1f5a56e 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:
-- 
1.5.3.rc0.63.gc956

```

## Junio C Hamano, 2007-07-25 23:07

Subject: Re: [PATCH] git-p4: Fix p4 user cache population on Windows.
Message-ID: <7vodi0ccbu.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vodi0ccbu.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <200707250931.41414.simon@lst.de>

```
Thanks.

```
