Browse Source

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

Signed-off-by: Simon Hausmann <hausmann@kde.org>
maint
Simon Hausmann 18 years ago
parent
commit
2061865005
  1. 4
      contrib/fast-import/git-p4.py

4
contrib/fast-import/git-p4.py

@ -925,6 +925,10 @@ parser = optparse.OptionParser(cmd.usage.replace("%prog", "%prog " + cmdName), @@ -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…
Cancel
Save