#!/bin/sh

# Go to niceness class 'idle'
if [ -x /usr/bin/ionice ] &&
	/usr/bin/ionice -c3 true 2>/dev/null; then
	IONICE="/usr/bin/ionice -c3"
fi

# From now, abort on first error
set -e

while [ $# -gt 0 ]
do
	cd "$1"
	$IONICE git gc --aggressive --quiet
	shift
done
