make the permission update function idempotent

--HG--
extra : source : e42e1d4e1c473a29024845e88530f5a8ee2f7ce1
fixed some unicode problems with git file path

--HG--
extra : source : 63adb3d5233a3d56d5b918ed7a118f1115cba5cb
fix broken handling of adding an htsts.
Modifing response/request was having trouble in some redirect cases

--HG--
extra : source : 4ed55c851d1cf6d564b7213ac6dc3a28a3a51f14
backported redirection loop fix from beta ref: 222e9432298e
fixed issue with web-editor that didn't preserve executable bit
after editing files

--HG--
extra : source : 14a6e9ffd9c8af65662822340150b18aff0c7686