# Path: gg/utils.py
# def error_out(msg, raise_abort=True):
#     click.echo(click.style(msg, fg="red"))
#     if raise_abort:
#         raise click.Abort
# 
# def info_out(msg):
#     click.echo(msg)
# 
# def success_out(msg):
#     click.echo(click.style(msg, fg="green"))
# 
# Path: gg/state.py
# def read(configfile):
#     with open(configfile, "r") as f:
#         return json.load(f)
# 
# Path: gg/main.py
# DEFAULT_CONFIGFILE = os.path.expanduser("~/.gg.json")
# class Config:
#     def __init__(self):
# def cli(config, configfile, verbose):


from gg.utils import error_out, info_out, success_out
from gg.state import read
from gg.main import cli, pass_config
        error_out(
            'Repo is "dirty". ({})'.format(
                ", ".join([repr(x.b_path) for x in repo.index.diff(None)])
            )
        )

    branch_name = active_branch.name

    origin_name = state.get("ORIGIN_NAME", "origin")
    upstream_remote = None
    for remote in repo.remotes:
        if remote.name == origin_name:
            upstream_remote = remote
            break
    if not upstream_remote:
        error_out(f"No remote called {origin_name!r} found")

    repo.heads[default_branch].checkout()
    upstream_remote.pull(repo.heads[default_branch])

    repo.git.merge(branch_name)
    repo.git.branch("-d", branch_name)
    success_out("Branch {!r} deleted.".format(branch_name))

    info_out("NOW, you might want to run:\n")
    info_out(f"git push {origin_name} {default_branch}\n\n")

    push_for_you = input("Run that push? [Y/n] ").lower().strip() != "n"
    if push_for_you:
        upstream_remote.push(default_branch)

# Path: gg/utils.py
# def error_out(msg, raise_abort=True):
#     click.echo(click.style(msg, fg="red"))
#     if raise_abort:
#         raise click.Abort
# 
# def info_out(msg):
#     click.echo(msg)
# 
# def success_out(msg):
#     click.echo(click.style(msg, fg="green"))
# 
# Path: gg/state.py
# def read(configfile):
#     with open(configfile, "r") as f:
#         return json.load(f)
# 
# Path: gg/main.py
# DEFAULT_CONFIGFILE = os.path.expanduser("~/.gg.json")
# class Config:
#     def __init__(self):
# def cli(config, configfile, verbose):


# Path: gg/builtins/merge/gg_merge.py
from gg.utils import error_out, info_out, success_out
from gg.state import read
from gg.main import cli, pass_config

        error_out(
            'Repo is "dirty". ({})'.format(
                ", ".join([repr(x.b_path) for x in repo.index.diff(None)])
            )
        )

    branch_name = active_branch.name

    origin_name = state.get("ORIGIN_NAME", "origin")
    upstream_remote = None
    for remote in repo.remotes:
        if remote.name == origin_name:
            upstream_remote = remote
            break
    if not upstream_remote:
        error_out(f"No remote called {origin_name!r} found")

    repo.heads[default_branch].checkout()
    upstream_remote.pull(repo.heads[default_branch])

    repo.git.merge(branch_name)
    repo.git.branch("-d", branch_name)
    success_out("Branch {!r} deleted.".format(branch_name))

    info_out("NOW, you might want to run:\n")
    info_out(f"git push {origin_name} {default_branch}\n\n")

    push_for_you = input("Run that push? [Y/n] ").lower().strip() != "n"
    if push_for_you:
        upstream_remote.push(default_branch)

        success_out(f"Current {default_branch} pushed to {upstream_remote.name}")