shlib: add and use clear_stale_ref_locks function
commit1eeb12756ba5fb8a4b4802ad3931f99e64ffda2a
authorKyle J. McKay <mackyle@gmail.com>
Fri, 26 Jun 2020 08:06:29 +0000 (26 01:06 -0700)
committerKyle J. McKay <mackyle@gmail.com>
Fri, 26 Jun 2020 08:06:29 +0000 (26 01:06 -0700)
tree2e1fb8298f4d5c28c93a57f5b7e9219bdd2da64c
parent18e1389dc8003194d32d3ede20b44736f8385157
shlib: add and use clear_stale_ref_locks function

If git is killed during a ref update operation, it may leave behind
a ref lock file.

Add a new clear_stale_ref_locks function to find and remove
any of these stale left-behind *.lock files.

Call clear_stale_ref_locks as part of the "remove_crud" operation
durin gc, part of the cleanup operation when restarting a failed
clone and as part of the cleanup operation before doing a mirror
update.

Since Girocco now makes it a point to (mostly) maintain refs in
a packed state, the check and removal will always be relatively
quick and cheap to do.

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