Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2018-07-11 16:26:56 +0300
committerDouwe Maan <douwe@gitlab.com>2018-07-11 16:26:56 +0300
commit6d8c262593d3352c36a64d32dc2fa7901a415bfc (patch)
tree96c204248b1be517262909e371600f38f84e31a3 /app/workers
parent9894ee4e08e5afbb3660403eded8f6e171e2de9f (diff)
parent5b0210a0c8db13b6e538dfea7bc07d090224bbca (diff)
Merge branch '45592-nomethoderror-undefined-method-commit-for-nil-nilclass-in-sidekiq-caused-by-a-merge-commit-in-a-forked-project-with-upstream-project-deleted' into 'master'
Resolve "NoMethodError: undefined method `commit' for nil:NilClass in sidekiq caused by a merge commit in a forked project with upstream project deleted." Closes #45592 See merge request gitlab-org/gitlab-ce!20534
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/process_commit_worker.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/workers/process_commit_worker.rb b/app/workers/process_commit_worker.rb
index ed39b4a1ea8..c9f6df9b56d 100644
--- a/app/workers/process_commit_worker.rb
+++ b/app/workers/process_commit_worker.rb
@@ -79,9 +79,10 @@ class ProcessCommitWorker
# Avoid reprocessing commits that already exist in the upstream
# when project is forked. This will also prevent duplicated system notes.
def commit_exists_in_upstream?(project, commit_hash)
- return false unless project.forked?
+ upstream_project = project.fork_source
+
+ return false unless upstream_project
- upstream_project = project.forked_from_project
commit_id = commit_hash.with_indifferent_access[:id]
upstream_project.commit(commit_id).present?
end