diff --git a/rhodecode/api/views/repo_api.py b/rhodecode/api/views/repo_api.py --- a/rhodecode/api/views/repo_api.py +++ b/rhodecode/api/views/repo_api.py @@ -340,11 +340,7 @@ def get_repo_changeset(request, apiuser, _cs_json = cs.__json__() _cs_json['diff'] = build_commit_data(cs, changes_details) if changes_details == 'full': - _cs_json['refs'] = { - 'branches': [cs.branch], - 'bookmarks': getattr(cs, 'bookmarks', []), - 'tags': cs.tags - } + _cs_json['refs'] = cs._get_refs() return _cs_json diff --git a/rhodecode/lib/vcs/backends/base.py b/rhodecode/lib/vcs/backends/base.py --- a/rhodecode/lib/vcs/backends/base.py +++ b/rhodecode/lib/vcs/backends/base.py @@ -708,6 +708,13 @@ class BaseCommit(object): 'branch': self.branch } + def _get_refs(self): + return { + 'branches': [self.branch], + 'bookmarks': getattr(self, 'bookmarks', []), + 'tags': self.tags + } + @LazyProperty def last(self): """