From c27a1d959356fca51a355cdae121f655ddb8f97a Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Thu, 22 Mar 2007 21:27:14 +0100 Subject: [PATCH] Helper function to check the existance of a revision --- git-p4 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/git-p4 b/git-p4 index 6ead1c4..b21dee3 100755 --- a/git-p4 +++ b/git-p4 @@ -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]" -- 2.11.4.GIT