Module: Git::Repository::Inspecting
- Included in:
- Git::Repository
- Defined in:
- lib/git/repository/inspecting.rb
Overview
Facade methods for read-only repository inspection operations
These methods report on the contents and integrity of the repository.
Included by Git::Repository.
Instance Method Summary collapse
-
#fsck(*objects, **options) ⇒ Git::FsckResult
Verify the connectivity and validity of the objects in the database.
-
#show(objectish = nil, path = nil) ⇒ String
Show a single git object (a commit, tag, tree, or blob).
Instance Method Details
#fsck(*objects, **options) ⇒ Git::FsckResult
Verify the connectivity and validity of the objects in the database
Runs git fsck and returns the categorized objects it flags. Progress
output is always suppressed (--no-progress) so that stdout contains only
the machine-parsable findings.
146 147 148 149 150 |
# File 'lib/git/repository/inspecting.rb', line 146 def fsck(*objects, **) SharedPrivate.assert_valid_opts!(FSCK_ALLOWED_OPTS, **) result = Git::Commands::Fsck.new(@execution_context).call(*objects, **, no_progress: true) Git::Parsers::Fsck.parse(result.stdout) end |
#show(objectish = nil, path = nil) ⇒ String
Show a single git object (a commit, tag, tree, or blob)
47 48 49 50 |
# File 'lib/git/repository/inspecting.rb', line 47 def show(objectish = nil, path = nil) object = path ? "#{objectish || 'HEAD'}:#{path}" : objectish Git::Commands::Show.new(@execution_context).call(*[object].compact).stdout end |