git-p4: clone does not use --git-dir
[gitweb.git] / contrib / fast-import / git-p4
index 594980302b634d13029c740d582246eb9ec75a74..dafc4a2c82eb795eb1f5e7eff2998c26760985ea 100755 (executable)
@@ -2335,7 +2335,8 @@ def main():
     args = sys.argv[2:]
 
     if len(options) > 0:
-        options.append(optparse.make_option("--git-dir", dest="gitdir"))
+        if cmd.needsGit:
+            options.append(optparse.make_option("--git-dir", dest="gitdir"))
 
         parser = optparse.OptionParser(cmd.usage.replace("%prog", "%prog " + cmdName),
                                        options,