path: enhance git_path_dirname_r() test coverage
path: Teach UNC paths to git_path_dirname_r()

Fix libgit2/libgit2sharp#256
Merge pull request #1173 from nulltoken/bug/discover

Teach UNC paths to git_path_dirname_r()
Make spoolandsort a pushable iterator behavior

An earlier change to `git_diff_from_iterators` introduced a
memory leak where the allocated spoolandsort iterator was not
returned to the caller and thus not freed.

One proposal changes all iterator APIs to use git_iterator** so
we can reallocate the iterator at will, but that seems unexpected.
This commit makes it so that an iterator can be changed in place.
The callbacks are isolated in a separate structure and a pointer
to that structure can be reassigned by the spoolandsort extension.

This means that spoolandsort doesn't create a new iterator; it
just allocates a new block of callbacks (along with space for its
own extra data) and swaps that into the iterator.

Additionally, since spoolandsort is only needed to switch the
case sensitivity of an iterator, this simplifies the API to only
take the ignore_case boolean and to be a no-op if the iterator
already matches the requested case sensitivity.
Invalid ref name normalization leaked memory

When normalizing a reference name, if there is an error because
the name is invalid, then the memory allocated for storing the
name could be leaked if the caller was not careful and assumed
that the error return code meant that no allocation had occurred.

This fixes that by explicitly deallocating the reference name
buffer if there is an error in normalizing the name.
Fixed compilation with VS >= 2010

Starting with VS2010 MS ships a stdint.h.

Signed-off-by: Sven Strickroth <email@cs-ware.de>
Merge pull request #1171 from csware/fix-compilation-vs2012

Fixed compilation with =>VS2010
Merge pull request #1176 from arrbee/fix-iter-memleak

Alternative fix for iterator memory leak
Update showindex example

I find the showindex example to be pretty useful on occasion, but
there were are couple of output tweaks I wanted, plus I wanted the
ability to specify a path to an actual index file instead of having
to open the whole repository.  This makes those changes and expands
the example slightly.
Merge pull request #1177 from arrbee/update-example-showindex

Update showindex example
path: ifdef GIT_WIN32 looks_like_network_computer_name()