setup_git_env: use git_pathdup instead of xmalloc + sprintf