Fix issue 14240. gitfs pillars broken if you specify more than ext_pillar

A fix in the 2014.1.4 timeframe broke this function. I've fixed it and added some comments that explain why the function behaves as it does, since at first glance it's odd. That is a hint to me that there's some refactoring or cleanup that could be done but that's beyond my expertise right now :)