Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
e6a0fb1f
Commit
e6a0fb1f
authored
Mar 03, 2015
by
Marin Jankovski
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce
parents
4697daf7
c1fc29e1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
19 additions
and
1 deletion
+19
-1
CHANGELOG
CHANGELOG
+1
-0
app/models/repository.rb
app/models/repository.rb
+1
-1
lib/gitlab/url_builder.rb
lib/gitlab/url_builder.rb
+9
-0
spec/lib/gitlab/url_builder_spec.rb
spec/lib/gitlab/url_builder_spec.rb
+8
-0
No files found.
CHANGELOG
View file @
e6a0fb1f
Please view this file on the master branch, on stable branches it's out of date.
v 7.9.0 (unreleased)
- Fix merge request URL passed to Webhooks. (Stan Hu)
- Move labels/milestones tabs to sidebar
- Upgrade Rails gem to version 4.1.9.
- Improve error messages for file edit failures
...
...
app/models/repository.rb
View file @
e6a0fb1f
...
...
@@ -146,7 +146,7 @@ class Repository
end
def
timestamps_by_user_log
(
user
)
args
=
%W(git log --author=
#{
user
.
email
}
--since=
#{
(
Date
.
today
-
1
.
year
).
to_s
}
--pretty=format:%cd --date=short)
args
=
%W(git log --author=
#{
user
.
email
}
--since=
#{
(
Date
.
today
-
1
.
year
).
to_s
}
--
branches --
pretty=format:%cd --date=short)
dates
=
Gitlab
::
Popen
.
popen
(
args
,
path_to_repo
).
first
.
split
(
"
\n
"
)
if
dates
.
present?
...
...
lib/gitlab/url_builder.rb
View file @
e6a0fb1f
...
...
@@ -10,6 +10,8 @@ module Gitlab
case
@type
when
:issue
issue_url
(
id
)
when
:merge_request
merge_request_url
(
id
)
end
end
...
...
@@ -22,5 +24,12 @@ module Gitlab
project_id:
issue
.
project
,
host:
Gitlab
.
config
.
gitlab
[
'url'
])
end
def
merge_request_url
(
id
)
merge_request
=
MergeRequest
.
find
(
id
)
project_merge_request_url
(
id:
merge_request
.
id
,
project_id:
merge_request
.
project
,
host:
Gitlab
.
config
.
gitlab
[
'url'
])
end
end
end
spec/lib/gitlab/url_builder_spec.rb
View file @
e6a0fb1f
...
...
@@ -8,4 +8,12 @@ describe Gitlab::UrlBuilder do
expect
(
url
).
to
eq
"
#{
Settings
.
gitlab
[
'url'
]
}
/
#{
issue
.
project
.
path_with_namespace
}
/issues/
#{
issue
.
iid
}
"
end
end
describe
'When asking for an merge request'
do
it
'returns the merge request url'
do
merge_request
=
create
(
:merge_request
)
url
=
Gitlab
::
UrlBuilder
.
new
(
:merge_request
).
build
(
merge_request
.
id
)
expect
(
url
).
to
eq
"
#{
Settings
.
gitlab
[
'url'
]
}
/
#{
merge_request
.
project
.
to_param
}
/merge_requests/
#{
merge_request
.
id
}
"
end
end
end
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