5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-26 10:36:21 +00:00
panel/app/jobs/git_pull_job.rb

25 lines
507 B
Ruby
Raw 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)
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
git_lfs_checkout
nil
end
end