Instead of calling `git_buf_clear()` and later calling `git_buf_put()`, you can just call `git_buf_set()` below to replace the existing buffer contents.