1
0
mirror of https://github.com/oskar456/dzonegit.git synced 2024-05-11 05:55:41 +00:00

Fix crash of post-receive when checkout directory does not exist

This commit is contained in:
Ondřej Caletka
2018-08-16 10:32:22 +02:00
parent 8d99e86222
commit 9923df14b7
3 changed files with 4 additions and 2 deletions

View File

@ -434,6 +434,7 @@ def post_receive(stdin=sys.stdin):
raise SystemExit("Checkout path not defined. Nothing to do.")
print("Checking out repository into {}".format(checkoutpath))
Path(checkoutpath).mkdir(parents=True, exist_ok=True)
subprocess.run(
["git", "checkout", "-f", "master"],
check=True,