Skip to content

Commit 94c46f4

Browse files
Kasper JungeRalphify
authored andcommitted
refactor: use shared SUBPROCESS_TEXT_KWARGS in _shallow_clone
The git clone call in _source.py used bare `text=True` instead of the shared SUBPROCESS_TEXT_KWARGS constant, missing `encoding="utf-8"` and `errors="replace"` that protect against non-decodable output. This aligns it with every other subprocess call in the codebase. Co-authored-by: Ralphify <noreply@ralphify.co>
1 parent d822095 commit 94c46f4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/ralphify/_source.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from pathlib import Path
1616

1717
from ralphify._frontmatter import RALPH_MARKER
18+
from ralphify._output import SUBPROCESS_TEXT_KWARGS
1819

1920

2021
@dataclass(frozen=True)
@@ -106,7 +107,7 @@ def _shallow_clone(repo_url: str, dest: Path) -> None:
106107
subprocess.run(
107108
["git", "clone", "--depth", "1", repo_url, str(dest)],
108109
capture_output=True,
109-
text=True,
110+
**SUBPROCESS_TEXT_KWARGS,
110111
check=True,
111112
)
112113
except FileNotFoundError:

0 commit comments

Comments
 (0)