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:
authorRobert Speicher <robert@gitlab.com>2016-06-17 22:14:43 +0300
committerRobert Speicher <robert@gitlab.com>2016-06-17 22:14:43 +0300
commit1db4fd3ae7cd3a4fa2f356a4c252820e26783a27 (patch)
treec55ec6f6e8013bd64321d4f6221da2bb0f22da99 /app/workers
parentbb4a1ef6c1ed4d367e6126ad64033e0286da6f15 (diff)
parentd9f6d5dd59281a8efcd6cb7b392b1ef3bafa778d (diff)
Merge branch 'repo-check-require-push-events' into 'master'
Do not check repos without push events Reduce false positives from automatic repository checks by skipping projects without push events. See merge request !4684
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/repository_check/single_repository_worker.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/workers/repository_check/single_repository_worker.rb b/app/workers/repository_check/single_repository_worker.rb
index f2d12ba5a7d..98ddf5d0688 100644
--- a/app/workers/repository_check/single_repository_worker.rb
+++ b/app/workers/repository_check/single_repository_worker.rb
@@ -15,7 +15,7 @@ module RepositoryCheck
private
def check(project)
- if !git_fsck(project.repository)
+ if has_pushes?(project) && !git_fsck(project.repository)
false
elsif project.wiki_enabled?
# Historically some projects never had their wiki repos initialized;
@@ -44,5 +44,9 @@ module RepositoryCheck
false
end
end
+
+ def has_pushes?(project)
+ Project.with_push.exists?(project.id)
+ end
end
end