chiark / gitweb /
Flush the HEAD cache in set_head_file()
authorCatalin Marinas <catalin.marinas@gmail.com>
Fri, 7 Oct 2005 21:15:38 +0000 (22:15 +0100)
committerCatalin Marinas <catalin.marinas@gmail.com>
Fri, 7 Oct 2005 21:15:38 +0000 (22:15 +0100)
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>
stgit/git.py

index de8d47f9f196a69f443648e556f76c53c3de6a77..df3adad14dea8a098e6b7ac67687ea3766c03109 100644 (file)
@@ -236,6 +236,9 @@ def get_head_file():
 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