remote prune: optimize "dangling symref" check/warning
commite6bea66db6229a0975ebba510a1d2827bf09cb7f
authorJens Lindström <jl@opera.com>
Fri, 23 May 2014 10:30:25 +0000 (23 12:30 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 27 May 2014 19:30:47 +0000 (27 12:30 -0700)
treeb81289073f96aae1f89492b519083c7ccb2ed44b
parentc9e768bb77762765f739fffb5c09d0888f3de20e
remote prune: optimize "dangling symref" check/warning

When 'git remote prune' was used to delete many refs in a repository
with many refs, a lot of time was spent checking for (now) dangling
symbolic refs pointing to the deleted ref, since warn_dangling_symref()
was once per deleted ref to check all other refs in the repository.

Avoid this using the new warn_dangling_symrefs() function which
makes one pass over all refs and checks for all the deleted refs in
one go, after they have all been deleted.

Signed-off-by: Jens Lindström <jl@opera.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/remote.c
refs.c
refs.h