RestrictToDirectory - kind of chroot for ungit

implemented like "ensurePathExists", just as you asked, hope it is ok and that I found every use of a path, would be nice if you could check, just to be sure i didn't miss something....