CocoaPods/CocoaPods — pull request #262 by samstewart (2012-05-21 23:23:45+00:00)
Title: Added ability to specify :branch when listing dependencies in Podfile or in .podspec definitions

Playhaven needs this feature to separate a CocoaPods version of our SDK into a different branch from our "vanilla" release. While one could conceivably replicate the behavior with a tag or a specific commit treeish, the ability to specify a branch seems more intuitive (similar to official [gemfile spec](http://gembundler.com/man/gemfile.5.html)). For example, one might specify:

:git => "git://github.com/CocoaPods/CocoaPods.git", :branch => "refactor-podroot"

The change was quite simple and involved adding some more validation code to ensure the branch exists along with some additional download behavior.

I'm a better iOS/Android engineer than Ruby programmer so please be brutal on this request. I ran the unit tests using

`bundle exec bacon spec`

and managed to get them to pass after my changes. Should I be doing anything else?

I tried to keep my changes as least intrusive as possible but please let me know if there is anything I can cut down.