Staging
v0.5.1
https://github.com/git/git
Revision 91dd674e30ba0298e89c9be2657024805170c2ac authored by Junio C Hamano on 02 October 2005, 19:56:31 UTC, committed by Junio C Hamano on 02 October 2005, 23:07:29 UTC
GIT already did everything I wanted it to do since mid 0.99.7,
and it has almost everything I want it to have now, except a
couple of minor tweaks and enhancements.

Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent a2775c2
Raw File
Tip revision: 91dd674e30ba0298e89c9be2657024805170c2ac authored by Junio C Hamano on 02 October 2005, 19:56:31 UTC
GIT 0.99.8
Tip revision: 91dd674
git-prune.sh
#!/bin/sh

. git-sh-setup || die "Not a git archive"

dryrun=
echo=
while case "$#" in 0) break ;; esac
do
    case "$1" in
    -n) dryrun=-n echo=echo ;;
    --) break ;;
    -*) echo >&2 "usage: git-prune [ -n ] [ heads... ]"; exit 1 ;;
    *)  break ;;
    esac
    shift;
done

git-fsck-objects --full --cache --unreachable "$@" |
sed -ne '/unreachable /{
    s/unreachable [^ ][^ ]* //
    s|\(..\)|\1/|p
}' | {
	cd "$GIT_OBJECT_DIRECTORY" || exit
	xargs $echo rm -f
}

git-prune-packed $dryrun
back to top