Something went wrong. Try again.
small gleam coding and persistent agent daemon with a detachable cli and a canvas ui forked from okami.mom/albedo
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849"""Run fixture Git/JJ commands without developer configuration or hooks."""
import osimport subprocessimport tempfile
def sh(cwd, *args): # Clear repository discovery, config injection, signing and identity overrides. # Keep PATH and the Nix toolchain environment so the real binaries still run. env = { key: value for key, value in os.environ.items() if not key.startswith(("GIT_", "JJ_", "XDG_")) and key != "HOME" } with tempfile.TemporaryDirectory(prefix="albedo-vcs-home-") as home: env.update( HOME=home, XDG_CONFIG_HOME=home, XDG_CACHE_HOME=home, XDG_DATA_HOME=home, XDG_STATE_HOME=home, GIT_CONFIG_NOSYSTEM="1", GIT_CONFIG_GLOBAL=os.devnull, GIT_AUTHOR_NAME="fixture", GIT_AUTHOR_EMAIL="fixture@example.com", GIT_COMMITTER_NAME="fixture", GIT_COMMITTER_EMAIL="fixture@example.com", JJ_CONFIG=os.devnull, JJ_USER="fixture", JJ_EMAIL="fixture@example.com", ) if args[0] == "git": args = ( "git", "-c", "commit.gpgsign=false", "-c", "tag.gpgsign=false", "-c", f"core.hooksPath={os.devnull}", *args[1:], ) elif args[0] == "jj": args = ("jj", "--config", 'signing.behavior="drop"', *args[1:]) return subprocess.run( args, cwd=cwd, env=env, check=True, capture_output=True, text=True ).stdout