parse_commit_buffer: tighten checks while parsing