setup: split off a function to handle ordinary .git directories