]> git.ipfire.org Git - thirdparty/git.git/commit
branch: expose helpers for finding the remote owning a tracking ref
authorHarald Nordgren <haraldnordgren@gmail.com>
Sat, 23 May 2026 19:48:33 +0000 (19:48 +0000)
committerJunio C Hamano <gitster@pobox.com>
Sun, 24 May 2026 08:35:40 +0000 (17:35 +0900)
commitae051d96118a684bdee3548fb58c2cb33a2fa8d9
tree5beeeab1c52b4c88de2176bcb9e6181294ef5f01
parent94f057755b7941b321fd11fec1b2e3ca5313a4e0
branch: expose helpers for finding the remote owning a tracking ref

The remote-lookup that setup_tracking() does is useful outside
branch.c too; for example, deciding which remote to "git fetch"
from given a remote-tracking ref.

Move 'struct tracking' to branch.h and add two helpers backed by the
existing for_each_remote walk: find_tracking_remote_for_ref() and
advise_ambiguous_fetch_refspec(). setup_tracking() uses both. No
behavior change.

Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
branch.c
branch.h