Пример #1
0
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
Пример #2
0
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
Пример #3
0
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
Пример #4
0
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
Пример #5
0
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}"])
Пример #6
0
def get_current_branch() -> Branch:
    """
    Finds current git branch.
    """
    return sys_calls.get_stdout(["git", "rev-parse", "--abbrev-ref", "HEAD"])
Пример #7
0
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}'])
Пример #8
0
def get_current_branch() -> Branch:
    """
    Finds current git branch.
    """
    return sys_calls.get_stdout(['git', 'rev-parse', '--abbrev-ref', 'HEAD'])