puppetlabs/puppetlabs-vcsrepo — pull request #39 by sodabrew (2012-10-31 17:35:05+00:00)
Title: Don't fetch from remote when revision is a SHA1 and we have it

When the revision parameter is a SHA1 id, we only need to check if the local HEAD is at the same SHA1. These don't change, and don't collide (unless crypto hacked, but no sense worrying about that), so if we have it, don't fetch from the git server.

Open discussion topics:

* If the revision is a tag, we probably _shouldn't_ fetch...
* But this should be configurable
* If the revision is a branch, we _should_ fetch.
* And write in the documentation that you'll slam your git server this way.

Also in this pull request is a small change `git checkout --force` to `git checkout -f` for compatibility with older versions of git 1.5.