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:
@ -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:
|
||||||
|
@ -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):
|
||||||
|
Reference in New Issue
Block a user