git-p4: fix problem when p4 login is not necessary
authorPeter Osterlund <peterosterlund2@gmail.com>
Mon, 7 Jan 2019 20:51:38 +0000 (21:51 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 7 Jan 2019 22:23:22 +0000 (14:23 -0800)
In a perforce setup where login is not required, communication fails
because p4_check_access does not understand the response from the p4
client. Fixed by detecting and ignoring the "info" response.

Signed-off-by: Peter Osterlund <peterosterlund2@gmail.com>
Acked-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-p4.py
index 1998c3e141bec5142032f08623b916d7741e64ac..3e12774f96bb185bb6860290ad187c986ec7fa76 100755 (executable)
--- a/git-p4.py
+++ b/git-p4.py
@@ -332,6 +332,8 @@ def p4_check_access(min_expiration=1):
             die_bad_access("p4 error: {0}".format(data))
         else:
             die_bad_access("unknown error")
+    elif code == "info":
+        return
     else:
         die_bad_access("unknown error code {0}".format(code))