Module: GitDump::Repo::Git::ClassMethods

Defined in:
lib/git_dump/repo/git.rb

Overview

Methods which work outside of git repository

Instance Method Summary collapse

Instance Method Details

#remote_tag_names(url) ⇒ Object

List remote tag names



18
19
20
21
22
23
24
25
26
# File 'lib/git_dump/repo/git.rb', line 18

def remote_tag_names(url)
  Cmd.git('ls-remote', '--tags', url).stripped_lines.map do |line|
    if (m = %r!^[0-9a-f]{40}\trefs/tags/(.*)$!.match(line))
      m[1]
    else
      fail "Unexpected: #{line}"
    end
  end
end