add CLAN_NO_COMMIT env var to disable committing

This is required when calling vars generators for generating vars for
tests
This commit is contained in:
DavHau
2025-04-07 18:59:11 +07:00
parent d57522f9fe
commit d7c3039666

View File

@@ -1,3 +1,4 @@
import os
from pathlib import Path
from .cmd import Log, RunOpts, run
@@ -27,6 +28,8 @@ def commit_files(
repo_dir: Path,
commit_message: str | None = None,
) -> None:
if os.environ.get("CLAN_NO_COMMIT", None):
return
if not file_paths:
return
# check that the file is in the git repository