fix hooks path

+ use fallback instead of catching error
This commit is contained in:
2025-04-08 09:53:28 +02:00
parent 785eb76ca6
commit f28b1bcabd

View File

@@ -81,7 +81,7 @@ def change_to_gitea(doit, *repos):
if write_when_new(doit, '.git/hooks/pre-commit', PRE_COMMIT_HOOK):
dirty = True
helper_script = parser.get('credential', 'helper', fallback=None)
if helper_script != str(gitdir / hooks / 'get_gitea_token'):
if helper_script != str('.git/hooks/get_gitea_token'):
dirty = True
if doit:
os.system(f'git config credential.helper "{os.getcwd()}/.git/hooks/get_gitea_token"')