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
96197154
Commit
96197154
authored
Mar 10, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce
parents
828519ba
14753c2e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
47 additions
and
4 deletions
+47
-4
imports_controller.rb
app/controllers/projects/imports_controller.rb
+1
-1
repository.rb
app/models/repository.rb
+2
-1
_profile.html.haml
app/views/users/_profile.html.haml
+1
-1
Dockerfile
docker/Dockerfile
+1
-1
repository_spec.rb
spec/models/repository_spec.rb
+23
-0
repo_helpers.rb
spec/support/repo_helpers.rb
+19
-0
No files found.
app/controllers/projects/imports_controller.rb
View file @
96197154
...
...
@@ -37,7 +37,7 @@ class Projects::ImportsController < Projects::ApplicationController
private
def
require_no_repo
if
@project
.
repository_exists?
if
@project
.
repository_exists?
&&
!
@project
.
import_in_progress?
redirect_to
(
namespace_project_path
(
@project
.
namespace
,
@project
))
and
return
end
end
...
...
app/models/repository.rb
View file @
96197154
...
...
@@ -146,7 +146,8 @@ class Repository
end
def
timestamps_by_user_log
(
user
)
args
=
%W(git log --author=
#{
user
.
email
}
--since=
#{
(
Date
.
today
-
1
.
year
).
to_s
}
--branches --pretty=format:%cd --date=short)
author_emails
=
'('
+
user
.
all_emails
.
map
{
|
e
|
Regexp
.
escape
(
e
)
}.
join
(
'|'
)
+
')'
args
=
%W(git log -E --author=
#{
author_emails
}
--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?
...
...
app/views/users/_profile.html.haml
View file @
96197154
...
...
@@ -12,7 +12,7 @@
-
unless
user
.
linkedin
.
blank?
%li
%span
.light
LinkedIn:
%strong
=
user
.
linkedin
%strong
=
link_to
user
.
linkedin
,
"http://www.linkedin.com/in/
#{
user
.
linkedin
}
"
-
unless
user
.
twitter
.
blank?
%li
%span
.light
Twitter:
...
...
docker/Dockerfile
View file @
96197154
...
...
@@ -11,7 +11,7 @@ RUN apt-get update -q \
# If the Omnibus package version below is outdated please contribute a merge request to update it.
# If you run GitLab Enterprise Edition point it to a location where you have downloaded it.
RUN
TMP_FILE
=
$(
mktemp
)
;
\
wget
-q
-O
$TMP_FILE
https://downloads-packages.s3.amazonaws.com/ubuntu-14.04/gitlab_7.8.
1
-omnibus-1_amd64.deb
\
wget
-q
-O
$TMP_FILE
https://downloads-packages.s3.amazonaws.com/ubuntu-14.04/gitlab_7.8.
3
-omnibus-1_amd64.deb
\
&&
dpkg
-i
$TMP_FILE
\
&&
rm
-f
$TMP_FILE
...
...
spec/models/repository_spec.rb
View file @
96197154
...
...
@@ -18,4 +18,27 @@ describe Repository do
it
{
is_expected
.
to
eq
(
'c1acaa58bbcbc3eafe538cb8274ba387047b69f8'
)
}
end
context
:timestamps_by_user_log
do
before
do
Date
.
stub
(
:today
).
and_return
(
Date
.
new
(
2015
,
03
,
01
))
end
describe
'single e-mail for user'
do
let
(
:user
)
{
create
(
:user
,
email:
sample_commit
.
author_email
)
}
subject
{
repository
.
timestamps_by_user_log
(
user
)
}
it
{
is_expected
.
to
eq
([
"2014-08-06"
,
"2014-07-31"
,
"2014-07-31"
])
}
end
describe
'multiple emails for user'
do
let
(
:email_alias
)
{
create
(
:email
,
email:
another_sample_commit
.
author_email
)
}
let
(
:user
)
{
create
(
:user
,
email:
sample_commit
.
author_email
,
emails:
[
email_alias
])
}
subject
{
repository
.
timestamps_by_user_log
(
user
)
}
it
{
is_expected
.
to
eq
([
"2015-01-10"
,
"2014-08-06"
,
"2014-07-31"
,
"2014-07-31"
])
}
end
end
end
spec/support/repo_helpers.rb
View file @
96197154
...
...
@@ -43,6 +43,25 @@ eos
)
end
def
another_sample_commit
OpenStruct
.
new
(
id:
"e56497bb5f03a90a51293fc6d516788730953899"
,
parent_id:
'4cd80ccab63c82b4bad16faa5193fbd2aa06df40'
,
author_full_name:
"Sytse Sijbrandij"
,
author_email:
"sytse@gitlab.com"
,
files_changed_count:
1
,
message:
<<
eos
Add directory structure for tree_helper spec
This directory structure is needed for a testing the method flatten_tree(tree) in the TreeHelper module
See [merge request #275](https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/275#note_732774)
See merge request !2
eos
)
end
def
sample_big_commit
OpenStruct
.
new
(
id:
"913c66a37b4a45b9769037c55c2d238bd0942d2e"
,
...
...
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