summaryrefslogtreecommitdiffstats
path: root/git_command.py
diff options
context:
space:
mode:
Diffstat (limited to 'git_command.py')
-rw-r--r--git_command.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/git_command.py b/git_command.py
index 56e18e02..01b9ecb3 100644
--- a/git_command.py
+++ b/git_command.py
@@ -207,10 +207,12 @@ class GitCommand(object):
207 if objdir: 207 if objdir:
208 # Set to the place we want to save the objects. 208 # Set to the place we want to save the objects.
209 env['GIT_OBJECT_DIRECTORY'] = objdir 209 env['GIT_OBJECT_DIRECTORY'] = objdir
210 if gitdir: 210
211 alt_objects = os.path.join(gitdir, 'objects') if gitdir else None
212 if alt_objects and os.path.realpath(alt_objects) != os.path.realpath(objdir):
211 # Allow git to search the original place in case of local or unique refs 213 # Allow git to search the original place in case of local or unique refs
212 # that git will attempt to resolve even if we aren't fetching them. 214 # that git will attempt to resolve even if we aren't fetching them.
213 env['GIT_ALTERNATE_OBJECT_DIRECTORIES'] = gitdir + '/objects' 215 env['GIT_ALTERNATE_OBJECT_DIRECTORIES'] = alt_objects
214 216
215 command = [GIT] 217 command = [GIT]
216 if bare: 218 if bare: