From 77e806121b0341ce586bd5d2681283c9c99719e9 Mon Sep 17 00:00:00 2001 From: Fred Date: Sat, 4 Aug 2012 01:16:13 +0800 Subject: [PATCH] Git does not checkout branch if already on branch --- lib/git.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/git.py b/lib/git.py index 398fb53..83756bc 100644 --- a/lib/git.py +++ b/lib/git.py @@ -20,6 +20,8 @@ class Git(): return result[0] == 0 def checkout(self, branch): + if self.currentBranch == branch: + return True cmd = 'checkout %s' % branch result = self.execute(cmd) return result[0] == 0 -- 2.11.0