mirror of
https://github.com/caelestia-dots/cli.git
synced 2026-06-18 15:00:00 -05:00
fix: disable git transforming weird chars
Git transforms non ascii and other chars into octal escaped versions, which we don't want
This commit is contained in:
@@ -101,10 +101,12 @@ class DotsSource:
|
|||||||
# --- Helpers ---
|
# --- Helpers ---
|
||||||
|
|
||||||
def _git(self, *args: str) -> str:
|
def _git(self, *args: str) -> str:
|
||||||
return self._run("git", "-C", str(dots_dir), *args)
|
# core.quotePath=false so non-ASCII paths come back verbatim, not octal-escaped
|
||||||
|
return self._run("git", "-C", str(dots_dir), "-c", "core.quotePath=false", *args)
|
||||||
|
|
||||||
def _git_bytes(self, *args: str) -> bytes:
|
def _git_bytes(self, *args: str) -> bytes:
|
||||||
result = subprocess.run(["git", "-C", str(dots_dir), *args], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
cmd = ["git", "-C", str(dots_dir), "-c", "core.quotePath=false", *args]
|
||||||
|
result = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
if result.returncode != 0:
|
if result.returncode != 0:
|
||||||
raise SourceError(result.stderr.decode().strip() or f"git {' '.join(args)} failed")
|
raise SourceError(result.stderr.decode().strip() or f"git {' '.join(args)} failed")
|
||||||
return result.stdout
|
return result.stdout
|
||||||
|
|||||||
Reference in New Issue
Block a user