Fix git permissions

1) Parse git file permissions and retain them.
2) We do not have a dart API to access the real permission of files. Thus for new files, the default file permissions are assumed. 

Fixes #2465 

@devoncarew PTAL thanks.