keplerproject/luarocks — pull request #73 by ignacio (2012-05-11 20:10:06+00:00)
Title: Ensures that branches are properly fetched if needed

When trying to install a rock that points to a given branch, my friend @ichramm found that in certain cases, `git checkout the_branch` fails because the repository was cloned with "--depth=1" so the branch does not appear in the history. The error message is:

error: pathspec 'the_branch' did not match any file(s) known to git.

Changing the code so the repository is cloned with _--depth=1 --branch the_branch_ fixes that.

[The docs](http://git-scm.com/docs/git-clone) says that it would work for tags too, but we haven't tested that.

We also found that this bug is related to the git version. On Debian Squeeze (git 1.7.2.5) the bug does not manifest, but with git 1.7.10 (tested in Archlinux and msysgit) the bug appears.