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>
refs: handle ALLOW_ONELEVEL normalization with leading slash

A leading slash confuses the name normalization code when the flags
include ALLOW_ONELEVEL. Catch this case in particular to avoid
triggering an assertion in the uppercase check which expects us not to
pass it an empty string.

The existing tests don't catch this as they simply use the NORMAL
flag.

This fixes #1300.
Merge pull request #1300 from carlosmn/ref-leading-slash

Crash when resolving a ref starting with "/"
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>