2 # This requires git-manpages and/or git-htmldocs repositories
4 repository=${1?repository}
5 destdir=${2?destination}
6 GIT_MAN_REF=${3?master}
9 for d in "$repository/.git" "$repository"
11 if GIT_DIR="$d" git rev-parse "$GIT_MAN_REF" >/dev/null 2>&1
21 echo >&2 "Neither $repository nor $repository/.git is a repository"
26 GIT_INDEX_FILE=$(pwd)/.quick-doc.$$
27 export GIT_INDEX_FILE GIT_WORK_TREE
28 rm -f "$GIT_INDEX_FILE"
29 trap 'rm -f "$GIT_INDEX_FILE"' 0
31 git read-tree "$GIT_MAN_REF"
32 git checkout-index -a -f --prefix="$destdir"/
36 git ls-tree -r --name-only "$GIT_MAN_REF" |
37 xargs printf "$destdir/%s\n" |
40 rm -f "$GIT_INDEX_FILE"