"""
def __init__(self, path):
- self.path = os.path.abspath(path)
+ self._path = os.path.abspath(path)
try:
out, ret = self.__git_getoutput('rev-parse', ['--show-cdup'])
if ret or out != ['\n']:
"""
GitCommand(command, args, extra_env=extra_env, cwd=self.path)()
+ @property
+ def path(self):
+ return self._path
+
+ @property
def base_dir(self):
"""
Get the base of the repository.
-
- @return: The base of the git repository
- @rtype: string.
"""
return os.path.join(self.path, '.git')
args += [ commit ] if commit else []
self._git_command("tag", args)
+ @property
+ def branch(self):
+ """The currently checked out branch"""
+ return self.get_branch()
+
def get_branch(self):
"""on what branch is the current working copy"""
for line in self.__git_getoutput('branch', [ '--no-color' ])[0]:
if options.prebuild:
RunAtCommand(options.prebuild, shell=True,
- extra_env={'GBP_GIT_DIR': repo.base_dir(),
+ extra_env={'GBP_GIT_DIR': repo.base_dir,
'GBP_BUILD_DIR': build_dir})(dir=build_dir)
setup_pbuilder(options)