diff options
author | Junio C Hamano <junkio@cox.net> | 2005-08-19 21:38:36 -0700 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2005-08-19 21:38:36 -0700 |
commit | 51890a64eb152fb914d0dd3676f549ab8d8cc49a (patch) | |
tree | c5b6dd555899bca32f456418a05a236a38502c4f /git-prune-script | |
parent | 4426ac70a1d15e103bd8a4bd1aa16be16b80c5bc (diff) | |
download | git-51890a64eb152fb914d0dd3676f549ab8d8cc49a.tar.gz |
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-x | git-prune-script | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/git-prune-script b/git-prune-script index a8e338c488..2e130c7f96 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 |