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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
aa0d6581
Commit
aa0d6581
authored
Aug 18, 2015
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ee
parents
9cde642a
00b9c9e9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
lib/gitlab/git_access.rb
lib/gitlab/git_access.rb
+6
-6
No files found.
lib/gitlab/git_access.rb
View file @
aa0d6581
...
@@ -197,29 +197,29 @@ module Gitlab
...
@@ -197,29 +197,29 @@ module Gitlab
commits
.
each
do
|
commit
|
commits
.
each
do
|
commit
|
if
git_hook
.
commit_message_regex
.
present?
if
git_hook
.
commit_message_regex
.
present?
unless
commit
.
safe_message
=~
Regexp
.
new
(
git_hook
.
commit_message_regex
)
unless
commit
.
safe_message
=~
Regexp
.
new
(
git_hook
.
commit_message_regex
)
return
build_status_object
(
false
,
"Commit message does not follow the pattern"
)
return
build_status_object
(
false
,
"Commit message does not follow the pattern
'
#{
git_hook
.
commit_message_regex
}
'
"
)
end
end
end
end
if
git_hook
.
author_email_regex
.
present?
if
git_hook
.
author_email_regex
.
present?
unless
commit
.
committer_email
=~
Regexp
.
new
(
git_hook
.
author_email_regex
)
unless
commit
.
committer_email
=~
Regexp
.
new
(
git_hook
.
author_email_regex
)
return
build_status_object
(
false
,
"Commit
er's email does not follow the pattern
"
)
return
build_status_object
(
false
,
"Commit
ter's email '
#{
commit
.
committer_email
}
' does not follow the pattern '
#{
git_hook
.
author_email_regex
}
'
"
)
end
end
unless
commit
.
author_email
=~
Regexp
.
new
(
git_hook
.
author_email_regex
)
unless
commit
.
author_email
=~
Regexp
.
new
(
git_hook
.
author_email_regex
)
return
build_status_object
(
false
,
"Author's email
does not follow the pattern
"
)
return
build_status_object
(
false
,
"Author's email
'
#{
commit
.
author_email
}
' does not follow the pattern '
#{
git_hook
.
author_email_regex
}
'
"
)
end
end
end
end
# Check whether author is a GitLab member
# Check whether author is a GitLab member
if
git_hook
.
member_check
if
git_hook
.
member_check
unless
User
.
existing_member?
(
commit
.
author_email
)
unless
User
.
existing_member?
(
commit
.
author_email
)
return
build_status_object
(
false
,
"Author is not a member of team"
)
return
build_status_object
(
false
,
"Author
'
#{
commit
.
author_email
}
'
is not a member of team"
)
end
end
if
commit
.
author_email
!=
commit
.
committer_email
if
commit
.
author_email
!=
commit
.
committer_email
unless
User
.
existing_member?
(
commit
.
committer_email
)
unless
User
.
existing_member?
(
commit
.
committer_email
)
return
build_status_object
(
false
,
"Commit
er
is not a member of team"
)
return
build_status_object
(
false
,
"Commit
ter '
#{
commit
.
committer_email
}
'
is not a member of team"
)
end
end
end
end
end
end
...
@@ -227,7 +227,7 @@ module Gitlab
...
@@ -227,7 +227,7 @@ module Gitlab
if
git_hook
.
file_name_regex
.
present?
if
git_hook
.
file_name_regex
.
present?
commit
.
diffs
.
each
do
|
diff
|
commit
.
diffs
.
each
do
|
diff
|
if
(
diff
.
renamed_file
||
diff
.
new_file
)
&&
diff
.
new_path
=~
Regexp
.
new
(
git_hook
.
file_name_regex
)
if
(
diff
.
renamed_file
||
diff
.
new_file
)
&&
diff
.
new_path
=~
Regexp
.
new
(
git_hook
.
file_name_regex
)
return
build_status_object
(
false
,
"File name
#{
diff
.
new_path
.
inspect
}
does not follow the pattern"
)
return
build_status_object
(
false
,
"File name
#{
diff
.
new_path
.
inspect
}
does not follow the pattern
'
#{
git_hook
.
file_name_regex
}
'
"
)
end
end
end
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