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:
parent
0fe5920524
commit
3737cccbc1
@ -199,12 +199,10 @@ Puppet::Type.type(:vcsrepo).provide(:git, :parent => Puppet::Provider::Vcsrepo)
|
|||||||
else
|
else
|
||||||
at_path { git_with_identity('checkout', '--force', "tag/#{revision}") }
|
at_path { git_with_identity('checkout', '--force', "tag/#{revision}") }
|
||||||
end
|
end
|
||||||
elsif remote_branch_revision?(revision)
|
elsif remote_branch_revision?(revision) && !local_branch_revision?(revision)
|
||||||
if !local_branch_revision?(revision)
|
|
||||||
at_path { git_with_identity('checkout', '-b', revision, '--track', "#{@resource.value(:remote)}/#{revision}") }
|
at_path { git_with_identity('checkout', '-b', revision, '--track', "#{@resource.value(:remote)}/#{revision}") }
|
||||||
else
|
else
|
||||||
at_path { git_with_identity('checkout', '--force', revision) }
|
at_path { git_with_identity('checkout', '--force', revision) }
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user