magit-git-{true,false}: new functions
magit-bare-repo-p: new function
magit-file-relative-name: sanitize
magit-get-top-dir: also function inside git control directory
don't pass default-directory to magit-get-top-dir

Because `default-directory' is used as the default when no FILE is
explicitly specified.