summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-01-21 02:27:21 -0800
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2014-01-21 02:27:21 -0800
commit5f9d90e2186c373d336794fa336496652a638366 (patch)
treed63882f251e040a19179f77b90562d90bc4bac35 /app
parentafd2999373fe1a6bdc611ab4a14e3e81d2f7350d (diff)
parente77694bff3e0867f226be28108b814895d32d354 (diff)
downloadgitlab-ce-5f9d90e2186c373d336794fa336496652a638366.tar.gz
Merge pull request #5958 from brunoga/go-repository-fetch
Added support for Go's repository retrieval.
Diffstat (limited to 'app')
-rw-r--r--app/models/project.rb4
-rw-r--r--app/views/layouts/_head.html.haml5
2 files changed, 9 insertions, 0 deletions
diff --git a/app/models/project.rb b/app/models/project.rb
index 30faaf00fff..da5f25f3cbc 100644
--- a/app/models/project.rb
+++ b/app/models/project.rb
@@ -205,6 +205,10 @@ class Project < ActiveRecord::Base
[Gitlab.config.gitlab.url, path_with_namespace].join("/")
end
+ def web_url_without_protocol
+ web_url.split("://")[1]
+ end
+
def build_commit_note(commit)
notes.new(commit_id: commit.id, noteable_type: "Commit")
end
diff --git a/app/views/layouts/_head.html.haml b/app/views/layouts/_head.html.haml
index 68146e661eb..5723250151a 100644
--- a/app/views/layouts/_head.html.haml
+++ b/app/views/layouts/_head.html.haml
@@ -22,3 +22,8 @@
= auto_discovery_link_tag(:atom, project_commits_url(@project, @ref, format: :atom, private_token: current_user.private_token), title: "Recent commits to #{@project.name}:#{@ref}")
- if current_controller?(:issues)
= auto_discovery_link_tag(:atom, project_issues_url(@project, :atom, private_token: current_user.private_token), title: "#{@project.name} issues")
+
+ -# Go repository retrieval support.
+ - if controller_name == 'projects' && action_name == 'show'
+ %meta{name: "go-import", content: "#{@project.web_url_without_protocol} git #{@project.web_url}.git"}
+