- # old mode $4
- (?:^old mode\x20(100644|120000|100755)$LF)?
-
- # ignore other info
- (?:^(?:copy|rename|deleted|dissimilarity|similarity).*$LF)?
-
- # new mode (possibly new file) ($5)
- (?:^new\x20(?:file\x20)?mode\x20(100644|120000|100755)$LF)?
-
- # ignore other info
- (?:^(?:copy|rename|deleted|dissimilarity|similarity).*$LF)?
+ (?:^(?: # pass all this to git-apply:
+ # old mode $4
+ (?:old\x20mode\x20($MODE))
+ |
+ # new mode (possibly new file) ($5)
+ (?:new\x20(?:file\x20)?mode\x20($MODE))
+ |
+ (?:(?:copy|rename|deleted|
+ dissimilarity|similarity)$ANY)
+ )$LF)*