Git creates broken references on hard-restart
When hard-rebooting machines, we often see broken refs created by Git. While Git uses lockfiles to write new refs and then moves them into place, it seems like Git doesn't flush the lockfiles to disk first before committing them. This is the most likely root cause of why we have these empty refs.