untangle nested comprehension by using intermediate vars

This seemed like the only ugly part in the entire codebase.
The variable names were the best I could come up with after skimming the pygit2 docs; feel free to rename them.