climate_ref.cli._git_utils
#
Git utilities for CLI commands.
FileInfo
#
Bases: TypedDict
Information about a file in the regression directory.
Source code in packages/climate-ref/src/climate_ref/cli/_git_utils.py
collect_regression_file_info(regression_dir, repo, size_threshold_bytes)
#
Collect file information from a regression directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
regression_dir
|
Path
|
Path to the regression data directory |
required |
repo
|
Repo | None
|
Git repository object, or None if not in a repo |
required |
size_threshold_bytes
|
int
|
Files larger than this will be flagged as large |
required |
Returns:
| Type | Description |
|---|---|
list[FileInfo]
|
List of dicts with keys: rel_path, size, is_large, git_status |
Source code in packages/climate-ref/src/climate_ref/cli/_git_utils.py
get_repo_for_path(path)
#
Get the git repository containing the given path.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
Path
|
Path to a file or directory |
required |
Returns:
| Type | Description |
|---|---|
Repo | None
|
The Repo object if path is within a git repository, None otherwise |