Optimizing reference deletions in Git