mirror of
https://0xacab.org/sutty/sutty
synced 2025-03-14 20:08:19 +00:00
Merge branch 'issue-17359' into 'rails'
fix: reindexar desde el principio si cambió el repositorio #17359 See merge request sutty/sutty!280
This commit is contained in:
commit
520f0e828c
1 changed files with 10 additions and 2 deletions
|
@ -46,11 +46,19 @@ class Site
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
# Trae el último commit indexado desde el repositorio
|
# Trae el último commit indexado desde el repositorio, o si no
|
||||||
|
# existe, trae el primer commit.
|
||||||
#
|
#
|
||||||
# @return [Rugged::Commit]
|
# @return [Rugged::Commit]
|
||||||
def indexed_commit
|
def indexed_commit
|
||||||
@indexed_commit ||= repository.rugged.lookup(last_indexed_commit)
|
@indexed_commit ||=
|
||||||
|
if repository.rugged.exists?(last_indexed_commit)
|
||||||
|
repository.rugged.lookup(last_indexed_commit)
|
||||||
|
else
|
||||||
|
repository.rugged.lookup(
|
||||||
|
repository.rugged.references[repository.rugged.head.canonical_name].log.first[:id_new]
|
||||||
|
)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Calcula la diferencia entre el último commit indexado y el
|
# Calcula la diferencia entre el último commit indexado y el
|
||||||
|
|
Loading…
Reference in a new issue