BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
5f9d90e2
Commit
5f9d90e2
authored
Jan 21, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5958 from brunoga/go-repository-fetch
Added support for Go's repository retrieval.
parents
afd29993
e77694bf
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
0 deletions
+14
-0
project.rb
app/models/project.rb
+4
-0
_head.html.haml
app/views/layouts/_head.html.haml
+5
-0
project_spec.rb
spec/models/project_spec.rb
+5
-0
No files found.
app/models/project.rb
View file @
5f9d90e2
...
...
@@ -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
...
...
app/views/layouts/_head.html.haml
View file @
5f9d90e2
...
...
@@ -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"
}
spec/models/project_spec.rb
View file @
5f9d90e2
...
...
@@ -99,6 +99,11 @@ describe Project do
project
.
web_url
.
should
==
"
#{
Gitlab
.
config
.
gitlab
.
url
}
/somewhere"
end
it
"returns the web URL without the protocol for this repo"
do
project
=
Project
.
new
(
path:
"somewhere"
)
project
.
web_url_without_protocol
.
should
==
"
#{
Gitlab
.
config
.
gitlab
.
host
}
/somewhere"
end
describe
"last_activity methods"
do
let
(
:project
)
{
create
(
:project
)
}
let
(
:last_event
)
{
double
(
created_at:
Time
.
now
)
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment