From: Simon Hausmann Date: Wed, 16 May 2007 10:12:39 +0000 (+0200) Subject: Fix calling git-p4 rebase from within a subdirectory (git rebase wants to be in toplevel) X-Git-Tag: v1.5.3-rc0~65^2^2~111 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=dc1a93b6dce1d38e6e0ddd8980d8ccd64937fcb1;p=git.git Fix calling git-p4 rebase from within a subdirectory (git rebase wants to be in toplevel) Signed-off-by: Simon Hausmann --- diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4 index c48b25757..ca6c62380 100755 --- a/contrib/fast-import/git-p4 +++ b/contrib/fast-import/git-p4 @@ -1197,6 +1197,8 @@ if cmd.needsGit: gitdir = ".git" 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]); if not isValidGitDir(gitdir): if isValidGitDir(gitdir + "/.git"):