Skip to content

Instantly share code, notes, and snippets.

@minrk

minrk/test.py

Created Jul 10, 2020
Embed
What would you like to do?
import os
from tempfile import TemporaryDirectory
from subprocess import check_call
with TemporaryDirectory() as td:
env = {
"HOME": td,
"GIT_COMMITTER_EMAIL": "test@example.com",
"GIT_COMMITTER_NAME": "test",
"GIT_AUTHOR_EMAIL": "test@example.com",
"GIT_AUTHOR_NAME": "test",
}
os.chdir(td)
check_call(["git", "init"], env=env)
with open("f", "w") as f:
f.write("test")
check_call(["git", "add", "f"], env=env)
check_call(["git", "commit", "-m", "test"], env=env)
print("log")
# check_call(["git", "log", "-1"], env=env)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.