Something like this:

```csharp
public virtual IEnumerator<IndexNameEntry> GetEnumerator()
{
    int count = Proxy.git_index_name_entrycount(repo.Index.Handle);
    for (int i = 0; i < count; i++)
        yield return this[i];
}
```

It's not so much a "preferred style" as an opportunity to simplify the code a bit. See also `Tree.GetEnumerator()`.