def cat_file_contents(object, &block)
      assert_args_are_not_options('object', object)

      if block_given?
        Tempfile.create do |file|
          # If a block is given, write the output from the process to a temporary
          # file and then yield the file to the block
          #
          command('cat-file', "-p", object, out: file, err: file)
          file.rewind
          yield file
        end
      else
        # If a block is not given, return the file contents as a string
        command('cat-file', '-p', object)
      end
    end
Output the contents or other properties of one or more objects.

@see https://git-scm.com/docs/git-cat-file git-cat-file

@example Get the contents of a file without a block
lib.cat_file_contents('README.md') # => "This is a README file\n"

@example Get the contents of a file with a block
lib.cat_file_contents('README.md') { |f| f.read } # => "This is a README file\n"

@param object [String] the object whose contents to return

@return [String] the object contents

@raise [ArgumentError] if object is a string starting with a hyphen