Honor umask when setting file permission of file read from git repository
In git, there are only two (generic) file permissions: regular and executable. When a virtual file is created from the git repository, the file mode should be set to a value that takes the system umask value into account. In other words:
- regular file:
0o100666 & ~process.umask()
- executable file:
0o100777 & ~process.umask()
For more details, see https://x-team.com/blog/file-system-permissions-umask-node-js/