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

2 Commits
v0.4 ... v0.5

Author SHA1 Message Date
Ondřej Caletka
9923df14b7 Fix crash of post-receive when checkout directory does not exist 2018-08-16 10:35:07 +02:00
Ondřej Caletka
8d99e86222 Travis: allow failures of the nightly build 2018-08-15 14:09:57 +02:00
4 changed files with 7 additions and 2 deletions

View File

@@ -5,6 +5,9 @@ python:
- "3.5"
- "3.6"
- "nightly"
matrix:
allow_failures:
- python: "nightly"
install:
- pip install -e .
- pip install pytest

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,

View File

@@ -5,7 +5,7 @@ readme = Path(__file__).with_name("README.rst").read_text()
setup(
name="dzonegit",
version="0.4",
version="0.5",
description="Git hooks to manage a repository of DNS zones",
long_description=readme,
long_description_content_type="text/x-rst",

View File

@@ -280,13 +280,14 @@ def test_post_receive(git_dir):
head,
)
stdin = StringIO(revisions)
codir = git_dir.mkdir("co")
codir = git_dir.join("co")
subprocess.call(["git", "config", "dzonegit.checkoutpath", str(codir)])
subprocess.call([
"git", "config", "dzonegit.reconfigcmd",
"echo TEST >{}/test".format(codir),
])
dzonegit.post_receive(stdin)
dzonegit.post_receive(stdin) # Check coping with existing codir
assert codir.join("dummy.zone").check()
assert codir.join("test").read() == "TEST\n"