sha_or_commit_from_ref

in lib/rugged_adapter/git_layer_rugged.rb [268:279]


      def sha_or_commit_from_ref(ref, request_kind = nil)
        sha = ref_to_sha(ref)
        return nil if sha.nil?
        object = @repo.lookup(sha)
        if object.kind_of?(Rugged::Commit) then
          return Gollum::Git::Commit.new(object) if request_kind == :commit
          sha
        elsif object.respond_to?(:target)
          sha_or_commit_from_ref(object.target.oid, request_kind)
        end
      end