From: Simon Hausmann Date: Thu, 17 May 2007 05:42:38 +0000 (+0200) Subject: Fixing syncing (gitdir discovery / cd) for bare repositories X-Git-Tag: v1.5.3-rc0~65^2^2~109 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=5c4153e4880a90c05612521e9ee575a308d207db;p=git.git Fixing syncing (gitdir discovery / cd) for bare repositories Signed-off-by: Simon Hausmann --- diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4 index 70366ff8c..239304857 100755 --- a/contrib/fast-import/git-p4 +++ b/contrib/fast-import/git-p4 @@ -1200,7 +1200,9 @@ if cmd.needsGit: if not isValidGitDir(gitdir): gitdir = mypopen("git rev-parse --git-dir").read()[:-1] if os.path.exists(gitdir): - os.chdir(mypopen("git rev-parse --show-cdup").read()[:-1]); + cdup = mypopen("git rev-parse --show-cdup").read()[:-1]; + if len(cdup) > 0: + os.chdir(cdup); if not isValidGitDir(gitdir): if isValidGitDir(gitdir + "/.git"):