mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 12:36:21 +00:00
29 lines
609 B
Ruby
29 lines
609 B
Ruby
# frozen_string_literal: true
|
|
|
|
# Permite traer los cambios desde el repositorio remoto
|
|
class GitPullJob < ApplicationJob
|
|
# @param :site [Site]
|
|
# @param :usuarie [Usuarie]
|
|
# @param :message [String]
|
|
# @return [nil]
|
|
def perform(site, usuarie, message)
|
|
@site = site
|
|
|
|
return unless site.repository.origin
|
|
|
|
site.repository.fetch
|
|
|
|
return if site.repository.up_to_date?
|
|
|
|
if site.repository.fast_forward?
|
|
site.repository.fast_forward!
|
|
else
|
|
site.repository.merge(usuarie, message)
|
|
end
|
|
|
|
site.repository.git_lfs_checkout
|
|
site.reindex_changes!
|
|
|
|
nil
|
|
end
|
|
end
|