Additionally, according to git-credential, "The list of attributes is terminated by a blank line or end-of-file."

The blank line check in L150 won't work if CR is stripped in L155.