diff --git a/rhodecode/lib/vcs/nodes.py b/rhodecode/lib/vcs/nodes.py --- a/rhodecode/lib/vcs/nodes.py +++ b/rhodecode/lib/vcs/nodes.py @@ -276,16 +276,20 @@ class FileNode(Node): mode = self._mode return mode + def _get_content(self): + if self.changeset: + content = self.changeset.get_file_content(self.path) + else: + content = self._content + return content + @property def content(self): """ Returns lazily content of the FileNode. If possible, would try to decode content from UTF-8. """ - if self.changeset: - content = self.changeset.get_file_content(self.path) - else: - content = self._content + content = self._get_content() if bool(content and '\0' in content): return content @@ -406,7 +410,7 @@ class FileNode(Node): """ Returns True if file has binary content. """ - _bin = '\0' in self.content + _bin = '\0' in self._get_content() return _bin @LazyProperty