capistrano/capistrano — pull request #315 by fabue (2012-11-23 14:48:57+00:00)
Title: Fix for shallow clone of non-master branch under git.

If you do the shallow clone strategy under git, you must provide a real remote branch name in the :branch setting. Before the fix was provided, only the master branch was cloned as a shallow clone by default. Any other revisions couldn't be checked out. The fix forces the branch in the :branch setting to be cloned out specifically in a shallow way, so that it can be checked out in the next command. Unfortunately, if you set :branch to a sha1 or tag, the clone of the repo fails. But shallow clones of tags and sha1 revisions are not possible anyway, so prevent that.

Summary: If you do shallow clone with git, provide a real remote branch name in the :branch setting.