From: Simon Hausmann Date: Wed, 21 Mar 2007 12:05:30 +0000 (+0100) Subject: Make it possible to invoke git-p4 from within subdirectories of a git working tree. X-Git-Tag: v1.5.3-rc0~65^2^2~162 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=20618650058741117d909e086c2e78c003e5cfcd;p=git.git Make it possible to invoke git-p4 from within subdirectories of a git working tree. Signed-off-by: Simon Hausmann --- diff --git a/contrib/fast-import/git-p4.py b/contrib/fast-import/git-p4.py index a07534058..f940e93ba 100755 --- a/contrib/fast-import/git-p4.py +++ b/contrib/fast-import/git-p4.py @@ -925,6 +925,10 @@ parser = optparse.OptionParser(cmd.usage.replace("%prog", "%prog " + cmdName), gitdir = cmd.gitdir if len(gitdir) == 0: gitdir = ".git" + if not isValidGitDir(gitdir): + cdup = os.popen("git-rev-parse --show-cdup").read()[:-1] + if isValidGitDir(cdup + "/" + gitdir): + os.chdir(cdup) if not isValidGitDir(gitdir): if isValidGitDir(gitdir + "/.git"):