diff --git a/rhodecode/controllers/files.py b/rhodecode/controllers/files.py
--- a/rhodecode/controllers/files.py
+++ b/rhodecode/controllers/files.py
@@ -241,7 +241,11 @@ class FilesController(BaseRepoController
c.on_branch_head = self._is_valid_head(
commit_id, c.rhodecode_repo)
- c.branch_or_raw_id = c.commit.branch or c.commit.raw_id
+
+ branch = c.commit.branch if (
+ c.commit.branch and '/' not in c.commit.branch) else None
+ c.branch_or_raw_id = branch or c.commit.raw_id
+ c.branch_name = c.commit.branch or h.short_id(c.commit.raw_id)
author = c.file_last_commit.author
c.authors = [(h.email(author),
diff --git a/rhodecode/templates/files/files_source.mako b/rhodecode/templates/files/files_source.mako
--- a/rhodecode/templates/files/files_source.mako
+++ b/rhodecode/templates/files/files_source.mako
@@ -40,7 +40,7 @@
|
%if c.on_branch_head and c.branch_or_raw_id and not c.file.is_binary:
- ${_('Edit on Branch:%s') % c.branch_or_raw_id}
+ ${_('Edit on Branch:%s') % c.branch_name}
| ${_('Delete')}