mirror of
https://github.com/bluekeyes/go-gitdiff
synced 2026-06-08 13:18:30 +00:00
3772c9eb65
Git does not quote file names containing spaces when generating header lines. However, I misread the Git implementation and thought it used spaces as a name terminator by default, implying that names with spaces would be quoted. Rewrite the the name parsing code to better match Git. Specifically, when both names in a header are not quoted, test all splits to see if any of them produce two equal names. Also account for spaces in file names when parsing file metadata. Finally, allow trailing spaces on file names, which seem to be allowed by Git (although this sounds like a terrible idea to me.)