Commit c9e768b
remote: repack packed-refs once when deleting multiple refs
When 'git remote rm' or 'git remote prune' were used in a repository
with many refs, and needed to delete many remote-tracking refs, a lot
of time was spent deleting those refs since for each deleted ref,
repack_without_refs() was called to rewrite packed-refs without just
that deleted ref.
To avoid this, call repack_without_refs() first to repack without all
the refs that will be deleted, before calling delete_ref() to delete
each one completely. The call to repack_without_ref() in delete_ref()
then becomes a no-op, since packed-refs already won't contain any of
the deleted refs.
Signed-off-by: Jens Lindström <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>1 parent b07bdd3 commit c9e768b
3 files changed
+21
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
749 | 749 | | |
750 | 750 | | |
751 | 751 | | |
| 752 | + | |
752 | 753 | | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
753 | 761 | | |
754 | 762 | | |
755 | 763 | | |
756 | | - | |
757 | 764 | | |
758 | | - | |
| 765 | + | |
759 | 766 | | |
760 | 767 | | |
| 768 | + | |
761 | 769 | | |
762 | 770 | | |
763 | 771 | | |
| |||
1305 | 1313 | | |
1306 | 1314 | | |
1307 | 1315 | | |
| 1316 | + | |
1308 | 1317 | | |
1309 | 1318 | | |
1310 | 1319 | | |
| |||
1318 | 1327 | | |
1319 | 1328 | | |
1320 | 1329 | | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
1321 | 1337 | | |
1322 | 1338 | | |
1323 | 1339 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2431 | 2431 | | |
2432 | 2432 | | |
2433 | 2433 | | |
2434 | | - | |
| 2434 | + | |
2435 | 2435 | | |
2436 | 2436 | | |
2437 | 2437 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
| 136 | + | |
135 | 137 | | |
136 | 138 | | |
137 | 139 | | |
| |||
0 commit comments