def METHOD_NAME(repo):
    remote_master = repo.branches.remote['origin/master']
    master = repo.branches.create('master',
                                       repo[remote_master.target.hex])
    master.upstream = remote_master
    assert master.upstream_name == 'refs/remotes/origin/master'