From 09e0b549bcff9afdffb0ff9bd3f6f2878589f568 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Wed, 29 Jul 2020 18:17:03 +0100 Subject: local: Create repos with empty description and enabled for export 'git init' copies files into the repository from a template directory, which contains a 'replace me' description that we don't want. Provide and use our own template directory instead. While we're at it, also add the git-daemon-export-ok flag file that git-daemon and git-http-backend may check for (depending on their configuration). Closes #16. --- lorrycontroller/local.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lorrycontroller') diff --git a/lorrycontroller/local.py b/lorrycontroller/local.py index d55214d..aee87b8 100644 --- a/lorrycontroller/local.py +++ b/lorrycontroller/local.py @@ -16,6 +16,7 @@ import logging import os import os.path +import sys import cliapp @@ -45,7 +46,11 @@ class LocalDownstream(hosts.DownstreamHost): # These are idempotent, so we don't need to explicitly check # whether the repository already exists os.makedirs(repo_path, exist_ok=True) - cliapp.runcmd(['git', 'init', '--bare', repo_path]) + cliapp.runcmd( + ['git', 'init', '--bare', + '--template', + os.path.join(sys.prefix, 'share/lorry-controller/git-templates'), + repo_path]) if 'head' in metadata: cliapp.runcmd(['git', '--git-dir', repo_path, -- cgit v1.2.1