29 echo "${0##*/} GIT_REPO_URL [-d CLONE_DIRECTORY] [-o ORIGIN_NAME] [-b BRANCH] PATH [PATH [PATH ...]]"
33 echo "${0##*/}: invalid option: $1" >&2
37 if [ "${repourl:-}" = "" ]
48 repourlnoslash
=${repourl%%/}
49 reponame
=${repourlnoslash##*/}
50 dir
="${dir:-$reponame}"
57 trap clean SIGINT SIGQUIT SIGTERM
63 git config core.sparseCheckout true
64 git remote add
"$remote" "$repourl"
65 git fetch
--depth=$depth "$remote" "$branch:$branch"
66 for path
in "${paths[@]}"
68 #[ "${path: -1}" = / ] && path="$path*"
69 echo "$path" >> .git
/info
/sparse-checkout
71 git checkout
"$branch"