git-p4: Fix bug in p4Where method.
[gitweb.git] / contrib / fast-import / git-p4
index b44fbfc9b3988ba848aafe109682006254e46b21..ee504e90ed81720829f547d0a1bff41f368be18c 100755 (executable)
@@ -245,7 +245,15 @@ def p4Cmd(cmd):
 def p4Where(depotPath):
     if not depotPath.endswith("/"):
         depotPath += "/"
-    output = p4Cmd("where %s..." % depotPath)
+    depotPath = depotPath + "..."
+    outputList = p4CmdList("where %s" % depotPath)
+    output = None
+    for entry in outputList:
+        if entry["depotFile"] == depotPath:
+            output = entry
+            break
+    if output == None:
+        return ""
     if output["code"] == "error":
         return ""
     clientPath = ""