adrienthebo/r10k — pull request #66 by eliasp (2013-09-14 13:35:49+00:00)
Title: Also checkout the environment's branch after cloning the environment.

When doing a

r10k deploy environment

The result will be a directory tree like:

etc
+-- puppet
+-- environments
+-- development
+-- integration
+-- production
+-- test-feature-foo
+-- test-feature-bar

Whereas each environment represents a branch of the source repository.

The problem is with the respective environment's directory: instead of containing the respective branch, it'll always contain a checkout of the `production` branch (I wasn't able yet to find out what causes here the default to `production` instead of something else like the first branch name in alpha-numerical order like `development`).

This PR ensures, the corresponding environment's branch is checked out from the cloned repository.

It would be also possible to clone a specific branch right away (`git clone --branch --single-branch …`), but this would break functionality for < git 1.7.10.