Add support for ** matches in ignores

This is an experimental addition to add ** support to fnmatch
pattern matching in libgit2.  It needs more testing.
More ** tests for pattern rules
Fix fnmatch comment to be clearer
Merge pull request #2249 from libgit2/rb/starstar-fnmatch

Add support for ** matches in ignores
git_repository_state_cleanup() should remove rebase-merge/, rebase-apply/ and BISECT_LOG
Fix bug with multiple iconv conversions in one dir

The internal buffer in the `git_path_iconv_t` structure was not
being reset before the calls to `iconv` were made to convert data,
so if there were multiple decomposed Unicode paths in a single
directory, paths after the first one were being appended to the
first instead of treated as independent data.
vmg is always right
Merge pull request #2255 from libgit2/rb/fix-multiple-nfd-iconv-bug

Fix bug with multiple iconv conversions in one dir
Correct grouping of parentheses

git_graph_descendant_of was returning the result of an assignment
Added a no path test for git_graph_descendant_of
Merge pull request #2256 from jacquesg/graph-descendant

Correct grouping of parentheses
graph: handle not finding a merge base gracefully

git_merge_base() returns GIT_ENOTFOUND when it cannot find a merge
base. graph_desdendant_of() returns a boolean value (barring any
errors), so it needs to catch the NOTFOUND return value and convert it
into false, as not merge base means it cannot be a descendant.
Update submodules with parent-tracked content

This updates how libgit2 treats submodule-like directories that
actually have tracked content inside of them.  This is a strange
corner case, but it seems that many people have abortive submodule
setups and then just went ahead and added the files into the
parent repository.  In this case, we should just treat the
submodule as if it was a normal directory.

Libgit2 will still try to skip over real submodules and contained
repositories that do not have tracked files inside them, but this
adds some new handling for cases where the apparently submodule
data is in conflict with the actual list of tracked files.
userdiff: update C/C++ patterns

This pulls upstream changes from:

  git/git@8a2e8da367f7175465118510b474ad365161d6b1

  git/git@abf8f9860248d8c213600974742f18dadaa8fbb5

  git/git@407e07f2a6f55e605fda9e90cb622887269f68b5

all by Johannes Sixt <j6t@kdbg.org>.
userdiff: update ada patterns

This is the moral equivalent of

  git/git@39a87a29ce364ed3337e535adce5973731ba2968

from Adrian Johnson <ajohnson@redneon.com>.
Merge pull request #2258 from libgit2/jk/userdiff-cc

pull userdiff pattern updates from git.git
Merge pull request #2257 from libgit2/rb/fix-submodules-with-tracked-content

Update treatment of submodule-like directories with tracked content in the parent
Rewrite `git_repository__cleanup_files`
Merge pull request #2259 from libgit2/vmg/state-cleanup

Rewrite `state-cleanup`
Fix bug popping ignore files during wd iteration

There were a couple bugs in popping ignore files during iteration
that could result in incorrect decisions be made and thus ignore
files below the root either not being loaded correctly or not
being popped at the right time.

One bug was an off-by-one in comparing the path of the gitignore
file with the path being exited during iteration.

The second bug was not correctly truncating the path being tracked
during traversal if there were no ignores on the list (i.e. when
you have no .gitignore at the root, but do have some in contained
directories).