summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
Diffstat (limited to 'project.py')
-rw-r--r--project.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/project.py b/project.py
index 6ef7d3d3..e4682e6a 100644
--- a/project.py
+++ b/project.py
@@ -1270,7 +1270,8 @@ class Project(object):
1270 try: 1270 try:
1271 fd = open(alt) 1271 fd = open(alt)
1272 try: 1272 try:
1273 alt_dir = fd.readline().rstrip() 1273 # This works for both absolute and relative alternate directories.
1274 alt_dir = os.path.join(self.objdir, 'objects', fd.readline().rstrip())
1274 finally: 1275 finally:
1275 fd.close() 1276 fd.close()
1276 except IOError: 1277 except IOError:
@@ -2361,6 +2362,10 @@ class Project(object):
2361 ref_dir = None 2362 ref_dir = None
2362 2363
2363 if ref_dir: 2364 if ref_dir:
2365 if not os.path.isabs(ref_dir):
2366 # The alternate directory is relative to the object database.
2367 ref_dir = os.path.relpath(ref_dir,
2368 os.path.join(self.objdir, 'objects'))
2364 _lwrite(os.path.join(self.gitdir, 'objects/info/alternates'), 2369 _lwrite(os.path.join(self.gitdir, 'objects/info/alternates'),
2365 os.path.join(ref_dir, 'objects') + '\n') 2370 os.path.join(ref_dir, 'objects') + '\n')
2366 2371