Method: Git::Lib#tag_sha

Defined in:
lib/git/lib.rb

#tag_sha(tag_name)

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.



1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
# File 'lib/git/lib.rb', line 1512

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