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:
parent
78c0bdcc39
commit
1e0fb95825
1 changed files with 17 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue