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
Get remotes #4705
Get remotes #4705
Conversation
Codecov Report
@@ Coverage Diff @@
## master #4705 +/- ##
=======================================
Coverage 28.23% 28.23%
=======================================
Files 511 511
Lines 41082 41082
Branches 5938 5938
=======================================
Hits 11598 11598
Misses 28966 28966
Partials 518 518
Continue to review full report at Codecov.
|
@@ -294,7 +294,7 @@ private void PopulateRemotes(List<GitRemote> allRemotes, bool enabled) | |||
Func<string[]> func; | |||
if (enabled) | |||
{ | |||
func = module.GetRemotes; | |||
func = () => module.GetRemotes(); |
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.
Aren't they functionally equivalent?
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.
Functionally yes, but the old code wouldn't compile after the change to GetRemotes
to use a default argument. Now there's no actual method with zero arguments. The new code calls a method with one argument, and the compiler pops in the default value at the call site automatically.
If we get rid of that argument as I'm thinking makes sense, we'll be able to revert this line.
Ah, cool. Makes sense. Some things a bit hard to appreciate by just looking
at a webpage.
…On 25 March 2018 at 20:23, Drew Noakes ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In GitCommands/Remote/GitRemoteManager.cs
<#4705 (comment)>
:
> @@ -294,7 +294,7 @@ private void PopulateRemotes(List<GitRemote> allRemotes, bool enabled)
Func<string[]> func;
if (enabled)
{
- func = module.GetRemotes;
+ func = () => module.GetRemotes();
Functionally yes, but the old code wouldn't compile after the change to
GetRemotes to use a default argument. Now there's no actual method with
zero arguments. The new code calls a method with one argument, and the
compiler pops in the default value at the call site automatically.
If we get rid of that argument as I'm thinking makes sense, we'll be able
to revert this line.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#4705 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEMyXossJUVIImLtIvlyESyS-emL-R_vks5th2IKgaJpZM4S6ECe>
.
|
The 'allowEmpty' parameter of GitModule.GetRemotes looks suspicious. This method will always return an empty string at the end if it's true (which is the default). Removing this parameter will require some study into possible impact.
Changes proposed in this pull request:
Has been tested on: