Fix fail clone local repo which head detatched

Set head detach if can't found branch after download

Signed-off-by: Frank Li <lznuaa@gmail.com>
Skip "user@" when finding hostname in url
Stash username from url (but don't use it yet)
Add user-from-url param to auth callback
Refactored: Move msysgit registry detection to it's own function

Signed-off-by: Sven Strickroth <email@cs-ware.de>
Detect msysgit installation of users without admin rights

Signed-off-by: Sven Strickroth <email@cs-ware.de>
Added Sven Strickroth to AUTHORS

Signed-off-by: Sven Strickroth <email@cs-ware.de>
Enhance url parsing to include passwords
Plug test leaks
HTTP: use creds in url if available
WinHttp: use cred in url if provided
Remove double-free segfaults
Stick to coding style: Move up braces

Signed-off-by: Sven Strickroth <email@cs-ware.de>
Add test case for clone head detached repo

Signed-off-by: Frank Li <lznuaa@gmail.com>
Signed-off-by: nulltoken <emeric.fermas@gmail.com>
Merge pull request #1286 from lznuaa/master

Fix clone fail if repo head detached
Introduce git__substrdup
Try harder to find global config file
Win32: Make sure error messages are consistently UTF-8 encoded

W/o this a libgit2 error message could have a mixed encoding:
e.g. a filename in UTF-8 combined with a native Windows error message
encoded with the local code page.

Signed-off-by: Sven Strickroth <email@cs-ware.de>
Get utf8_size from WideCharToMultiByte instead of guessing it

Signed-off-by: Sven Strickroth <email@cs-ware.de>
Merge pull request #1302 from jamill/global_config_lookup

Try harder to find global config file