You need a call to `git_index_free(index);` somewhere after this line to make sure the index doesn't leak.