aboutsummaryrefslogtreecommitdiff
path: root/git-prune-script
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2005-08-19 21:38:36 -0700
committerJunio C Hamano <junkio@cox.net>2005-08-19 21:38:36 -0700
commit51890a64eb152fb914d0dd3676f549ab8d8cc49a (patch)
treec5b6dd555899bca32f456418a05a236a38502c4f /git-prune-script
parent4426ac70a1d15e103bd8a4bd1aa16be16b80c5bc (diff)
downloadgit-51890a64eb152fb914d0dd3676f549ab8d8cc49a.tar.gz
git-51890a64eb152fb914d0dd3676f549ab8d8cc49a.tar.xz
Call prune-packed from "git prune" as well.
Add -n (dryrun) flag to git-prune-packed, and call it from "git prune". Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-prune-script')
-rwxr-xr-xgit-prune-script6
1 files changed, 4 insertions, 2 deletions
diff --git a/git-prune-script b/git-prune-script
index a8e338c48..2e130c7f9 100755
--- a/git-prune-script
+++ b/git-prune-script
@@ -3,10 +3,11 @@
. git-sh-setup-script || die "Not a git archive"
dryrun=
+echo=
while case "$#" in 0) break ;; esac
do
case "$1" in
- -n) dryrun=echo ;;
+ -n) dryrun=-n echo=echo ;;
--) break ;;
-*) echo >&2 "usage: git-prune-script [ -n ] [ heads... ]"; exit 1 ;;
*) break ;;
@@ -20,6 +21,7 @@ sed -ne '/unreachable /{
s|\(..\)|\1/|p
}' | {
cd "$GIT_OBJECT_DIRECTORY" || exit
- xargs $dryrun rm -f
+ xargs $echo rm -f
}
+git-prune-packed $dryrun