Added GIT_BRANCH_ALL

This commit is contained in:
Tamir Bahar 2017-04-19 21:10:11 +03:00
parent d6716e035a
commit 320ee5e733
2 changed files with 4 additions and 3 deletions

View File

@ -45,7 +45,7 @@ from _pygit2 import Repository as _Repository, init_file_backend
from _pygit2 import Oid, GIT_OID_HEXSZ, GIT_OID_MINPREFIXLEN
from _pygit2 import GIT_CHECKOUT_SAFE, GIT_CHECKOUT_RECREATE_MISSING, GIT_DIFF_NORMAL
from _pygit2 import GIT_FILEMODE_LINK
from _pygit2 import GIT_BRANCH_LOCAL, GIT_BRANCH_REMOTE
from _pygit2 import GIT_BRANCH_LOCAL, GIT_BRANCH_REMOTE, GIT_BRANCH_ALL
from _pygit2 import Reference, Tree, Commit, Blob, Signature
from .config import Config
@ -999,11 +999,11 @@ class BaseRepository(_Repository):
class Branches(object):
def __init__(self, repository, flag=GIT_BRANCH_LOCAL | GIT_BRANCH_REMOTE):
def __init__(self, repository, flag=GIT_BRANCH_ALL):
self._repository = repository
self._flag = flag
if flag == GIT_BRANCH_LOCAL | GIT_BRANCH_REMOTE:
if flag == GIT_BRANCH_ALL:
self.local = Branches(repository, flag=GIT_BRANCH_LOCAL)
self.remote = Branches(repository, flag=GIT_BRANCH_REMOTE)

View File

@ -303,6 +303,7 @@ moduleinit(PyObject* m)
ADD_TYPE(m, Branch)
ADD_CONSTANT_INT(m, GIT_BRANCH_LOCAL)
ADD_CONSTANT_INT(m, GIT_BRANCH_REMOTE)
ADD_CONSTANT_INT(m, GIT_BRANCH_ALL)
/*
* Index & Working copy