Extract a method commit_tree().

Its implementation needs to be changed, so centralized how it is called.
Pipe commit message into "git commit-tree" rather than using "-m" option.

The "-m" option was added to Git recently, so use the old-fashioned
method to be portable to older Git versions.
Merge branch 'commit-tree-no-m'

Do not use "git commit-tree -m", because the "-m" option has only
recently been added to Git.