本文整理汇总了Python中datalad.support.gitrepo.GitRepo.git_get_branches方法的典型用法代码示例。如果您正苦于以下问题:Python GitRepo.git_get_branches方法的具体用法?Python GitRepo.git_get_branches怎么用?Python GitRepo.git_get_branches使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类datalad.support.gitrepo.GitRepo
的用法示例。
在下文中一共展示了GitRepo.git_get_branches方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: knows_annex
# 需要导入模块: from datalad.support.gitrepo import GitRepo [as 别名]
# 或者: from datalad.support.gitrepo.GitRepo import git_get_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()