Open
Description
If a patch creates new file, the file mode is ignored and default permissions (0644) are applied for the created file.
This results in loosing the executable permission for the generated file even though that permission was present in the patch file.
The issue was spotted when using conan's apply_conandata_patches() function which uses patch-ng to implement the patching functionality.
When a patch creates new file, it is generated in this part of the implementation:
Line 914 in 2354804
The 'new file mode' in the patch file is only referenced here in the source, while detecting the patch type:
Line 765 in 2354804
but it is not referenced or consumed further to set the correct file mode of a new generated file.