Create a new Git repository in the given folder with extended controls.
This will initialize a new git repository (creating the repo_path if requested by flags) and working directory as needed. It will auto-detect the case sensitivity of the file system and if the file system supports file mode bits correctly.
The path to the repository.
0 or an error code on failure.