setup: introduce the discover_git_directory() function