error-handling: Add reference documentation
error-handling: Add new routines

Obviously all the old throw routines are still in place, so we can
gradually port over.
refs: Error handling rework. WIP
error-handling: References

Yes, this is error handling solely for `refs.c`, but some of the
abstractions leak all ofer the code base.
diff: Fix rebase breackage
error-handling: Repository

This also includes droping `git_buf_lasterror` because it makes no sense
in the new system. Note that in most of the places were it has been
dropped, the code needs cleanup. I.e. GIT_ENOMEM is going away, so
instead it should return a generic `-1` and obviously not throw
anything.
Migrating diff to new error handling

Ended up migrating a bunch of upstream functions as well
including vector, attr_file, and odb in order to get this
to work right.
error-handling: Config
Fix issues raised on pull request

This resolves the comments on pull request #590
Merge pull request #590 from arrbee/new-error-handling

Migrating diff to new error handling
error-handling: On-disk config file backend

Includes:

	- Proper error reporting when encountering syntax errors in a
	config file (file, line number, column).

	- Rewritten `config_write`, now with 99% less goto-spaghetti

	- Error state in `git_filebuf`: filebuf write functions no longer
	need to be checked for error returns. If any of the writes performed
	on a buffer fail, the last call to `git_filebuf_commit` or
	`git_filebuf_hash` will fail accordingly and set the appropiate error
	message. Baller!
Migrate ODB files to new error handling

This migrates odb.c, odb_loose.c, odb_pack.c and pack.c to
the new style of error handling.  Also got the unix and win32
versions of map.c.  There are some minor changes to other
files but no others were completely converted.

This also contains an update to filebuf so that a zeroed out
filebuf will not think that the fd (== 0) is actually open
(and inadvertently call close() on fd 0 if cleaned up).

Lastly, this was built and tested on win32 and contains a
bunch of fixes for the win32 build which was pretty broken.
Add map.c with shared p_mmap param validation

Forgot to add this file in the previous commit
Resolve comments from pull request

This converts the map validation function into a macro, tweaks
the GITERR_OS system error automatic appending, and adds a
tentative new error access API and some quick unit tests for
both the old and new error APIs.
Convert attr and other files to new errors

This continues to add other files to the new error handling
style.  I think the only real concerns here are that there are
a couple of error return cases that I have converted to asserts,
but I think that it was the correct thing to do given the new
error style.
Continue error conversion

This converts blob.c, fileops.c, and all of the win32 files.
Also, various minor cleanups throughout the code.  Plus, in
testing the win32 build, I cleaned up a bunch (although not
all) of the warnings with the 64-bit build.
Merge pull request #595 from arrbee/new-errors-odb

Update odb code to new error handling
Make git_path_root() cope with windows network paths

Fix libgit2/libgit2sharp#125
Merge pull request #600 from nulltoken/fix/windows-network-paths

Fix windows network paths
Convert attr, ignore, mwindow, status to new errors

Also cleaned up some previously converted code that still had
little things to polish.