5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-16 16:01:41 +00:00

correr la recolección de basura de git

This commit is contained in:
f 2022-04-15 10:40:18 -03:00
parent 78c0bdcc39
commit 1e0fb95825

View file

@ -147,6 +147,23 @@ class Site
rugged.index.remove(relativize(file))
end
# Garbage collection
#
# @return [Boolean]
def gc
env = { 'PATH' => '/usr/bin', 'LANG' => ENV['LANG'], 'HOME' => path }
cmd = 'git gc'
r = nil
Dir.chdir(path) do
Open3.popen2e(env, cmd, unsetenv_others: true) do |_, _, t|
r = t.value
end
end
r&.success?
end
private
# Si Sutty tiene una llave privada de tipo ED25519, devuelve las