Crit::Services::RepoService
Repository service class
Provides Git-specific operations for repositories such as listing files, getting file content, and listing branches. This service layer interacts with Git commands to perform operations on repositories.
Example
# List files in a repository
files = Crit::Services::RepoService.list_files("my-project", "master")
Constants
Class methods
Gets file content for a specific file in a repository
@param repo_name [String] The name of the repository @param ref [String] The Git reference (branch, tag, or commit) @param path [String] The path to the file within the repository @return [String] The content of the file @return [Nil] If the repository or file doesn't exist
Gets list of branches for a repository
@param repo_name [String] The name of the repository @return [Array<String>] Array of branch names @return [Array<String>] Empty array if the repository doesn't exist or has no branches
Gets file listing for a repository at a specific path and reference
@param repo_name [String] The name of the repository @param ref [String] The Git reference (branch, tag, or commit) @param path [String] The path within the repository @return [Array<{type: String, mode: String, hash: String, name: String}>] Array of file entries @return [Nil] If the repository or path doesn't exist