summaryrefslogtreecommitdiff
path: root/git-prune-script
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-05 00:26:41 (GMT)
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-05-05 00:26:41 (GMT)
commit4feb7a016ae0b237af5e667277fa632326a58eac (patch)
tree0d60c5f906980596cbd3a25a4a7fdb4252252c94 /git-prune-script
parent770896e548d0e68ab120507895e1e878c5ee347c (diff)
downloadgit-4feb7a016ae0b237af5e667277fa632326a58eac.zip
git-4feb7a016ae0b237af5e667277fa632326a58eac.tar.gz
git-4feb7a016ae0b237af5e667277fa632326a58eac.tar.bz2
Make "git-prune-script" take all refs into account.
This avoids pruning the kernel v2.6.11 tree that now has a tag.
Diffstat (limited to 'git-prune-script')
-rwxr-xr-xgit-prune-script4
1 files changed, 3 insertions, 1 deletions
diff --git a/git-prune-script b/git-prune-script
index b6e927a..a24ba61 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