[jhbuild] [git] support for 'git branch' that doesn't return any active branch



commit 343452b22287b1482f3980120216390b34678950
Author: Frédéric Péters <fpeters 0d be>
Date:   Tue Jun 16 08:54:59 2009 +0200

    [git] support for 'git branch' that doesn't return any active branch

 jhbuild/versioncontrol/git.py |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/jhbuild/versioncontrol/git.py b/jhbuild/versioncontrol/git.py
index 8c6c89f..edd7f69 100644
--- a/jhbuild/versioncontrol/git.py
+++ b/jhbuild/versioncontrol/git.py
@@ -269,7 +269,7 @@ class GitBranch(Branch):
         else:
             current_branch = self.get_current_branch()
             if current_branch != would_be_branch or current_branch == '(no branch)':
-                if current_branch == '(no branch)':
+                if current_branch in ('(no branch)', None):
                     # if user was not on any branch, get back to a known track
                     current_branch = 'master'
                 # if current branch doesn't exist as origin/$branch it is assumed
@@ -284,7 +284,7 @@ class GitBranch(Branch):
                             **git_extra_args)
 
         current_branch = self.get_current_branch()
-        if current_branch != '(no branch)':
+        if current_branch not in ('(no branch)', None):
             buildscript.execute(['git', 'pull', '--rebase'], **git_extra_args)
 
         if stashed:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]