Method: Git::Lib#tag_sha

Defined in:
lib/git/lib.rb

#tag_sha(tag_name)



1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
# File 'lib/git/lib.rb', line 1047

def tag_sha(tag_name)
  head = File.join(@git_dir, 'refs', 'tags', tag_name)
  return File.read(head).chomp if File.exist?(head)

  begin
    command('show-ref',  '--tags', '-s', tag_name)
  rescue Git::FailedError => e
    raise unless e.result.status.exitstatus == 1 && e.result.stderr == ''

    ''
  end
end