summaryrefslogtreecommitdiff
path: root/lorry
diff options
context:
space:
mode:
authorBen Hutchings <ben.hutchings@codethink.co.uk>2020-09-15 21:05:47 +0100
committerBen Hutchings <ben.hutchings@codethink.co.uk>2020-09-15 21:31:40 +0100
commit7f1d7cffb1bf269f819689a88fda44efb45128eb (patch)
tree4ee9b620904b0f2119a6002ab8e4de9462a9ccc1 /lorry
parent3aa9bf85c228c5ace76c611af8654c3926934f62 (diff)
downloadlorry-7f1d7cffb1bf269f819689a88fda44efb45128eb.tar.gz
lorry: Set migrated working repositories to be bare
Since commit 50383f3bcce7 "lorry: Crash-proof updates to working git repos with A/B switching", prepare_working_repos assumes that the existing working repositories are bare. migrate_oldstyle_repos did not ensure that, although it did discard any working tree. Run "git config" to set the core.bare and core.logallrefupdates flags appropriately.
Diffstat (limited to 'lorry')
-rwxr-xr-xlorry7
1 files changed, 7 insertions, 0 deletions
diff --git a/lorry b/lorry
index e37261c..279a175 100755
--- a/lorry
+++ b/lorry
@@ -423,6 +423,13 @@ class Lorry(cliapp.Application):
if not os.path.exists(old_gitdir):
old_gitdir = old_repo
+ # Ensure that it's bare
+ self.run_program(['git', 'config', 'core.bare', 'true'],
+ cwd=old_gitdir)
+ self.run_program(['git', 'config', 'core.logallrefupdates',
+ 'false'],
+ cwd=old_gitdir)
+
self.write_update_count(old_gitdir, 1)
# Move it to new name, and remove top-level directory if we