This function also changes the value read from the HEAD link but it didn't
flush the internal cached value.
Signed-off-by: Catalin Marinas <catalin.marinas@gmail.com>
def set_head_file(ref):
"""Resets HEAD to point to a new ref
"""
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
if __run('git-symbolic-ref HEAD', [ref]) != 0:
raise GitException, 'Could not set head to "%s"' % ref