X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=git-prune.sh;h=1fd8c731cdd3651e3cd3c527915db7a4c4324be0;hb=bf3e274873e56d7df25d60800c8d59a309e0d8c6;hp=ef31bd2a6824104ba401bffbe41ecd50a81780e9;hpb=41f222e87a9062833712367d66114cae90b3769a;p=git.git diff --git a/git-prune.sh b/git-prune.sh index ef31bd2a..1fd8c731 100755 --- a/git-prune.sh +++ b/git-prune.sh @@ -1,6 +1,6 @@ #!/bin/sh -. git-sh-setup || die "Not a git archive" +. git-sh-setup dryrun= echo= @@ -27,3 +27,14 @@ sed -ne '/unreachable /{ } 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