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

Fix issue with tab expansion of duplicate aliases. #422

Merged
merged 8 commits into from
Feb 18, 2017

Conversation

rkeithhill
Copy link
Collaborator

@rkeithhill rkeithhill commented Feb 16, 2017

Add Pester test for bug. Fix #421.

Also, fix that duplicate aliases would appear in the command tab expansion list.

@dahlbyk
Copy link
Owner

dahlbyk commented Feb 17, 2017

Added a few commits to:

  1. Make tests less environment-specific (initially failed for me)
  2. Use --get-all instead of --get-regexp for exact matches
  3. Refactored alias test setup/teardown (I try to avoid try/finally in tests, but would love feedback on this change)
  4. Tested/fixed that duplicate aliases appeared twice in the command completion list

Copy link
Collaborator Author

@rkeithhill rkeithhill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM (with the one minor tweak Sort-Object -Unique

@@ -188,12 +188,13 @@ function script:gitAliases($filter) {
$alias
}
}
} | Sort-Object
} | Get-Unique | Sort-Object
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is probably a bit better to use Sort-Object -Unique. And yes, that is available on v2 (just checked).

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL


RemoveGitTempRepo $repoPath
}
It 'Command completion includes unique list of aliases' {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fleshing out these tests!

@dahlbyk dahlbyk merged commit c66402d into master Feb 18, 2017
@dahlbyk dahlbyk deleted the rkeithhill/is421-fix-tabexp-dupe-aliases branch February 18, 2017 04:12
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.

When more than one identical alias is defined tab completion fails
2 participants