1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-22 05:06:09 +02:00

Make it possible to invoke git-p4 from within subdirectories of a git working tree.

Signed-off-by: Simon Hausmann <hausmann@kde.org>
This commit is contained in:
Simon Hausmann 2007-03-21 13:05:30 +01:00
parent 1932a6ac7c
commit 2061865005

View File

@ -925,6 +925,10 @@ def printUsage(commands):
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"):