clone/update: optimize ref removal
commit16257b2ef663d7dce3b3d9545962e02c61a2b756
authorKyle J. McKay <mackyle@gmail.com>
Sun, 25 Sep 2016 15:41:36 +0000 (25 08:41 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Sun, 25 Sep 2016 15:41:36 +0000 (25 08:41 -0700)
tree3d46c18fa59da65c0df81fd996912065865fc523
parente0e870443192d41c16d12a35a20076cd1292314a
clone/update: optimize ref removal

The clone operation needs to remove any pre-existing refs before
restarting a clone and also any garbage git-svn refs after an svn
clone.

The update operation needs to remove any garbage git-svn refs after
an update and also unclean refs when switching to a clean mirror.

Calling update-ref once for each ref to be removed is slow and can
be terribly painful when thousands of refs are involved.

Instead use update-ref --stdin and process all the changes at once.

We do, however, provide a slow backwards compatibiliy function so that a
server that for some incomprehensible reason is not running at least Git
version 1.8.5 (when update-ref --stdin functionality was added) can
still operate properly.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
jobd/update.sh
shlib.sh
taskd/clone.sh