diff options
author | Mike Frysinger <vapier@google.com> | 2020-02-19 15:50:00 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@google.com> | 2020-02-19 23:44:10 +0000 |
commit | f81c72ed7727ca408d1859a86c56b532a8de8d59 (patch) | |
tree | 9cdd3f23feed26c922528e8d1db86c3ebde03cc8 /subcmds/sync.py | |
parent | 77b4397a7376fe52fe0725ed538891c89da161ed (diff) | |
download | git-repo-f81c72ed7727ca408d1859a86c56b532a8de8d59.tar.gz |
project: set core.repositoryFormatVersion=1 when using extensions
When using extensions, make sure we set the git repo format version
so git knows to check the extension compatibility. We can add a
helper to the Project API to simplify this and make it foolproof.
Change-Id: I9ab6c32d92fe2b8e5df6e2b080ca71556332e909
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256035
Tested-by: Mike Frysinger <vapier@google.com>
Reviewed-by: Jonathan Nieder <jrn@google.com>
Diffstat (limited to 'subcmds/sync.py')
-rw-r--r-- | subcmds/sync.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py index 49867a97..eada76a7 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
@@ -576,8 +576,7 @@ later is required to fix a server side protocol bug. | |||
576 | print('%s: Shared project %s found, disabling pruning.' % | 576 | print('%s: Shared project %s found, disabling pruning.' % |
577 | (project.relpath, project.name)) | 577 | (project.relpath, project.name)) |
578 | if git_require((2, 7, 0)): | 578 | if git_require((2, 7, 0)): |
579 | project.config.SetString('core.repositoryFormatVersion', '1') | 579 | project.EnableRepositoryExtension('preciousObjects') |
580 | project.config.SetString('extensions.preciousObjects', 'true') | ||
581 | else: | 580 | else: |
582 | # This isn't perfect, but it's the best we can do with old git. | 581 | # This isn't perfect, but it's the best we can do with old git. |
583 | print('%s: WARNING: shared projects are unreliable when using old ' | 582 | print('%s: WARNING: shared projects are unreliable when using old ' |