mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Tests: Add failing on-modify hook
- An on-modify hook that reverts all changes (i.e. returns the original task) should result in no changes. Currently the "modified:" attribute gets updated despite no other changes being present.
This commit is contained in:
parent
56aad60a41
commit
5cd1649db2
2 changed files with 38 additions and 0 deletions
20
test/test_hooks/on-modify-revert
Normal file
20
test/test_hooks/on-modify-revert
Normal file
|
@ -0,0 +1,20 @@
|
|||
#!/bin/sh
|
||||
|
||||
# The on-modify event is triggered separately for each task modified. This hook
|
||||
# script can accept/reject the modification. Processing will continue.
|
||||
|
||||
# Input:
|
||||
# - line of JSON for the original task
|
||||
# - line of JSON for the modified task, the diff being the modification
|
||||
read original_task
|
||||
read modified_task
|
||||
|
||||
# Output:
|
||||
# - JSON, modified or unmodified.
|
||||
# - Optional feedback/error.
|
||||
echo $original_task
|
||||
|
||||
# Status:
|
||||
# - 0: JSON accepted, non-JSON is feedback.
|
||||
# - non-0: JSON ignored, non-JSON is error.
|
||||
exit 0
|
Loading…
Add table
Add a link
Reference in a new issue