Checkout local revision if not tag/remote branch.

When the supplied git revision is not a tag or remote branch checkout
the revision locally.

Change-Id: I42bdd4e089036d7520d63067862b0be7245c998f
Reviewed-on: https://review.openstack.org/17568
Reviewed-by: James E. Blair <corvus@inaugust.com>
Reviewed-by: Paul Belanger <paul.belanger@polybeacon.com>
Approved: Clark Boylan <clark.boylan@gmail.com>
Reviewed-by: Clark Boylan <clark.boylan@gmail.com>
Tested-by: Jenkins
This commit is contained in:
Clark Boylan 2012-12-05 16:20:44 -08:00 committed by Jenkins
parent 0fe5920524
commit 3737cccbc1
1 changed files with 3 additions and 5 deletions

View File

@ -199,12 +199,10 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo)
else
at_path { git_with_identity('checkout', '--force', "tag/#{revision}") }
end
elsif remote_branch_revision?(revision)
if !local_branch_revision?(revision)
elsif remote_branch_revision?(revision) && !local_branch_revision?(revision)
at_path { git_with_identity('checkout', '-b', revision, '--track', "#{@resource.value(:remote)}/#{revision}") }
else
at_path { git_with_identity('checkout', '--force', revision) }
end
else
at_path { git_with_identity('checkout', '--force', revision) }
end
end