flogic/whiskey_disk — pull request #32 by rolftimmermans (2011-11-16 23:07:24+00:00)
Title: Suppress git error messages when checking out master after cloning

When the branch that is to be checked out on deployment is the master branch (which is very useful for development or QA environments), a number of git errors occur on `vd setup`.

Example:

```
Deploying test22...
Password:
Cloning into example.com-preview...
fatal: git checkout: branch master already exists
error: pathspec 'origin/master' did not match any file(s) known to git.
Already on 'master'
Running post script...
Running rake deploy:post_setup...

Results:
test22 => succeeded.
Total: 1 deployment, 1 success, 0 failures.
```

Even though the deployment succeeded, the error messages are quite confusing. Especially since one error message reads "fatal", though it's not fatal at all (from the point of view of Whiskey Disk)!

This patch fixes this issue by avoiding any git checkout actions if the recently cloned git repository equals the branch that we want to have. It should avoid much confusion for people that attempt to deploy their master branch.

Thank you for making Whiskey Disk -- it's been a pleasure to use!