#!/bin/sh
+USAGE='[-n] [--] [<head>...]'
. git-sh-setup
dryrun=
case "$1" in
-n) dryrun=-n echo=echo ;;
--) break ;;
- -*) echo >&2 "usage: git-prune [ -n ] [ heads... ]"; exit 1 ;;
+ -*) usage ;;
*) break ;;
esac
shift;
git-prune-packed $dryrun
-redundant=$(git-pack-redundant --all)
-if test "" != "$redundant"
+if redundant=$(git-pack-redundant --all 2>/dev/null) && test "" != "$redundant"
then
if test "" = "$dryrun"
then