set_git_dir: handle feeding gitdir to itself