summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgodlikeachilles <achilleska@gmail.com>2015-12-02 15:07:15 +1100
committergodlikeachilles <achilleska@gmail.com>2015-12-02 15:07:15 +1100
commit7fe9cb225b6458e468469597a54753f1ea621e00 (patch)
treea119c9708a811db6617a080212f4daf74e764b4f
parent99e8b2e28ce9541202b8b2438a92ee8ac2b03d6a (diff)
downloadpuppet-vcsrepo-7fe9cb225b6458e468469597a54753f1ea621e00.tar.gz
puppet-vcsrepo-7fe9cb225b6458e468469597a54753f1ea621e00.tar.bz2
fix branch existence determintaion functionality
this will stop failing in case there is a tag which is a substring of an existing branch name. for example if there is a tag 'release' and a branch 'release/integration' current code will match 'release/integration' with pattern 'release' and decide that a branch checkout is needed. but release branch does not exist so it will fail. this simple fix resolves the issue.
-rw-r--r--lib/puppet/provider/vcsrepo/git.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/puppet/provider/vcsrepo/git.rb b/lib/puppet/provider/vcsrepo/git.rb
index 3b20a83..0249a3c 100644
--- a/lib/puppet/provider/vcsrepo/git.rb
+++ b/lib/puppet/provider/vcsrepo/git.rb
@@ -319,7 +319,7 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo)
def remote_branch_revision?(revision = @resource.value(:revision))
# git < 1.6 returns '#{@resource.value(:remote)}/#{revision}'
# git 1.6+ returns 'remotes/#{@resource.value(:remote)}/#{revision}'
- branch = at_path { branches.grep /(remotes\/)?#{@resource.value(:remote)}\/#{revision}/ }
+ branch = at_path { branches.grep /(remotes\/)?#{@resource.value(:remote)}\/#{revision}$/ }
branch unless branch.empty?
end