# - otherwise git gc is called
set -e
-topdir=$(rpm -E %_topdir)
+CALL_GC=${CALL_GC:-'no'}
+
+topdir="${1:-$(rpm -E %_topdir)}"
+topdir=$(readlink -f "$topdir")
purgedir=$topdir/purged
cd "$topdir"
+echo "Purging in $topdir, press ENTER to continue"
+read a
+
if [ -d "$purgedir" ]; then
echo >&2 "Previous pruge dir exists: $purgedir, remove it to resume"
exit 1
# FIXME: does not currently handle if some pushes are not made!
if [ -n "$status" ] || [ -n "$stash" ]; then
cat <<-EOF
- * Package $pkg - Untracked files or stash not empty. Invoke gc
+ * Package $pkg - Untracked files or stash not empty.
$status
EOF
purge='no'
- git gc
+ [ "$CALL_GC" != 'no' ] && git gc
fi
git show-ref --heads |\
{ while read sha1 branch; do