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>
Add helper for diff line stats

This adds a `git_diff_patch_line_stats()` API that gets the total
number of adds, deletes, and context lines in a patch.  This will
make it a little easier to emulate `git diff --stat` and the like.

Right now, this relies on generating the `git_diff_patch` object,
which is a pretty heavyweight way to get stat information.  At
some future point, it would probably be nice to be able to get
this information without allocating the entire `git_diff_patch`,
but that's a much larger project.
Free buffer at end of test
Let people know that the ML is deprecated
Merge pull request #1297 from arrbee/diff-patch-line-totals

Add helper API for diff line stats from patch
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>