diff --git a/portia_server/storage/backends.py b/portia_server/storage/backends.py index cf9c95332..3512d1a8f 100644 --- a/portia_server/storage/backends.py +++ b/portia_server/storage/backends.py @@ -196,7 +196,7 @@ def __init__(self, name, author=None): self.author = author repo = Repoman.open_repo(name, author) self.repo = repo - self.branch = branch = (author and author.username) or DEFAULT_USER + self.branch = branch = (author and author.username) or 'master' self.checkout(branch=branch) self.init_project() @@ -204,8 +204,9 @@ def checkout(self, commit=None, branch=None, retry=True): if commit is not None and isinstance(commit, string_types): commit = self.repo._repo.get_object(commit) if not commit: - branches = OrderedDict((('refs/heads/%s' % branch or 'master', 1), - ('refs/heads/master', 1))) + branches = OrderedDict.fromkeys(( + 'refs/heads/{}'.format(branch or 'master'), + 'refs/heads/master')) for ref in branches: try: _commit_id = self.repo._repo.refs[ref]