diff options
author | Simon Hausmann <hausmann@kde.org> | 2007-03-21 13:05:30 +0100 |
---|---|---|
committer | Simon Hausmann <hausmann@kde.org> | 2007-03-21 13:05:30 +0100 |
commit | 20618650058741117d909e086c2e78c003e5cfcd (patch) | |
tree | 1cb888543bba038a61b755db8d8a26a63f74d0af /contrib | |
parent | Made --apply-as-patch the default for git-p4 submit as it's significantly fas... (diff) | |
download | tgif-20618650058741117d909e086c2e78c003e5cfcd.tar.xz |
Make it possible to invoke git-p4 from within subdirectories of a git working tree.
Signed-off-by: Simon Hausmann <hausmann@kde.org>
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/fast-import/git-p4.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/contrib/fast-import/git-p4.py b/contrib/fast-import/git-p4.py index a07534058c..f940e93bad 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"): |