summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--project.py11
-rw-r--r--subcmds/sync.py2
2 files changed, 11 insertions, 2 deletions
diff --git a/project.py b/project.py
index be53defd..7b78427d 100644
--- a/project.py
+++ b/project.py
@@ -2990,6 +2990,17 @@ class Project:
2990 self.config.SetBoolean( 2990 self.config.SetBoolean(
2991 "core.bare", True if self.manifest.IsMirror else None 2991 "core.bare", True if self.manifest.IsMirror else None
2992 ) 2992 )
2993
2994 if not init_obj_dir:
2995 # The project might be shared (obj_dir already initialized), but
2996 # such information is not available here. Instead of passing it,
2997 # set it as shared, and rely to be unset down the execution
2998 # path.
2999 if git_require((2, 7, 0)):
3000 self.EnableRepositoryExtension("preciousObjects")
3001 else:
3002 self.config.SetString("gc.pruneExpire", "never")
3003
2993 except Exception: 3004 except Exception:
2994 if init_obj_dir and os.path.exists(self.objdir): 3005 if init_obj_dir and os.path.exists(self.objdir):
2995 platform_utils.rmtree(self.objdir) 3006 platform_utils.rmtree(self.objdir)
diff --git a/subcmds/sync.py b/subcmds/sync.py
index 8460bcec..48ceb468 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -1129,8 +1129,6 @@ later is required to fix a server side protocol bug.
1129 ) 1129 )
1130 project.config.SetString("gc.pruneExpire", "never") 1130 project.config.SetString("gc.pruneExpire", "never")
1131 else: 1131 else:
1132 if not opt.quiet:
1133 print(f"\r{relpath}: not shared, disabling pruning.")
1134 project.config.SetString("extensions.preciousObjects", None) 1132 project.config.SetString("extensions.preciousObjects", None)
1135 project.config.SetString("gc.pruneExpire", None) 1133 project.config.SetString("gc.pruneExpire", None)
1136 1134