Unify whitespaces to tabs
Merge pull request #1583 from linquize/whitespace

Unify whitespaces to tabs
signature: Lenient when dupping, strict when creating
Fix trailing whitespaces
Fix diff crash when last item is untracked dir

When the last item in a diff was an untracked directory that only
contained ignored items, the loop to scan the contents would run
off the end of the iterator and dereference a NULL pointer.  This
includes a test that reproduces the problem and a fix.
Remove old symlinks before updating

Unlike blob updates, symlink updates cannot be done "in place"
writing over an old symlink.  This means that in checkout when we
realize that we can safely update a symlink, we still need to
remove the old one before writing the new.
Fix checkout of submodules with no .gitmodules

It is possible for there to be a submodule in a repository with
no .gitmodules file (for example, if the user forgot to commit
the .gitmodules file).  In this case, core Git will just create
an empty directory as a placeholder for the submodule but
otherwise ignore it.  We were generating an error and stopping
the checkout.  This makes our behavior match that of core git.
Improve robustness of diff rename detection

Under some strange circumstances, diffs can end up listing files
that we can't actually open successfully.  Instead of aborting
the git_diff_find_similar, this makes it so that those files just
won't be considered as valid rename/copy targets instead.
Use GIT_IDXENTRY_STAGE macro

Since I added the GIT_IDXENTRY_STAGE macro to extract the stage
from a git_index_entry, we probably don't need an internal inline
function to do the same thing.
Merge pull request #1578 from nulltoken/fix/whitespaces

Fix trailing whitespaces
Merge pull request #1588 from arrbee/fixes-for-checkout-and-diff

Bug fixes for checkout and diff
Improve docs for git_index_entry flag masks

The constants for extracting data from git_index_entry flags and
flags_extended are not named in a way that makes it easy to know
where to use each one.  This improves the docs for the flags (and
slightly reorganizes them), so it should be more obvious.
Add APIs to dup and free git_index_entrys

This adds git_index_entry_dup to make a copy of an existing entry
and git_index_entry_free to release the memory of the copy.  It
also updates the documentation for git_index_get_bypath and
git_index_get_byindex to make it clear that the returned structure
should *not* be modified.
Remove entry dup/free functions and fix comments

This removes the functions to duplicate and free copies of a
git_index_entry and updates the comments to explain that you
should just use the public definition of the struct as needed.
Update index.h docs

Move the git_index_entry to the very top, since it provides the
main structure that needs to be understood by the reader, then
move the bitmasks for the flags and the flags_extended under that
since they are details for looking at particular fields of the
structure.
Merge pull request #1579 from arrbee/index-entry-dup-and-free

Index entry dup and free