commit.c: allow set_commit_buffer to handle arbitrary repositories