test-lib.sh: introduce test_commit() and test_merge() helpers