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
Boxiang Sun
gitlab-ce
Commits
af5cd10e
Commit
af5cd10e
authored
Feb 16, 2018
by
Micaël Bergeron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
applying feedback
# modified: lib/gitlab/git/commit.rb
parent
f9492554
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
app/workers/process_commit_worker.rb
app/workers/process_commit_worker.rb
+3
-3
lib/gitlab/git/commit.rb
lib/gitlab/git/commit.rb
+2
-1
spec/workers/process_commit_worker_spec.rb
spec/workers/process_commit_worker_spec.rb
+1
-1
No files found.
app/workers/process_commit_worker.rb
View file @
af5cd10e
...
...
@@ -25,14 +25,14 @@ class ProcessCommitWorker
commit
=
build_commit
(
project
,
commit_hash
)
author
=
commit
.
author
||
user
# this is a GitLab generated commit message, ignore it.
return
if
commit
.
merged_merge_request?
(
user
)
process_commit_message
(
project
,
commit
,
user
,
author
,
default
)
update_issue_metrics
(
commit
,
author
)
end
def
process_commit_message
(
project
,
commit
,
user
,
author
,
default
=
false
)
# this is a GitLab generated commit message, ignore it.
return
if
commit
.
merged_merge_request?
(
user
)
closed_issues
=
default
?
commit
.
closes_issues
(
user
)
:
[]
close_issues
(
project
,
user
,
author
,
commit
,
closed_issues
)
if
closed_issues
.
any?
...
...
lib/gitlab/git/commit.rb
View file @
af5cd10e
...
...
@@ -473,7 +473,8 @@ module Gitlab
def
parent_ids
=
(
shas
)
@parent_ids
=
case
shas
when
String
then
JSON
.
parse
(
shas
)
when
String
JSON
.
parse
(
shas
)
else
shas
end
...
...
spec/workers/process_commit_worker_spec.rb
View file @
af5cd10e
...
...
@@ -39,7 +39,7 @@ describe ProcessCommitWorker do
project
.
repository
.
commit
(
sha
)
end
it
'
does not process the commit
'
do
it
'
it does not close any issues from the commit message
'
do
expect
(
worker
).
not_to
receive
(
:close_issues
)
worker
.
perform
(
project
.
id
,
user
.
id
,
commit
.
to_hash
)
...
...
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