Module: Git::Repository::Maintenance Private
- Included in:
- Git::Repository
- Defined in:
- lib/git/repository/maintenance.rb
Overview
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Facade methods for repository maintenance and optimization operations
These methods pack objects, compress history, prune unreachable objects, and otherwise keep the repository in good health.
Included by Git::Repository.
Instance Method Summary collapse
-
#gc ⇒ String
private
Run garbage collection to optimize and clean up the repository.
-
#repack ⇒ String
private
Repack loose objects into pack files.
Instance Method Details
#gc ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Run garbage collection to optimize and clean up the repository
Runs git gc to perform housekeeping tasks including object compression,
pruning of unreachable objects, and ref packing. This is equivalent to
running git gc --prune --aggressive --auto.
This method uses the fixed options prune: true, aggressive: true, auto: true
(matching the 4.x behavior). No additional options are exposed.
60 61 62 |
# File 'lib/git/repository/maintenance.rb', line 60 def gc Git::Commands::Gc.new(@execution_context).call(prune: true, aggressive: true, auto: true).stdout end |
#repack ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Repack loose objects into pack files
Packs all unpacked objects and removes redundant pack files. This is
equivalent to running git repack -a -d, which packs all objects into a
single pack and deletes any packs that become redundant.
This method uses the fixed options a: true, d: true (matching the 4.x
behavior). No additional options are exposed.
37 38 39 |
# File 'lib/git/repository/maintenance.rb', line 37 def repack Git::Commands::Repack.new(@execution_context).call(a: true, d: true).stdout end |