module Gitlab::Client::RepositoryFile

Overview

Defines methods related to repository.

See https://docs.gitlab.com/ce/api/repository_files.html

Direct including types

Defined in:

gitlab/client/repository_file.cr

Instance Method Summary

Instance Method Detail

def file_contents(project_id : Int32, filepath : String, sha = "HEAD") : String #

Get the raw file contents for a file by commit SHA and path.

  • param [Int32] project The ID of a project.
  • param [String] filepath The path and name of a file.
  • param [String] sha The id of a commit sha.
  • return [String] The raw file contents
client.file_contents(1, "README.md")
client.file_contents(1, "src/gitlab.cr", "a5c805f456f46b44e270f342330b06e06c53cbcc")

[View source]
def get_file(project_id : Int32, filepath : String, ref = "HEAD") #

Gets a repository file.

  • param [Int32] project The ID or name of a project.
  • param [String] file_path The full path of the file.
  • param [String] ref The name of branch, tag or commit.
  • return [JSON::Any]
client.get_file(42, "README.md")
client.get_file(42, "README.md", "develop")

[View source]