fix _gitinfo function to avoid ansible crashing in cases where the branch file is missing (e.g. after a gc)