Staging
v0.5.1
https://github.com/git/git
Revision 1ed91937e5cd59fdbdfa5f15f6fac132d2b21ce0 authored by Junio C Hamano on 15 December 2005, 01:30:03 UTC, committed by Junio C Hamano on 15 December 2005, 01:30:03 UTC
Oh, I hate to do this but I ended up merging big usage string
cleanups from Fredrik, git-am enhancements that made a lot of
sense for non mbox users from HPA, and rebase changes (done
independently by me and Lukas) among other things, so git is
still in perpetual state of 1.0rc.  1.0 will probably be next
Wednesday, but who knows.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2 parent s a957207 + 294c695
Raw File
Tip revision: 1ed91937e5cd59fdbdfa5f15f6fac132d2b21ce0 authored by Junio C Hamano on 15 December 2005, 01:30:03 UTC
GIT 0.99.9n aka 1.0rc6
Tip revision: 1ed9193
git-prune.sh
#!/bin/sh

USAGE='[-n] [--] [<head>...]'
. git-sh-setup

dryrun=
echo=
while case "$#" in 0) break ;; esac
do
    case "$1" in
    -n) dryrun=-n echo=echo ;;
    --) break ;;
    -*) usage ;;
    *)  break ;;
    esac
    shift;
done

sync
case "$#" in
0) git-fsck-objects --full --cache --unreachable ;;
*) git-fsck-objects --full --cache --unreachable $(git-rev-parse --all) "$@" ;;
esac |

sed -ne '/unreachable /{
    s/unreachable [^ ][^ ]* //
    s|\(..\)|\1/|p
}' | {
	cd "$GIT_OBJECT_DIRECTORY" || exit
	xargs $echo rm -f
	rmdir 2>/dev/null [0-9a-f][0-9a-f]
}

git-prune-packed $dryrun

redundant=$(git-pack-redundant --all)
if test "" != "$redundant"
then
	if test "" = "$dryrun"
	then
		echo "$redundant" | xargs rm -f
	else
		echo rm -f "$redundant"
	fi
fi
back to top