3 while case "$#" in 0) break ;; esac
8 -*) echo >&2 "usage: git-prune-script [ -n ] [ heads... ]"; exit 1 ;;
15 : ${GIT_OBJECT_DIRECTORY="${SHA1_FILE_DIRECTORY-"$GIT_DIR/objects"}"}
17 # Defaulting to include .git/refs/*/* may be debatable from the
18 # purist POV but power users can always give explicit parameters
19 # to the script anyway.
23 x_40
='[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]'
24 x_40
="$x_40$x_40$x_40$x_40$x_40$x_40$x_40$x_40"
25 set x $
(sed -ne "/^$x_40\$/p" \
26 "$GIT_DIR"/HEAD
"$GIT_DIR"/refs
/*/* /dev
/null
2>/dev
/null
)
30 git-fsck-cache
--cache --unreachable "$@" |
31 sed -ne '/unreachable /{
32 s/unreachable [^ ][^ ]* //
35 cd "$GIT_OBJECT_DIRECTORY" ||
exit
36 xargs -r $dryrun rm -f