Since the libgit2 doesn't explicitly mention git clone in its issue list, one lead to follow is in the sources of the original git project with:
- builtin/clone.c
- contrib/examples/git-clone.sh
That last script will guide you through all the stages of a git clone
.