summaryrefslogtreecommitdiff
path: root/lib/git/repo.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2010-07-01 17:58:19 +0200
committerSebastian Thiel <byronimo@gmail.com>2010-07-01 17:58:19 +0200
commitfd96cceded27d1372bdc1a851448d2d8613f60f3 (patch)
tree5b53f288a3379e260f46a65d08691fceec4a0ca3 /lib/git/repo.py
parent6917ae4ce9eaa0f5ea91592988c1ea830626ac3a (diff)
parentc3bd05b426a0e3dec8224244c3c9c0431d1ff130 (diff)
downloadgitpython-fd96cceded27d1372bdc1a851448d2d8613f60f3.tar.gz
Merge branch 'docs'
Diffstat (limited to 'lib/git/repo.py')
-rw-r--r--lib/git/repo.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/git/repo.py b/lib/git/repo.py
index 9b25653f..d9b943cd 100644
--- a/lib/git/repo.py
+++ b/lib/git/repo.py
@@ -4,7 +4,7 @@
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
-from errors import InvalidGitRepositoryError, NoSuchPathError
+from exc import InvalidGitRepositoryError, NoSuchPathError
from cmd import Git
from objects import Actor
from refs import *
@@ -669,7 +669,12 @@ class Repo(object):
path = prev_path
# END reset previous working dir
# END bad windows handling
- return Repo(path, odbt = odbt)
+
+ # our git command could have a different working dir than our actual
+ # environment, hence we prepend its working dir if required
+ if not os.path.isabs(path) and self.git.working_dir:
+ path = os.path.join(self.git._working_dir, path)
+ return Repo(os.path.abspath(path), odbt = odbt)
def archive(self, ostream, treeish=None, prefix=None, **kwargs):