mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-18 19:16:23 +00:00
fix: hacer un merge cuando hay cambios #14533
This commit is contained in:
parent
9df84e7778
commit
9ec0dc87a9
2 changed files with 10 additions and 5 deletions
|
@ -8,6 +8,10 @@ class GitPullJob < ApplicationJob
|
|||
# @param :message [String]
|
||||
# @return [nil]
|
||||
def perform(site, usuarie, message)
|
||||
site.repository.merge(usuarie, message) if site.repository.fetch&.positive?
|
||||
site.repository.fetch
|
||||
|
||||
return if site.repository.up_to_date?
|
||||
|
||||
site.repository.merge(usuarie, message)
|
||||
end
|
||||
end
|
|
@ -111,10 +111,11 @@ class Site
|
|||
walker.each.to_a
|
||||
end
|
||||
|
||||
# Hay commits sin aplicar?
|
||||
def needs_pull?
|
||||
fetch
|
||||
!commits.empty?
|
||||
# Detecta si hay que hacer un pull o no
|
||||
#
|
||||
# @return [Boolean]
|
||||
def up_to_date?
|
||||
rugged.merge_analysis(remote_head_commit).include?(:up_to_date)
|
||||
end
|
||||
|
||||
# Guarda los cambios en git
|
||||
|
|
Loading…
Reference in a new issue