Clean out repo hash cache files when doing a clone
authorKalle Vahlman <kalle.vahlman@movial.com>
Mon, 8 Jun 2009 05:26:33 +0000 (08:26 +0300)
committerKalle Vahlman <kalle.vahlman@movial.com>
Mon, 8 Jun 2009 05:26:44 +0000 (08:26 +0300)
matrix/repositories.py

index 12da600..64ad4c8 100644 (file)
@@ -113,6 +113,12 @@ class Repository(object):
 
                git.checkout(self.path, branch)
 
+               # Make sure we don't leave stale cache files
+               if os.path.exists(self.path + "/.matrix_repo_url_branch"):
+                       os.unlink(self.path + "/.matrix_repo_url_branch")
+               if os.path.exists(self.path + "/.matrix_repo_hash"):
+                       os.unlink(self.path + "/.matrix_repo_hash")
+
        def fetch_hash(self, update=False):
                if config.debug:
                        print 'Fetching hash', self