Mention post-update when we first talk about publishing a repository.
[git/jnareb-git/bp-gitweb.git] / git-prune-script
blob2e130c7f9698729f471edbdfdf9a3cce63c56ddd
1 #!/bin/sh
3 . git-sh-setup-script || die "Not a git archive"
5 dryrun=
6 echo=
7 while case "$#" in 0) break ;; esac
8 do
9 case "$1" in
10 -n) dryrun=-n echo=echo ;;
11 --) break ;;
12 -*) echo >&2 "usage: git-prune-script [ -n ] [ heads... ]"; exit 1 ;;
13 *) break ;;
14 esac
15 shift;
16 done
18 git-fsck-cache --full --cache --unreachable "$@" |
19 sed -ne '/unreachable /{
20 s/unreachable [^ ][^ ]* //
21 s|\(..\)|\1/|p
22 }' | {
23 cd "$GIT_OBJECT_DIRECTORY" || exit
24 xargs $echo rm -f
27 git-prune-packed $dryrun