Method: Grit::GitRuby#cat_file

Defined in:
lib/grit/git-ruby.rb

#cat_file(options, sha) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
# File 'lib/grit/git-ruby.rb', line 20

def cat_file(options, sha)
  if options[:t]
    file_type(sha)
  elsif options[:s]
    file_size(sha)
  elsif options[:p]
    try_run { ruby_git.cat_file(sha) }
  end
rescue Grit::GitRuby::Repository::NoSuchShaFound
  ''
end