termie / git-bzr-ng

bi-directional git to bzr bridge: never fear bzr again
BSD 3-Clause "New" or "Revised" License
198 stars 47 forks source link

git bare repo not supported #52

Open glensc opened 11 years ago

glensc commented 11 years ago

seems git-bzr can't work well with bare repos, because it assumes root_dir = parent dir of git dir, which is not true for bare repos

def git_dir(self, path=None):
  if not self._git_dir:
    self._git_dir = os.path.abspath(git(['rev-parse', '--git-dir']).strip())
  if path:
    return os.path.join(self._git_dir, path)
  return self._git_dir

def root_dir(self, path=None):
  if not self._root_dir:
    self._root_dir = os.path.dirname(self.git_dir())
  if path:
    return os.path.join(self._root_dir, path)
  return self._root_dir