From: Simon Hausmann Date: Thu, 22 Mar 2007 20:27:14 +0000 (+0100) Subject: Helper function to check the existance of a revision X-Git-Tag: v1.5.3-rc0~65^2^2~156 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=8136a6399c886dec8d1b806a7d8728324e906729;p=git.git Helper function to check the existance of a revision Signed-off-by: Simon Hausmann --- diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4 index 6ead1c417..b21dee319 100755 --- a/contrib/fast-import/git-p4 +++ b/contrib/fast-import/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]"