Create local refs to prevent pruning

By default git will prune dangling commits more than 2 weeks old. All
the unmerged versions of reviews pushed up more than 2 weeks ago count
as such commits, so we're downloading all the history again and again
each time git-gc --auto ends up being invoked (which is triggered
amongst other things by loose object counts. This leads to random
stalls in gertty when it has to redownload those objects - and this
is obviously worse when offline.

This commit adds refs to prevent this behaviour, but doesn't remove
them at any point. We probably want to facilitate gc of
merged/abandoned/ignored commits at some point. I'm not sure if that
needs to happen in this commit or if it could be added later.

Change-Id: I01c61fd65207fe0dc99208241eefd5d6432c2ad0