code: def commit(self):
          
          obj = self.object
          while obj.type != 'commit':
              if obj.type == "tag":
                  # it is a tag object which carries the commit as an object - we can point to anything
                  obj = obj.object
              else:
                  raise ValueError(("Cannot resolve commit as tag %s points to a %s object - " +
                                    "use the `.object` property instead to access it") % (self, obj.type))
          return obj
docs: :return: Commit object the tag ref points to
          
          :raise ValueError: if the tag points to a tree or blob