[libgit2] clean some code
[libgi2] add option support