Fix a number of git_odb_exists_prefix bugs

The git_odb_exists_prefix API was not dealing correctly when a
later backend returned GIT_ENOTFOUND even if an earlier backend
had found the object.

Additionally, the unit tests were not properly exercising the API
and had a couple mistakes in checking the results.

Lastly, since the backends are not expected to behavior correctly
unless all bytes of the short id are zero except for the prefix,
this makes the ODB prefix APIs explicitly clear out the extra
bytes so the user doesn't have to be as careful.
Add failing test for git_object_short_id
branch: constness fixes
repo: remove test which deletes HEAD

This is not something anybody would ever do; removing HEAD makes the
.git/ directory no longer be a repository, so we wouldn't be expected to
handle such a situation.
refs: append to the HEAD reflog when updating the current branch

When we update the current branch, we must also append to HEAD's reflog
to keep them in sync.

This is a bit of a hack, but as git.git says, it covers 100% of
default cases.
Merge pull request #2190 from libgit2/cmn/current-branch-reflog

refs: append to the HEAD reflog when updating the current branch
Merge pull request #2192 from phkelley/development

Seamless support for NTLM/Kerberos auth on Windows
Implement git_merge_base_octopus
Merge pull request #2189 from Aimeast/octopus

Implement git_merge_base_octopus
reflog: more comprehensive HEAD tests

The existing ones lack checking zeroed ids when switching back from an
unborn branch as well as what happens when detaching.

The reflog appending function mistakenly wrote zeros when dealing with a
detached HEAD. This explicitly checks for those situations and fixes
them.
refdb: don't update when there's no need

If the caller wants to update a ref to point to the same target as it
currently has, we should return early and avoid writing to the reflog.
reflog: simplify the append logic

Remove some duplicated logic.
reflog: handle the birth of a branch

The reflog append function was overzealous in its checking. When passed
an old and new ids, it should not do any checking, but just serialize
the data to a reflog entry.
reflog: handle symref chains

Given HEAD -> master -> foo, when updating foo's reflog we should also
update HEAD's, as it's considered the current branch.
Merge pull request #2193 from libgit2/cmn/reflog-HEAD

Reflog all the way
Introduce git_merge_file for consumers
Add `git_merge_status` to provide info about an upcoming merge
Remove fastforward / uptodate from `git_merge`
Change signature of `git_merge` to take merge and checkout opts
Update git_merge_tree_opts to git_merge_options