mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-17 21:26:22 +00:00
fix: movido git lfs a método merge en repository.rb #13903
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
This commit is contained in:
parent
9f94ee3bc7
commit
06ebb63d93
2 changed files with 5 additions and 5 deletions
|
@ -1,7 +1,7 @@
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
# Permite traer los cambios cada vez que se
|
# Permite traer los cambios desde webhooks
|
||||||
# hace un push al repositorio
|
|
||||||
class GitPullJob < ApplicationJob
|
class GitPullJob < ApplicationJob
|
||||||
# @param :site [Site]
|
# @param :site [Site]
|
||||||
# @param :usuarie [Usuarie]
|
# @param :usuarie [Usuarie]
|
||||||
|
|
|
@ -45,9 +45,7 @@ class Site
|
||||||
# @return [Integer]
|
# @return [Integer]
|
||||||
def fetch
|
def fetch
|
||||||
if origin.check_connection(:fetch, credentials: credentials)
|
if origin.check_connection(:fetch, credentials: credentials)
|
||||||
rugged.fetch(origin, credentials: credentials)[:received_objects].tap do |objects|
|
rugged.fetch(origin, credentials: credentials)[:received_objects]
|
||||||
git_sh("git", "lfs", "fetch", "origin", default_branch) if objects&.positive?
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
0
|
0
|
||||||
end
|
end
|
||||||
|
@ -77,6 +75,8 @@ class Site
|
||||||
# Forzamos el checkout para mover el HEAD al último commit y
|
# Forzamos el checkout para mover el HEAD al último commit y
|
||||||
# escribir los cambios
|
# escribir los cambios
|
||||||
rugged.checkout 'HEAD', strategy: :force
|
rugged.checkout 'HEAD', strategy: :force
|
||||||
|
|
||||||
|
git_sh("git", "lfs", "fetch", "origin", default_branch)
|
||||||
# reemplaza los pointers por los archivos correspondientes
|
# reemplaza los pointers por los archivos correspondientes
|
||||||
git_sh("git", "lfs", "checkout")
|
git_sh("git", "lfs", "checkout")
|
||||||
commit
|
commit
|
||||||
|
|
Loading…
Reference in a new issue