-
Notifications
You must be signed in to change notification settings - Fork 133
Closed
Description
Error
C:\Program Files\dotnet\sdk\8.0.114\Sdks\Microsoft.Build.Tasks.Git\build\Microsoft.Build.Tasks.Git.targets(25,5): error : Error reading git repository information: Error parsing config line 13 in file '[Path To Repo]\.git\config': Unexpected character U+005c.
Breakdown
This error originiates from the following switch case which wrongfully throws on the \b escaped character despite that being explicitly mentioned by the git config documentation.
sourcelink/src/Microsoft.Build.Tasks.Git/GitDataReader/GitConfig.Reader.cs
Lines 557 to 589 in 0fceecb
| switch (reader.Peek()) | |
| { | |
| case '\r': | |
| case '\n': | |
| ReadToLineEnd(reader); | |
| continue; | |
| case 'n': | |
| reader.Read(); | |
| builder.Append('\n'); | |
| // escaped \n is not considered trailing whitespace: | |
| lengthIgnoringTrailingWhitespace = builder.Length; | |
| continue; | |
| case 't': | |
| reader.Read(); | |
| builder.Append('\t'); | |
| // escaped \t is not considered trailing whitespace: | |
| lengthIgnoringTrailingWhitespace = builder.Length; | |
| continue; | |
| case '\\': | |
| case '"': | |
| builder.Append((char)reader.Read()); | |
| lengthIgnoringTrailingWhitespace = builder.Length; | |
| continue; | |
| default: | |
| reader.UnexpectedCharacter(c); | |
| break; | |
| } |
The following escape sequences (beside " and \) are recognized: \n for newline character (NL), \t for horizontal tabulation (HT, TAB) and \b for backspace (BS). Other char escape sequences (including octal escape sequences) are invalid.
Metadata
Metadata
Assignees
Labels
No labels