Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-03-17 03:53:07 +0300
committerJunio C Hamano <gitster@pobox.com>2022-03-17 03:53:07 +0300
commit6969ac64bf1c7bc43e897d6bfe7d2450d37e9aa9 (patch)
tree282ec839d4f21b10780f3942460e2103a77b98ff /builtin/remote.c
parent47e0380289b4d60c6fc6a86935686233113aa001 (diff)
parent0a7b38707d5d5c8a7baeb88a85d6259cee4f4e4d (diff)
Merge branch 'ps/fetch-mirror-optim'
Various optimization for "git fetch". * ps/fetch-mirror-optim: refs/files-backend: optimize reading of symbolic refs remote: read symbolic refs via `refs_read_symbolic_ref()` refs: add ability for backends to special-case reading of symbolic refs fetch: avoid lookup of commits when not appending to FETCH_HEAD upload-pack: look up "want" lines via commit-graph
Diffstat (limited to 'builtin/remote.c')
-rw-r--r--builtin/remote.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/builtin/remote.c b/builtin/remote.c
index 6f27ddc47b..0142ed09b5 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -766,13 +766,15 @@ static int mv(int argc, const char **argv)
for_each_ref(read_remote_branches, &rename);
for (i = 0; i < remote_branches.nr; i++) {
struct string_list_item *item = remote_branches.items + i;
- int flag = 0;
+ struct strbuf referent = STRBUF_INIT;
- read_ref_full(item->string, RESOLVE_REF_READING, NULL, &flag);
- if (!(flag & REF_ISSYMREF))
+ if (refs_read_symbolic_ref(get_main_ref_store(the_repository), item->string,
+ &referent))
continue;
if (delete_ref(NULL, item->string, NULL, REF_NO_DEREF))
die(_("deleting '%s' failed"), item->string);
+
+ strbuf_release(&referent);
}
for (i = 0; i < remote_branches.nr; i++) {
struct string_list_item *item = remote_branches.items + i;