Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""
-import sys, os, glob, popen2
+import sys, os, popen2
from stgit.utils import *
def set_head_file(ref):
"""Resets HEAD to point to a new ref
"""
+ # head cache flushing is needed since we might have a different value
+ # in the new head
+ __clear_head_cache()
if __run('git-symbolic-ref HEAD', [ref]) != 0:
raise GitException, 'Could not set head to "%s"' % ref
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