use git-fetch --prune

otherwise dead mainlines accumulate, as for example when we changed
branching schemes.

Change-Id: Ia5bcb90a079dc62c3c848d139cef5f6d6e0ccbba
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
optimization: use find -prune

no point in descending into the .git directories.

Change-Id: I6786ae611fe40498500e4260836c84cbe8359b39
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
deal with overzealous garbage collection

every repo should have refs/changes (because fetching changes is the
first thing the bot does after cloning a repo), but with the default
config, gc will pack the refs, and the directory vanishes if no refs
were created for too long (which also breaks our cleanup).
don't error out when that happens.

also document how to avoid that situation to start with.

Change-Id: I92d539785a9810c02263f954d9299169d2fa3f2c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Simo Fält <simo.falt@digia.com>
add support for using gerrit's REST api to sanity bot

Change-Id: Iac47b4480bf427c2524d79484dcf8a9fca22c5a2
Reviewed-by: Simo Fält <simo.falt@digia.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>