Expose the refspec transform for a remote's default fetchspec.
Teach Remote to transform references using its default fetchspec
@jamill Could you please share some information describing when this feature should be used from the consumer standpoint?
@nulltoken This can be used to identify the remote branch that a local branch would track when it is pushed up to the server. With the current API to set the upstream tracking branch, you have to pass in the reference to the tracked branch. This means to push up a new branch (refs/heads/new_branch) and set the upstream, you need to know the upstream branch that it will correspond to (through this transformation).
After pushing this up, I think a better way to achieve this is to expose a way to set the upstream remote / merge branch directly on a local branch (so, I could set the merge branch directly as refs/heads/new_branch on a local branch). I will submit a new PR exposing this functionality shortly.
This method still could still be useful if you wanted to check what a local branch's remote branch would be...
@nulltoken - with #353, I don't think this functionality is explicity required for my scenario - but it does work and might be useful later on (or to someone else). Howe would you like to proceed? Is this functionality something that might be useful?
It looks a little bit low level, but I'd hate ditching this. Can you think about a user scenario which would require such feature?
On a different topic, I'm not a huge fan of the names of the functions. How about something like MapTo[Source|Target]Reference?
/cc @carlosmn @dahlbyk
@jamill I included part of this PR in #385 (Remote.FetchSpecTransformToSource()). Do you see other use cases for which we would need to implement Remote.FetchSpecTransformToTarget() in libgit2sharp?
If the answer is no, maybe we could close this issue :)
I don't have other use cases for this at this time. I will close it now. Thanks.