puppetlabs/puppetlabs-vcsrepo — pull request #48 by spscream (2013-01-24 11:13:00+00:00)
Title: ensure latest does git checkout on every agent run

Hi!

I'm writing the following resource:
```
vcsrepo { "/repopath":
ensure => latest,
user => auto,
owner => auto,
group => auto,
provider => git,
source => 'file:///share/repo.git',
revision => 'release'
}
```
Branch of git workdir is 'no branch' since 'release' is a remote tag reference.
Every time puppet agent is running, puppet runs 'git checkout --force', but it should just check remote and local refs, and only if it diffs checkout new version.

Log messages:
```
Jan 11 16:30:30 php4-lib2 puppet-agent[30742]: Applying configuration version '1357905227'
Jan 11 16:30:32 php4-lib2 puppet-agent[30742]: (/Stage[main]/Admingit/Vcsrepo[/repopath]/ensure) Updating to latest '89e6c4b7a74335ad03ef80ac8a7a1269333272ac' revision
Jan 11 16:30:33 php4-lib2 puppet-agent[30742]: (/Stage[main]/Admingit/Vcsrepo[/repopath]/ensure) ensure changed 'present' to 'latest'
Jan 11 16:30:33 php4-lib2 puppet-agent[30742]: Finished catalog run in 3.65 seconds
```