Created
July 10, 2020 08:28
-
-
Save minrk/7a65c9763adc1b24e18a058661b95939 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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