def checkout(self, check: bool = True, track: bool = False) -> None: current_branch = GitOffline.current_branch(self.path) if current_branch == self.name: CONSOLE.stdout( f' - Branch {Format.Git.ref(self.short_ref)} already checked out' ) return CONSOLE.stdout(f' - Checkout branch {Format.Git.ref(self.short_ref)}') super().checkout(check=check, track=track)
def current_branch(self) -> str: return GitOffline.current_branch(self.path)
def is_checked_out(self) -> bool: current_branch = GitOffline.current_branch(self.path) return current_branch == self.name