diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-05-25 23:42:48 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-05-25 23:42:48 (GMT) |
commit | 5ed49a75f3a76731547e8322118a0bea1dd93676 (patch) | |
tree | c4739ce778d332f38a92419ddb6a1c0a2732d98b | |
parent | 3ce9483c1a59277b73fe713504d44cf30d218b43 (diff) | |
parent | f7400da8005e8af979b61ab2f42bb2dacfa656c8 (diff) | |
download | git-5ed49a75f3a76731547e8322118a0bea1dd93676.zip git-5ed49a75f3a76731547e8322118a0bea1dd93676.tar.gz git-5ed49a75f3a76731547e8322118a0bea1dd93676.tar.bz2 |
Merge branch 'os/fetch-check-not-current-branch'
The way "git fetch" without "--update-head-ok" ensures that HEAD in
no worktree points at any ref being updated was too wasteful, which
has been optimized a bit.
* os/fetch-check-not-current-branch:
fetch: limit shared symref check only for local branches
-rw-r--r-- | builtin/fetch.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c index e3791f0..eeee5ac 100644 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@ -1440,6 +1440,7 @@ static void check_not_current_branch(struct ref *ref_map, const struct worktree *wt; for (; ref_map; ref_map = ref_map->next) if (ref_map->peer_ref && + starts_with(ref_map->peer_ref->name, "refs/heads/") && (wt = find_shared_symref(worktrees, "HEAD", ref_map->peer_ref->name)) && !wt->is_bare) |