try:
repo = RpmGitRepository(workdir)
- except GitRepositoryError:
- msger.error("%s is not a git repository" % (workdir))
+ if repo.get_branch() is None:
+ msger.error('currently not on a branch')
+ except GitRepositoryError, err:
+ msger.error(str(err))
workdir = repo.path
try:
repo = RpmGitRepository('.')
- except GitRepositoryError:
- msger.error("No git repository found.")
+ if repo.get_branch() is None:
+ msger.error('currently not on a branch')
+ except GitRepositoryError, err:
+ msger.error(str(err))
project_root_dir = repo.path
try:
repo = RpmGitRepository(workdir)
- except GitRepositoryError:
- msger.error("%s is not a git repository" % (workdir))
+ if repo.get_branch() is None:
+ msger.error('currently not on a branch')
+ except GitRepositoryError, err:
+ msger.error(str(err))
workdir = repo.path
try:
repo = RpmGitRepository(workdir)
- except GitRepositoryError:
- msger.error('%s is not a git dir' % workdir)
+ if repo.get_branch() is None:
+ msger.error('currently not on a branch')
+ except GitRepositoryError, err:
+ msger.error(str(err))
workdir = repo.path