diff options
Diffstat (limited to 'manifest_xml.py')
| -rw-r--r-- | manifest_xml.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/manifest_xml.py b/manifest_xml.py index 0c2b45e5..64b7fb4e 100644 --- a/manifest_xml.py +++ b/manifest_xml.py | |||
| @@ -1199,6 +1199,8 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md | |||
| 1199 | if '~' in path: | 1199 | if '~' in path: |
| 1200 | return '~ not allowed (due to 8.3 filenames on Windows filesystems)' | 1200 | return '~ not allowed (due to 8.3 filenames on Windows filesystems)' |
| 1201 | 1201 | ||
| 1202 | path_codepoints = set(path) | ||
| 1203 | |||
| 1202 | # Some filesystems (like Apple's HFS+) try to normalize Unicode codepoints | 1204 | # Some filesystems (like Apple's HFS+) try to normalize Unicode codepoints |
| 1203 | # which means there are alternative names for ".git". Reject paths with | 1205 | # which means there are alternative names for ".git". Reject paths with |
| 1204 | # these in it as there shouldn't be any reasonable need for them here. | 1206 | # these in it as there shouldn't be any reasonable need for them here. |
| @@ -1222,10 +1224,17 @@ https://gerrit.googlesource.com/git-repo/+/HEAD/docs/manifest-format.md | |||
| 1222 | u'\u206F', # NOMINAL DIGIT SHAPES | 1224 | u'\u206F', # NOMINAL DIGIT SHAPES |
| 1223 | u'\uFEFF', # ZERO WIDTH NO-BREAK SPACE | 1225 | u'\uFEFF', # ZERO WIDTH NO-BREAK SPACE |
| 1224 | } | 1226 | } |
| 1225 | if BAD_CODEPOINTS & set(path): | 1227 | if BAD_CODEPOINTS & path_codepoints: |
| 1226 | # This message is more expansive than reality, but should be fine. | 1228 | # This message is more expansive than reality, but should be fine. |
| 1227 | return 'Unicode combining characters not allowed' | 1229 | return 'Unicode combining characters not allowed' |
| 1228 | 1230 | ||
| 1231 | # Reject newlines as there shouldn't be any legitmate use for them, they'll | ||
| 1232 | # be confusing to users, and they can easily break tools that expect to be | ||
| 1233 | # able to iterate over newline delimited lists. This even applies to our | ||
| 1234 | # own code like .repo/project.list. | ||
| 1235 | if {'\r', '\n'} & path_codepoints: | ||
| 1236 | return 'Newlines not allowed' | ||
| 1237 | |||
| 1229 | # Assume paths might be used on case-insensitive filesystems. | 1238 | # Assume paths might be used on case-insensitive filesystems. |
| 1230 | path = path.lower() | 1239 | path = path.lower() |
| 1231 | 1240 | ||
