From 85e528e660b2482d6a3b71b39b0f57544135b749 Mon Sep 17 00:00:00 2001 From: f Date: Wed, 27 Sep 2023 16:46:33 -0300 Subject: [PATCH] fix: solo hacer merge si hubo cambios para traer --- app/jobs/git_pull_job.rb | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/app/jobs/git_pull_job.rb b/app/jobs/git_pull_job.rb index de263403..41a2ec2c 100644 --- a/app/jobs/git_pull_job.rb +++ b/app/jobs/git_pull_job.rb @@ -3,11 +3,12 @@ # Permite traer los cambios cada vez que se # hace un push al repositorio class GitPullJob < ApplicationJob - # @param :site [Site] - # @param :usuarie [Usuarie] - # @return [nil] - def perform(site, usuarie) - site.repository.fetch - site.repository.merge(usuarie) - end -end \ No newline at end of file + # @param :site [Site] + # @param :usuarie [Usuarie] + # @return [nil] + def perform(site, usuarie) + return unless site.repository.fetch.positive? + + site.repository.merge(usuarie) + end +end