def sync_branch(self, branch): """Sync clowder repo to specified branch""" try: repo = Repo(self.clowder_path) except: repo_path_output = colored(self.clowder_path, 'cyan') print("Failed to create Repo instance for " + repo_path_output) else: if git_is_detached(self.clowder_path): try: repo.git.checkout(branch) except: print("Failed to checkout branch " + branch) print_exiting() if repo.active_branch.name != branch: try: repo.git.checkout(branch) except: print("Failed to checkout branch " + branch) print_exiting() self._validate() self.print_status() git_pull(self.clowder_path) self.symlink_yaml()
def sync(self): """Sync clowder repo""" self._validate() self.print_status() if not git_is_detached(self.clowder_path): git_pull(self.clowder_path) self.symlink_yaml() else: print(' - HEAD is detached') print_exiting()
def pull(self): """Pull clowder repo upstream changes""" git_pull(self.clowder_path)