GitStatus
A class representing the status of a git repository.
Attributes
| Attribute | Type | Description |
|---|---|---|
| is_valid | bool = False | Whether git repository is valid |
| is_tree_clean | bool = False | Whether working tree is clean |
| remote_url | str = "" | Remote URL in HTTPS format |
| repo_dir | Path = Path() | Repository root directory |
| commit_sha | str = "" | Current commit SHA |
Constructor
Signature
def GitStatus(
is_valid: bool = False,
is_tree_clean: bool = False,
remote_url: str = "",
repo_dir: Path = Path(),
commit_sha: str = ""
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| is_valid | bool = False | Whether the git repository is valid |
| is_tree_clean | bool = False | Whether the working tree is clean |
| remote_url | str = "" | Remote URL in HTTPS format |
| repo_dir | Path = Path() | Repository root directory |
| commit_sha | str = "" | Current commit SHA |
Methods
from_current_repo()
@classmethod
def from_current_repo() - > [GitStatus](gitstatus.md?sid=flyte_git__config_gitstatus)
Discover git information from the current repository. If Git is not installed or .git does not exist, returns GitStatus with is_valid=False.
Returns
| Type | Description |
|---|---|
[GitStatus](gitstatus.md?sid=flyte_git__config_gitstatus) | GitStatus instance with discovered git information |
build_url()
@classmethod
def build_url(
path: Path | str,
line_number: int
) - > str
Build a git URL for the given path.
Parameters
| Name | Type | Description |
|---|---|---|
| path | `Path | str` |
| line_number | int | Line number of the code file |
Returns
| Type | Description |
|---|---|
str | Path relative to repo_dir |