Code

Helper function to check the existance of a revision
authorSimon Hausmann <simon@lst.de>
Thu, 22 Mar 2007 20:27:14 +0000 (21:27 +0100)
committerSimon Hausmann <simon@lst.de>
Thu, 22 Mar 2007 20:27:14 +0000 (21:27 +0100)
Signed-off-by: Simon Hausmann <simon@lst.de>
contrib/fast-import/git-p4

index 6ead1c41732743cabdd3741bf5da66c1a44b134e..b21dee31997e96f1a6f5e141db007fe2f1838ae9 100755 (executable)
@@ -83,6 +83,9 @@ def extractDepotPathAndChangeFromGitLog(log):
 
     return values.get("depot-path"), values.get("change")
 
+def gitBranchExists(branch):
+    return os.system("git-rev-parse %s 2>/dev/null >/dev/null") == 0
+
 class Command:
     def __init__(self):
         self.usage = "usage: %prog [options]"