git-p4: do not pass '-r 0' to p4 commands
[gitweb.git] / git-p4.py
index 2422178210f344131a783edd3c1d5acbd0229512..2d39d10122caa2e5a5c6814200639912d87f1f68 100755 (executable)
--- a/git-p4.py
+++ b/git-p4.py
@@ -82,7 +82,9 @@ def p4_build_cmd(cmd):
     if retries is None:
         # Perform 3 retries by default
         retries = 3
-    real_cmd += ["-r", str(retries)]
+    if retries > 0:
+        # Provide a way to not pass this option by setting git-p4.retries to 0
+        real_cmd += ["-r", str(retries)]
 
     if isinstance(cmd,basestring):
         real_cmd = ' '.join(real_cmd) + ' ' + cmd