本文整理匯總了Python中datalad.support.gitrepo.GitRepo.git_get_remote_branches方法的典型用法代碼示例。如果您正苦於以下問題:Python GitRepo.git_get_remote_branches方法的具體用法?Python GitRepo.git_get_remote_branches怎麽用?Python GitRepo.git_get_remote_branches使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類datalad.support.gitrepo.GitRepo
的用法示例。
在下文中一共展示了GitRepo.git_get_remote_branches方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: knows_annex
# 需要導入模塊: from datalad.support.gitrepo import GitRepo [as 別名]
# 或者: from datalad.support.gitrepo.GitRepo import git_get_remote_branches [as 別名]
def knows_annex(path):
"""Returns whether at a given path there is information about an annex
This includes actually present annexes, but also uninitialized ones, or
even the presence of a remote annex branch.
"""
from os.path import exists
if not exists(path):
lgr.debug("No annex: test path {0} doesn't exist".format(path))
return False
from datalad.support.gitrepo import GitRepo
repo = GitRepo(path, create=False)
return "origin/git-annex" in repo.git_get_remote_branches() \
or "git-annex" in repo.git_get_branches()