I also think this would all be much nicer with a strbuf (which would
let us get rid of the magic numbers), but that is a slightly larger
refactor:
Using a strbuf makes sense. One wrinkle, I think, is that with
transfer.fsckobjects enabled, index-pack can emit dangling .gitmodules
OIDs after the initial pack/keep line, which parse_gitmodules_oids()
still needs to read from cmd.out. Would strbuf_getwholeline_fd() be a
better fit here, so we don't consume those with strbuf_read()?
I'll also fix the --index-pack-args documentation while rerolling.
Thanks,
Ted