5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 18:16:22 +00:00
panel/app/jobs/git_pull_job.rb

30 lines
609 B
Ruby
Raw Permalink Normal View History

# 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)
2024-04-12 18:31:47 +00:00
@site = site
2023-09-27 19:54:38 +00:00
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
2023-10-31 16:59:59 +00:00
site.repository.git_lfs_checkout
site.reindex_changes!
nil
end
end