diff options
Diffstat (limited to 'lorrycontroller/gitlab.py')
-rw-r--r-- | lorrycontroller/gitlab.py | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/lorrycontroller/gitlab.py b/lorrycontroller/gitlab.py index 0b5e1c2..266861c 100644 --- a/lorrycontroller/gitlab.py +++ b/lorrycontroller/gitlab.py @@ -76,13 +76,22 @@ class GitlabDownstream(hosts.DownstreamHost): else: logging.info('Project %s exists in local GitLab already.', repo_path) - if 'head' in metadata \ - and project.default_branch != metadata['head']: - project.default_branch = metadata['head'] + if 'description' in metadata \ and project.description != metadata['description']: project.description = metadata['description'] project.save() + + # This will fail if we haven't created the branch yet. + # We'll fix it next time round. + try: + if 'head' in metadata \ + and project.default_branch != metadata['head']: + project.default_branch = metadata['head'] + project.save() + except gitlab.GitlabUpdateError: + pass + return path_comps = repo_path.split('/') |