chiark / gitweb /
Make sure switch_branch uses the right __head
authorChuck Lever <cel@netapp.com>
Wed, 26 Oct 2005 18:51:38 +0000 (14:51 -0400)
committerCatalin Marinas <catalin.marinas@gmail.com>
Thu, 27 Oct 2005 19:47:12 +0000 (20:47 +0100)
"switch_branch" needs to use the global variable __head, not a local
version.

Signed-off-by: Chuck Lever <cel@netapp.com>
stgit/git.py

index 58a4841b64cc864046588b1b21124e0973ef1b99..33702cbc27ef0529526a06962e7277e01fb20299 100644 (file)
@@ -296,6 +296,8 @@ def create_branch(new_branch, tree_id = None):
 def switch_branch(name):
     """Switch to a git branch
     """
+    global __head
+
     new_head = os.path.join('refs', 'heads', name)
     if not branch_exists(new_head):
         raise GitException, 'Branch "%s" does not exist' % name