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:
parent
1932a6ac7c
commit
2061865005
@ -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"):
|
||||
|
Loading…
Reference in New Issue
Block a user