summaryrefslogtreecommitdiff
path: root/lib/git/repo.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/git/repo.py')
-rw-r--r--lib/git/repo.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/git/repo.py b/lib/git/repo.py
index 9b25653f..2df2cb6c 100644
--- a/lib/git/repo.py
+++ b/lib/git/repo.py
@@ -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):