5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-06-02 04:24:17 +00:00

fix: add git lfs fetch to repository#fetch method #12980

This commit is contained in:
jazzari 2023-07-21 17:12:26 -03:00
parent d77b8ba67b
commit 3e12bfbe9e
2 changed files with 9 additions and 9 deletions

View file

@ -4,14 +4,10 @@
# hace un push al repositorio
class GitPullJob < ApplicationJob
# @param :site [Site]
# @param :usuarie [Usuarie]
# @return [nil]
def perform(site)
# hace un fetch para ver cambios
def perform(site, usuarie)
site.repository.fetch
# hace un merge
site.repository.merge(site.usuarie)
site.repository.git_sh("git lfs fetch")
site.repository.merge(usuarie)
end
end
end

View file

@ -45,7 +45,9 @@ class Site
# @return [Integer]
def fetch
if origin.check_connection(:fetch, credentials: credentials)
rugged.fetch(origin, credentials: credentials)[:received_objects]
rugged.fetch(origin, credentials: credentials)[:received_objects].tap do |objects|
git_sh("git", "lfs", "fetch", "origin", default_branch) if objects&.positive?
end
else
0
end
@ -75,6 +77,8 @@ class Site
# Forzamos el checkout para mover el HEAD al último commit y
# escribir los cambios
rugged.checkout 'HEAD', strategy: :force
# reemplaza los pointers por los archivos correspondientes
git_sh("git", "lfs", "checkout")
commit
end