def id_for_ref(ref)
      return ref if ref.match(/[0-9a-f]{40}/)
      unless @refs.key? ref
        options = { :timeout => false }
        sha = @grit_repo.git.native(:rev_parse, options, "#{ref}^{}")
        @refs[ref] = sha.rstrip
      end
      @refs[ref]
    end
def id_for_ref(ref)
      return ref if ref.match(/[0-9a-f]{40}/)
      unless @refs.key? ref
        options = { :timeout => false }
        sha = @grit_repo.git.native(:rev_parse, options, "#{ref}^{}")
        @refs[ref] = sha.rstrip
      end
      @refs[ref]
    end
Returns the unique identifier for the commit the given reference – like a
 branch name – is pointing to

 Returns the given ref name immediately if it is a full SHA1 commit ID.

 @param [String] ref A symbolic reference name
 @return [String] The SHA1 ID of the commit the reference is pointing to