summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorLibravatar Simon Hausmann <hausmann@kde.org>2007-03-26 08:18:55 +0200
committerLibravatar Simon Hausmann <hausmann@kde.org>2007-03-26 08:18:55 +0200
commit8910ac0e888daeefdbe6f7391bece150b12b1ad0 (patch)
tree9f39ba47cafe6ef3dec7eb46d16af0fa36f256b0 /contrib
parentDon't try to parse any options with git-p4 debug but pass it straight on to p4 (diff)
downloadtgif-8910ac0e888daeefdbe6f7391bece150b12b1ad0.tar.xz
git-p4 debug doesn't need a git repository
Signed-off-by: Simon Hausmann <hausmann@kde.org>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/fast-import/git-p429
1 files changed, 16 insertions, 13 deletions
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 5b023b1b7a..eb5b40aa98 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -107,6 +107,7 @@ def gitBranchExists(branch):
class Command:
def __init__(self):
self.usage = "usage: %prog [options]"
+ self.needsGit = True
class P4Debug(Command):
def __init__(self):
@@ -114,6 +115,7 @@ class P4Debug(Command):
self.options = [
]
self.description = "A tool to debug the output of p4 -G."
+ self.needsGit = False
def run(self, args):
for output in p4CmdList(" ".join(args)):
@@ -1031,21 +1033,22 @@ if len(options) > 0:
(cmd, args) = parser.parse_args(sys.argv[2:], cmd);
-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 cmd.needsGit:
+ 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"):
- gitdir += "/.git"
- else:
- die("fatal: cannot locate git repository at %s" % gitdir)
+ if not isValidGitDir(gitdir):
+ if isValidGitDir(gitdir + "/.git"):
+ gitdir += "/.git"
+ else:
+ die("fatal: cannot locate git repository at %s" % gitdir)
-os.environ["GIT_DIR"] = gitdir
+ os.environ["GIT_DIR"] = gitdir
if not cmd.run(args):
parser.print_help()