Test submodules with empty index or orphaned head

In both of these cases, the submodule data should still be loaded
just (obviously) without the data that comes from either the index
or the HEAD.

This fixes a bug in the orphaned head case.
Merge pull request #1688 from arrbee/submodule-load-ignore-orphaned-head

Test submodules with empty index or orphaned head
Fix compilation warnings
test: Fix memory leak
Merge pull request #1690 from nulltoken/fix/warnings

Fix Win32/64 compilation warnings & memory leak
Fix docs to use proper enum names that exist.
Add helpful buffer shorten function
Make refspec_transform paranoid about arguments
Merge pull request #1694 from AndrejMitrovic/FixupDocEnums

[trivial] Fix docs to use proper enum names
Fix small typo in docs for git_repository_message.
Merge pull request #1696 from AndrejMitrovic/FixTypo

[trivial] Fix small typo in docs for git_repository_message.
Fix segfault in git_status_foreach_ext()

Add tests for the `GIT_STATUS_SHOW_XXX` flags.
Be more thread aware with some index updates

The index isn't really thread safe for the most part, but we can
easily be more careful and avoid double frees and the like, which
are serious problems (as opposed to a lookup which might return
the incorrect value but if the index in being updated, that is
much harder to avoid).
Merge pull request #1701 from yorah/fix/gh-1698

Fix segfault in git_status_foreach_ext()
Remove GIT_STATUS_SHOW_INDEX_THEN_WORKDIR option

This option serves no benefit now that the git_status_list API
is available.  It was of questionable value before and now it
would just be a bad idea to use it rather than the indexed API.
Fix a crash if git_remote_set_cred_acquire_cb wasn't called before connecting.

Fixes #1700.
Fix a probable leak.
Merge pull request #1692 from arrbee/fix-1692

Segmentation fault on git_clone
Diff hunk context off by one on long lines

The diff hunk context string that is returned to xdiff need not
be NUL terminated because the xdiff code just copies the number of
bytes that you report directly into the output.  There was an off
by one in the diff driver code when the header context was longer
than the output buffer size, the output buffer length included
the NUL byte which was copied into the hunk header.

Fixes #1710
Make the git_signature const in the stash API.