-
Notifications
You must be signed in to change notification settings - Fork 899
Introduce Network.ListReferences(Remote, Credentials) #704
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I think we would want to have a test like https://github.com/libgit2/libgit2sharp/blob/vNext/LibGit2Sharp.Tests/FetchFixture.cs#L50-L66 for the |
/// <param name="remote">The <see cref="Remote"/> to list from.</param> | ||
/// <param name="credentials">The <see cref="Credentials"/> used to connect to remote repository.</param> | ||
/// <returns>The references in the <see cref="Remote"/> repository.</returns> | ||
public virtual IEnumerable<DirectReference> ListReferences(Remote remote, Credentials credentials) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would the compiler cringe if credentials was null
by default?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll copy over my comment:
Do we really want to
Obsolete
the current method or just have it delegate to the other overload withcredentials: null
?
I believe the compiler will warn that making credentials
optional here would conflict with the existing method.
Though now that I think about it, we've historically not considered adding optional parameters to existing methods to be a breaking change, since the call pattern doesn't change (just need to recompile dependent apps). So maybe we don't need to keep the old method, just add the parameter to it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
What about this one 😃 ?
|
@someoneigna Could you please reduce the first line of the commit message so that it doesn't exceed 50 chars? Maybe
|
Done 👍 |
@@ -73,6 +73,29 @@ public void CanListRemoteReferencesFromUrl(string url) | |||
} | |||
} | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please drop this trailing whitespace
Once you've tamed those nasty whitespaces, could you please rebase this on top of the latest vNext? |
@@ -89,9 +112,9 @@ public void CanListRemoteReferenceObjects() | |||
Remote remote = repo.Network.Remotes[remoteName]; | |||
IEnumerable<DirectReference> references = repo.Network.ListReferences(remote); | |||
|
|||
var actualRefs = new List<Tuple<string,string>>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change looks unrelated to the scope of this PR. Could you please revert it?
Add CanListRemoteReferencesWithCredentials() test.
Neat!!!! ✨ ✨ ✨ |
Network.ListReferences(Remote) was marked Obsolete and it's users have been updated to use the new Network.ListReferences(Remote, Credentials).
Fixes #647