module Git::Commands::CatFile

Commands for reading git object store content via ‘git cat-file`

This module contains command classes split by invocation protocol:

@example Check whether an object exists

cmd = Git::Commands::CatFile::Raw.new(lib)
result = cmd.call('HEAD', e: true)
result.status.exitstatus  # => 0 (exists) or 1 (not found)

@example Pretty-print a single object

cmd = Git::Commands::CatFile::Raw.new(lib)
result = cmd.call('HEAD', p: true)
result.stdout
# => "tree abc1234...\nauthor ...\n\nCommit message\n"

@example Fetch content after working-tree filters

cmd = Git::Commands::CatFile::Filtered.new(lib)
result = cmd.call('HEAD:README.md', filters: true)
result.stdout

@example Fetch metadata for several objects via batch

cmd = Git::Commands::CatFile::Batch.new(lib)
result = cmd.call('HEAD', 'v1.0', batch_check: true)
result.stdout
# => "abc1234... commit 250\nabc5678... tag 143\n"

@see git-scm.com/docs/git-cat-file git-cat-file documentation

@api private