Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork940
Open
Labels
Description
I suspect the culprit of the crash is the GIT_AUTHOR_DATE. If I remove this before starting my script it works. I already passexpand_vars=False
, but that isn't passed far enough down to make a differance.
My current workaround is to nulke the enviroment variables when invoking my script by usingenv -i <script>
from the commit hook.
My ideal solution would be a flag to disable the copy of the os environ ongit/cmd.py:699. This will not only eliminate this issue, but also any potential other interferance (think GIT_DIR and friends).
Replicate via:
export GIT_INDEX_FILE='.git/index'export GIT_AUTHOR_DATE='@1574863356 +0100'export GIT_EXEC_PATH='/usr/lib/git-core'export GIT_AUTHOR_EMAIL='admin@dries007.net'export GIT_PREFIX=''export GIT_AUTHOR_NAME='Dries'python3
importtempfileimportgitdefmain():withtempfile.TemporaryDirectory()asfolder:repo=git.Repo.init(folder,expand_vars=False)repo.index.commit("Init test repo with empty commit.")repo.head.reference=repo.create_head("master")if__name__=="__main__":main()
Thanks,
Dries