That piqued my curiousity, and I had to dig up the relevant commit: https://github.com/git/git/commit/bb84735c80.
It deals with wrapping an integer index around after incrementing it, the old code just used ++index and a bitmask, the new code uses + 1 and modulo.
I have problems understanding this right now, in my world ++index for an int really shouldn't trigger overflow when counting to at most 4, on any (sem-)realistic environment?
Feeling extra dense, must have more coffee.