3 while case "$#" in 0) break ;; esac
8 -*) echo >&2 "usage: git-prune-script [ -n ] [ heads... ]"; exit 1 ;;
14 # Defaulting to include .git/refs/*/* may be debatable from the
15 # purist POV but power users can always give explicit parameters
16 # to the script anyway.
20 x_40
='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
21 x_40
="$x_40$x_40$x_40$x_40$x_40$x_40$x_40$x_40"
22 set x $
(sed -ne "/^$x_40\$/p" .git
/HEAD .git
/refs
/*/* 2>/dev
/null
)
26 git-fsck-cache
--cache --unreachable "$@" |
27 sed -ne '/unreachable /{
28 s/unreachable [^ ][^ ]* //
31 for d
in "$GIT_OBJECT_DIRECTORY" "$SHA1_FILE_DIRECTORY" ''
33 test "$d" != "" && test -d "$d" && break
36 '') cd .git
/objects
/ ;;
39 xargs -r $dryrun rm -f