Skip to content
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

Merged
merged 2 commits into from Mar 28, 2018
Merged

Get remotes #4705

merged 2 commits into from Mar 28, 2018

Conversation

drewnoakes
Copy link
Member

Changes proposed in this pull request:

  • Merge overloads via default parameter value
  • Ask question about utility of parameter at all

Has been tested on:

  • GIT 2.16
  • Windows 10

@drewnoakes drewnoakes mentioned this pull request Mar 25, 2018
@codecov
Copy link

codecov bot commented Mar 25, 2018

Codecov Report

Merging #4705 into master will not change coverage.
The diff coverage is 25%.

@@           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
Impacted Files Coverage Δ
GitCommands/Git/GitModule.cs 8.83% <0%> (-0.01%) ⬇️
GitCommands/Remote/GitRemoteManager.cs 71.07% <100%> (ø) ⬆️
GitUI/Plugin/LoadPlugins.cs 0% <0%> (ø) ⬆️
GitUI/GitUIExtensions.cs 0% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f9d0c04...e974913. Read the comment docs.

@@ -294,7 +294,7 @@ private void PopulateRemotes(List<GitRemote> allRemotes, bool enabled)
Func<string[]> func;
if (enabled)
{
func = module.GetRemotes;
func = () => module.GetRemotes();
Copy link
Member

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?

Copy link
Member Author

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.

@RussKie RussKie added the ready label Mar 25, 2018
@RussKie RussKie added this to the 3.00 milestone Mar 25, 2018
@RussKie
Copy link
Member

RussKie commented Mar 25, 2018 via email

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.
@drewnoakes drewnoakes merged commit 7882537 into gitextensions:master Mar 28, 2018
@drewnoakes drewnoakes deleted the get-remotes branch March 28, 2018 08:56
@drewnoakes drewnoakes removed the ready label Mar 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants