capistrano/capistrano — pull request #326 by cannikin (2012-12-14 22:42:55+00:00)
Title: Makes :git_shallow_clone work with branches

Hey guys, I added the `-b` option to the initial clone command (for deploy via copy) so that if you have the `:git_shallow_clone` variable set it will work with named branches (currently it only works for the tip of master):

# Before:
executing locally: git clone -q --depth 1 git@github.com:cannikin/my_repo.git /var/folders/5l/5wv_5qqx36bcf8vhh2n0qx6h0000gn/T/20121214220840 && cd /var/folders/5l/5wv_5qqx36bcf8vhh2n0qx6h0000gn/T/20121214220840 && git checkout -q -b deploy cec5221eaac5b661b75478117758f8b3e2d257b1
fatal: reference is not a tree: cec5221eaac5b661b75478117758f8b3e2d257b1

# After:
executing locally: git clone -q -b qa --depth 1 git@github.com:cannikin/my_repo.git /var/folders/5l/5wv_5qqx36bcf8vhh2n0qx6h0000gn/T/20121214222735 && cd /var/folders/5l/5wv_5qqx36bcf8vhh2n0qx6h0000gn/T/20121214222735 && git checkout -q -b deploy cec5221eaac5b661b75478117758f8b3e2d257b1
command finished in 5293ms

Granted I am not a git expert so I'm not sure if the `-b` flag is valid in all `git clone` scenarios...hopefully someone else knows?