From: Linus Torvalds Date: Thu, 5 May 2005 00:26:41 +0000 (-0700) Subject: Make "git-prune-script" take all refs into account. X-Git-Tag: v0.99~647 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4feb7a016ae0b237af5e667277fa632326a58eac;p=git.git Make "git-prune-script" take all refs into account. This avoids pruning the kernel v2.6.11 tree that now has a tag. --- diff --git a/git-prune-script b/git-prune-script index b6e927a74..a24ba616d 100755 --- a/git-prune-script +++ b/git-prune-script @@ -1,2 +1,4 @@ #!/bin/sh -git-fsck-cache --unreachable $(cat .git/HEAD ) | grep unreachable | cut -d' ' -f3 | sed 's:^\(..\):.git/objects/\1/:' | xargs rm +REFS=$(cat .git/refs/*/*) +[ "$REFS" ] || exit 1 +git-fsck-cache --unreachable $REFS | grep unreachable | cut -d' ' -f3 | sed 's:^\(..\):.git/objects/\1/:' | xargs -r rm