`git_iterator_for_tree` will automatically create a `git_iterator_for_nothing` if you pass a NULL value for the tree, so I don't think you need this line.

Also, of course, the iterator API has changed a bit since this code was written. I removed the short versions of the iterator constructor functions, so you'll probably have to write:

```c
error = git_iterator_for_tree(
    &iterators[TREE_IDX_ANCESTOR],
    (git_tree *)ancestor_tree,
    GIT_ITERATOR_DONT_IGNORE_CASE, NULL, NULL);
```

I put the explicit `GIT_ITERATOR_DONT_IGNORE_CASE` in there because the new iterator code will automatically create a case-insensitive tree iterator if the index of the repository is currently set to be case insensitive, and I'm guessing that you will want to force case-sensitive ordering here.

By the way, you can also force the iterator to include tree entries if you want now, but it looks like that isn't necessary for this code.