本文整理匯總了Python中datalad.support.gitrepo.GitRepo.get_remote_branches方法的典型用法代碼示例。如果您正苦於以下問題:Python GitRepo.get_remote_branches方法的具體用法?Python GitRepo.get_remote_branches怎麽用?Python GitRepo.get_remote_branches使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類datalad.support.gitrepo.GitRepo
的用法示例。
在下文中一共展示了GitRepo.get_remote_branches方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_GitRepo_ssh_fetch
# 需要導入模塊: from datalad.support.gitrepo import GitRepo [as 別名]
# 或者: from datalad.support.gitrepo.GitRepo import get_remote_branches [as 別名]
def test_GitRepo_ssh_fetch(remote_path, repo_path):
from datalad import ssh_manager
remote_repo = GitRepo(remote_path, create=False)
url = "ssh://localhost" + op.abspath(remote_path)
socket_path = op.join(ssh_manager.socket_dir, get_connection_hash('localhost'))
repo = GitRepo(repo_path, create=True)
repo.add_remote("ssh-remote", url)
# we don't know any branches of the remote:
eq_([], repo.get_remote_branches())
fetched = repo.fetch(remote="ssh-remote")
assert_in('ssh-remote/master', [commit.name for commit in fetched])
ok_clean_git(repo)
# the connection is known to the SSH manager, since fetch() requested it:
assert_in(socket_path, ssh_manager._connections)
# and socket was created:
ok_(op.exists(socket_path))
# we actually fetched it:
assert_in('ssh-remote/master', repo.get_remote_branches())