

def graft_branch(branch):
    'Merges branch into current branch, and deletes it.'
    repo_check()
    log = []
    try:
        msg = repo.git.execute([git, 'merge', '--no-ff', why])
        log.append(msg)
    except GitCommandError as why:
        log = repo.git.execute([git, 'merge', '--abort'])
        abort('Merge failed. Reverting.', log='{0}\n{1}'.format(why, log), type='merge')
    out = repo.git.execute([git, 'branch', '-D', branch])
    log.append(out)
    return '\n'.join(log)

dataset/ETHPy150Open kennethreitz/legit/legit/scm.py graft_branch/VarMisuse@40/69 `branch`->`why`