Support for core.ignorecase
Minor fixes for ignorecase support
ODB: re-load packfiles on failed lookup

The old method was avoiding re-loading of packfiles by watching the mtime of the
pack directory. This causes the ODB to become stale if the directory and packfile
are written within the same clock millisecond, as when cloning a fairly small
repo.

This method tries to find the object in the cached packs, and forces a refresh when
that fails. This will cause extra stat'ing on a miss, but speeds up the success
case and avoids this race condition.
Remove mtime checks from ODB packfile backend

Now forcing refresh on a foreach, and on missed full-oid
or short-oid lookups.
ODB pack: snapshot last_found to avoid race

Also removed unnecessary refresh call and fixed
some indentation.
Honor %HOME% on windows

Use %HOME% before trying to figure out the windows user directory.
Users might set this as they are used on *nix systems.

Signed-off-by: Sven Strickroth <email@cs-ware.de>
Calculate the Windows user profile directory the same way as msysgit

On most systems %USERPROFILE% is the same as %HOMEDRIVE%\%HOMEPATH%,
however, for windows machines in an AD or domain environment this
might be different and %HOMEDRIVE%\%HOMEPATH% seems to be better.

Signed-off-by: Sven Strickroth <email@cs-ware.de>
Automatically detect msysgit installation path

Do not hardcode the installation path of msysgit, but read installation path from registry.
Also "%PROGRAMFILES%\Git\etc" won't work on x64 systems with 64-bit libgit2, because
msysgit is x86 only and located in "%ProgramFiles(x86)%\Git\etc".

Signed-off-by: Sven Strickroth <email@cs-ware.de>
Correctly read xdr compatible %HOME%/.config/git/config config file

This file is not just read if the global config file (%HOME%/.gitconfig)
is not found, however, it is used everytime but with lower priority.

Signed-off-by: Sven Strickroth <email@cs-ware.de>
Fixed typo: xdr config needs to have a lower priority than the global one

Signed-off-by: Sven Strickroth <email@cs-ware.de>
Fixed missing method

Signed-off-by: Sven Strickroth <email@cs-ware.de>
git_config_open_default: Honour xdr config

Signed-off-by: Sven Strickroth <email@cs-ware.de>
Implemented the full msysgit fallback chain

Signed-off-by: Sven Strickroth <email@cs-ware.de>
New take on iterating over diff content

Allow diff deltas to be accessed by index and make patch generation
explicit with hunk and line access by index as well.
Initial implementation of new diff patch API

Replacing the `git_iterator` object, this creates a simple API
for accessing the "patch" for any file pair in a diff list and
then gives indexed access to the hunks in the patch and the lines
in the hunk.  This is the initial implementation of this revised
API - it is still broken, but at least builds cleanly.
Fix bugs in new diff patch code

This fixes all the bugs in the new diff patch code.  The only
really interesting one is that when we merge two diffs, we now
have to actually exclude diff delta records that are not supposed
to be tracked, as opposed to before where they could be included
because they would be skipped silently by `git_diff_foreach()`.
Other than that, there are just minor errors.
Add const to all shared pointers in diff API

There are a lot of places where the diff API gives the user access
to internal data structures and many of these were being exposed
through non-const pointers.  This replaces them all with const
pointers for any object that the user can access but is still
owned internally to the git_diff_list or git_diff_patch objects.

This will probably break some bindings...  Sorry!
revwalk: fix off-by-one error

Fixes #921.
Fix error hashing empty file.
Merge pull request #941 from arrbee/diff-separate-iterators

Create a diff patch object as a replacement for iterators