adapt the release scripts to an older Git client

This commit is contained in:
Jim Blake 2013-10-18 14:48:28 -04:00
parent 3df439c4a7
commit 02280e6171
3 changed files with 14 additions and 13 deletions

View file

@ -239,13 +239,22 @@ end
def branch_exists?(dir, branch)
Dir.chdir(dir) do |path|
! `git branch --list #{branch}`.strip.empty?
re = Regexp.new("\\b#{branch}\\b")
`git branch`.index(re)
end
end
def remote_branch_exists?(dir, branch)
Dir.chdir(dir) do |path|
re = Regexp.new("remotes/origin/#{branch}\\b")
`git branch -a`.index(re)
end
end
def tag_exists?(dir, tag)
Dir.chdir(dir) do |path|
!`git tag --list #{tag}`.strip.empty?
re = Regexp.new("\\b#{tag}\\b")
`git tag`.index(re)
end
end