def remote_branch_exists(remote: Remote, branch: Branch) -> bool: """ Returns True if branch exists on the remote. """ response = sys_calls.get_stdout( ["git", "ls-remote", "--heads", remote, branch]) return branch in response
def is_logged_in() -> bool: """ Returns true if logged in through CLI to Heroku. """ auth = sys_calls.get_stdout(["heroku", "auth:whoami"]) return "not logged in" not in auth
def is_logged_in() -> bool: """ Returns true if logged in through CLI to Heroku. """ auth = sys_calls.get_stdout(['heroku', 'auth:whoami']) return 'not logged in' not in auth
def is_remote_added(remote: Remote) -> bool: """ Returns true if remote is linked to on local machine. """ remotes = sys_calls.get_stdout(["git", "remote"]) return remote in remotes
def get_file_hash(file: str) -> str: """ Checks HEAD for the hash of given file. Allows for comparisons if file has changed. """ return sys_calls.get_stdout(["git", "rev-parse", f"HEAD:{file}"])
def get_current_branch() -> Branch: """ Finds current git branch. """ return sys_calls.get_stdout(["git", "rev-parse", "--abbrev-ref", "HEAD"])
def get_file_hash(file: str) -> str: """ Checks HEAD for the hash of given file. Allows for comparisons if file has changed. """ return sys_calls.get_stdout(['git', 'rev-parse', f'HEAD:{file}'])
def get_current_branch() -> Branch: """ Finds current git branch. """ return sys_calls.get_stdout(['git', 'rev-parse', '--abbrev-ref', 'HEAD'])