class

Carbon::VCS::Mock

Inherits Carbon::VCS::Base < Reference < Object

Constructors

new(commit_count : Int32 = 0, head_hash : String | Nil = "abc1234", branch_name : String | Nil = "main", root : String | Path = "/mock/repo", dirty : Bool = false, initialized : Bool = true)
Source

Instance methods

branch_name

The name of the active branch

Source
branch_name=(branch_name : String | Nil)
Source
commit_count

Total count of commits in the current branch history

Source
commit_count=(commit_count : Int32)
Source
dirty
Source
dirty=(dirty : Bool)
Source
dirty?

Returns true if working directory has uncommitted or untracked changes

Source
head_hash

The current HEAD commit hash (short or full)

Source
head_hash=(head_hash : String | Nil)
Source
initialized
Source
initialized=(initialized : Bool)
Source
initialized?

Returns true if VCS repository is properly initialized

Source
repo_root

Root directory of the repository

Source
repo_root=(repo_root : Path)
Source
stage(files : Enumerable(String | Path)) : Bool

Stage a set of files into index

Source
staged_files
Source
staged_files=(staged_files : Array(String))
Source
vcs_dir

Internal directory storing VCS metadata (e.g. .git)

Source
vcs_dir=(vcs_dir : Path)
Source