Fix checkout failure when running clone with libgit2 without specifying local branch name

Signed-off-by: Sup Yut Sum <ch3cooli@gmail.com>