

def unpublish_branch(branch):
    'Unpublishes given branch.'
    repo_check()
    try:
        return repo.git.execute([git, 'push', remote.name, ':{0}'.format(branch)])
    except GitCommandError:
        (_, _, log) = repo.git.execute([git, 'fetch', remote.name, '--prune'], with_extended_output=True)
        abort('Unpublish failed. Fetching.', log=log, type='unpublish')

dataset/ETHPy150Open kennethreitz/legit/legit/scm.py unpublish_branch/original