raise GitRepositoryError
self.path = os.path.abspath(path)
-
def __check_path(self):
if os.getcwd() != self.path:
raise GitRepositoryError
output += popen.stdout.readlines()
return output, ret
-
def has_branch(self, branch):
"""check if the repository has branch 'branch'"""
self.__check_path()
return True
return False
-
def has_treeish(self, treeish):
"""check if the repository has the treeish object treeish"""
self.__check_path()
if line.startswith('*'):
return line.split(' ', 1)[1].strip()
-
def is_clean(self):
"""does the repository contain any uncommitted modifications"""
self.__check_path()
ret = False
return (ret, "".join(out))
-
def index_files(self):
"""List files in the index"""
out, ret = self.__git_getoutput('ls-files', ['-z'])
import doctest
doctest.testmod()
+
if __name__ == '__main__':
_test()