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:
authorSean McGivern <sean@gitlab.com>2018-07-10 19:11:31 +0300
committerSean McGivern <sean@gitlab.com>2018-07-10 19:11:31 +0300
commit5b0210a0c8db13b6e538dfea7bc07d090224bbca (patch)
tree08b56fdda44762bab34bdc6ea5e4879e23e6b77a /app/workers/process_commit_worker.rb
parent49d7f92fd7476b4fb10e44ff92f36be99de0df49 (diff)
Fix ProcessCommitWorker when upstream project is deleted
Diffstat (limited to 'app/workers/process_commit_worker.rb')
-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