git-sh-setup: move GIT_DIR initialization into a function