◐ Shell
clean mode source ↗

remote: add update_refs with git_refspec by ethomson · Pull Request #6559 · libgit2/libgit2

git shows the remote and local ref information during a fetch. For example:

 * [new branch]          ethomson/nonblocking   -> origin/ethomson/nonblocking

This is not information that users of libgit2 can currently surface since our update_tips callback includes only src/dest OIDs, and the local ref name. Nor can one reliably reverse engineer the remote branch name, since a remote configuration could map two remote specs to a local spec. For example:

        fetch = +refs/pull/*/head:refs/remotes/asdf/*
        fetch = +refs/heads/*:refs/remotes/asdf/*

In this case, given refs/remotes/asdf/foo in the update_tips, a caller would have no idea whether the remote was refs/pull/foo/head or refs/heads/foo.

Provide the matching remote git_refspec so that callers can rtransform themselves into the remote.