summaryrefslogtreecommitdiff
path: root/lorrycontroller/local.py
diff options
context:
space:
mode:
Diffstat (limited to 'lorrycontroller/local.py')
-rw-r--r--lorrycontroller/local.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/lorrycontroller/local.py b/lorrycontroller/local.py
index 15a4048..d55214d 100644
--- a/lorrycontroller/local.py
+++ b/lorrycontroller/local.py
@@ -15,6 +15,7 @@
import logging
import os
+import os.path
import cliapp
@@ -45,4 +46,11 @@ class LocalDownstream(hosts.DownstreamHost):
# whether the repository already exists
os.makedirs(repo_path, exist_ok=True)
cliapp.runcmd(['git', 'init', '--bare', repo_path])
- # TODO: set metadata
+
+ if 'head' in metadata:
+ cliapp.runcmd(['git', '--git-dir', repo_path,
+ 'symbolic-ref', 'HEAD',
+ 'refs/heads/' + metadata['head']])
+ if 'description' in metadata:
+ with open(os.path.join(repo_path, 'description'), 'w') as f:
+ print(metadata['description'], file=f)