Make --onto a modifier for --commit

The --onto option overrides the default 'deploy' destination branch.
Only merge HEAD into deploy if necessary

If the destination branch is already up to date, there is no need to
sync the branch. This is the case when the branch is newly created or
when there have been no new commits since the previous merge.
Don't commit build results if unchanged

If the result of building is the same as the destination branch's
current content, don't bother adding an empty commit.
test: support mix of JS and shell based tests
test: replace onto tests with shell script

Shell script performs same basic tests, updated to account for --onto
being a modifier for --commit.
Rename onto internals to syncBranch

Better matches actual behaviour.
Refactor common git ref lookup into utility
test: ensure HEAD is not modified unexpectedly
Silence 'git merge-base'

The invocation and results aren't interesting to end user