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>
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 "/"
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
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
Merge pull request #1299 from csware/support_local_msysgit_install

Support local msysgit installations
Improved error handling

Signed-off-by: Sven Strickroth <email@cs-ware.de>
Deduplicate FormatMessage UTF-16 to UTF-8 conversion code

Signed-off-by: Sven Strickroth <email@cs-ware.de>
Merge pull request #1303 from csware/win32_consistent_error_encoding

Win32: Make sure error messages are consistently UTF-8 encoded
revparse: Lookup branch before described tag

Fix #1306
revparse: Lookup sha before branch
Merge pull request #1307 from nulltoken/fix/revparse_describe

revparse: Lookup branch before described tag