Add internal function to create commit

Signed-off-by: Stefan Widgren <stefan.widgren@gmail.com>