Detect branch better when getting git revision information