def set_indexed_commit_hash(self): """ Persists the git commit hash that the index was built on. """ current_commit_hash = lib_git.get_current_commit_hash() filepath = os.path.join(lib_repo.get_scripts_path(), '__index__', self.index_name, 'git.commit.base.txt' ) with open(filepath, 'wt') as f: f.write(current_commit_hash)
def index_based_on_current_commit(self): """ Is the index based on the current commit? """ current_commit = lib_git.get_current_commit_hash() indexed_commit = self.get_indexed_commit_hash() if indexed_commit == current_commit: return True else: return False