Free temporary merge index
Merge pull request #2209 from ethomson/cleanup

Cleanup some warnings and mem leaks
Fix segfault if gitmodules is invalid

The reload_all call could end up dereferencing a NULL pointer if
there was an error while attempting to load the submodules config
data (i.e. invalid content in the gitmodules file).  This fixes it.
Fix error when submodule path and name differ

When a submodule was inserted with a different path and name, the
return value from khash greater than zero was allowed to propagate
back out to the caller when it should really be zeroed.  This led
to a possible crash when reloading submodules if that was the
first time that submodule data was loaded.
Merge pull request #2210 from libgit2/rb/submodule-api-with-no-submodules

Fix segfault if gitmodules is invalid
Retry renaming files on Access Denied errors

When a file is open for reading (without shared-delete permission), and
then a different thread/process called p_rename, that would fail, even
if the file was only open for reading for a few milliseconds. This
change lets p_rename wait up to 50ms for the file to be closed by the
reader. Applies only to win32.

This is especially important for git_filebuf_commit, because writes
should not fail if the file is read simultaneously.

Fixes #2207
Fix use-after-free in submodule reload

If the first call to release a no-longer-existent submodule freed
the object, the check if a second is needed would dereference the
data that was just freed.
Fix memory leak of submodule branch name
Fix memory leak of test repository object
Merge pull request #2212 from libgit2/rb/submodule-use-after-free

Fix use-after-free in submodule reload code and other memory leaks
Update clar to 587f88a
Sandbox configuration during test runs
Merge pull request #2214 from ethomson/sandbox_config

RFC: Sandbox HOME during test execution
Update clar to 4b75388
Merge pull request #2216 from ethomson/clar

Update clar to 4b75388
Don't reset need_pack

While looping over multiple heads, an up-to-date head will clobber the `remote->need_pack` setting, preventing the rest of the machinery from building and downloading a pack-file, breaking fetches.
Merge pull request #2219 from tiennou/reset-need-pack

Don't reset need_pack
Introduce git_merge_head_id
Merge pull request #2222 from ethomson/merge_head_id

Introduce git_merge_head_id
Const up members of git_merge_file_result