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

Fix no reconfig command issued on zone file rename.

This commit is contained in:
Ondřej Caletka
2018-08-27 21:59:54 +02:00
parent a7d693253d
commit 9ad1e74a88
2 changed files with 12 additions and 2 deletions

View File

@ -146,7 +146,7 @@ def get_altered_files(against, diff_filter=None, revision=None):
If revision is None, list changes between staging area and If revision is None, list changes between staging area and
revision. Otherwise differences between two revisions are computed. revision. Otherwise differences between two revisions are computed.
""" """
cmd = ["git", "diff", "--name-only", "-z"] cmd = ["git", "diff", "--name-only", "-z", "--no-renames"]
if diff_filter: if diff_filter:
cmd.append("--diff-filter={}".format(diff_filter)) cmd.append("--diff-filter={}".format(diff_filter))
if revision: if revision:

View File

@ -340,9 +340,19 @@ def test_post_receive(git_dir):
"echo TEST >{}/test".format(codir), "echo TEST >{}/test".format(codir),
]) ])
dzonegit.post_receive(stdin) dzonegit.post_receive(stdin)
dzonegit.post_receive(stdin) # Check coping with existing codir
assert codir.join("dummy.zone").check() assert codir.join("dummy.zone").check()
assert codir.join("test").read() == "TEST\n" assert codir.join("test").read() == "TEST\n"
# Test reconfig after renaming the file
codir.join("test").write("")
subprocess.call(["git", "mv", "dummy.zone", "dummy.zone.old"])
subprocess.call(["git", "commit", "-m", "rename dummy zone"])
revisions = "{} {} refs/heads/master\n".format(
head,
dzonegit.get_head(),
)
stdin = StringIO(revisions)
dzonegit.post_receive(stdin)
assert codir.join("test").read() == "TEST\n"
def test_template_config(git_dir): def test_template_config(git_dir):