summaryrefslogtreecommitdiff
path: root/app/helpers
diff options
context:
space:
mode:
authorMarin Jankovski <marin@gitlab.com>2014-07-09 10:12:02 +0200
committerMarin Jankovski <marin@gitlab.com>2014-07-09 10:12:09 +0200
commit91e01275cb7c63e8f101c016d83f725d0e7e6cb9 (patch)
tree48efe0aec7b09ea58de11fed86aa08b647de60e6 /app/helpers
parent6b121aa5a7d2a02bf758c13cb9b5ef9845700b08 (diff)
downloadgitlab-ce-91e01275cb7c63e8f101c016d83f725d0e7e6cb9.tar.gz
Add tests to check for correct browse link name.
Diffstat (limited to 'app/helpers')
-rw-r--r--app/helpers/commits_helper.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb
index 9643a0a965c..7100d679358 100644
--- a/app/helpers/commits_helper.rb
+++ b/app/helpers/commits_helper.rb
@@ -183,13 +183,12 @@ module CommitsHelper
def link_to_browse_code(project, commit)
if current_controller?(:projects, :commits)
if @repo.blob_at(commit.id, @path)
- link_to "Browse File »", project_blob_path(project, tree_join(commit.id, @path)), class: "pull-right"
- else
- link_to "Browse Dir »", project_tree_path(project, tree_join(commit.id, @path)), class: "pull-right"
+ return link_to "Browse File »", project_blob_path(project, tree_join(commit.id, @path)), class: "pull-right"
+ elsif @path.present?
+ return link_to "Browse Dir »", project_tree_path(project, tree_join(commit.id, @path)), class: "pull-right"
end
- else
- link_to "Browse Code »", project_tree_path(project, commit), class: "pull-right"
end
+ link_to "Browse Code »", project_tree_path(project, commit), class: "pull-right"
end
protected