Fix the indicator for redirecting standard input#2749
Merged
Merged
Fix the indicator for redirecting standard input#2749
Conversation
Member
Author
|
Will add a test in a few mins. |
a2a2f51 to
436c71c
Compare
Member
Author
Member
Author
|
|
vors
reviewed
Nov 21, 2016
| myInfo.PipelineIterationInfo = pipelineIterationInfo; | ||
| commandProcessor.DoPrepare(psDefaultParameterValues); | ||
| myInfo.ExpectingInput = commandProcessor.IsPipelineInputExpected(); | ||
| commandProcessor.DoPrepare(psDefaultParameterValues); |
Collaborator
There was a problem hiding this comment.
I believe it's a correct change.
vors
approved these changes
Nov 21, 2016
Member
Author
Member
Author
|
OK, finally finished running all tests on windows and analyzing the failures. There are 8 test failures:
None of the failures is related to swapping the order of |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Fix #2745
PipelinePositionstarts from 1,so the indicator for redirecting standard input should bePipelinePosition > 1.When there is input to a native command like
1,2,3 | <native>, the native command is still marked as position 1 in the pipeline because the input doesn't take up pipeline position. So we cannot simply usingPipelinePositionto decide whether standard input needs to be redirected.The new fix swaps the running order of the following code in
PipelineProcessor.Start, so as to make sureExpectingInputis set before callingDoPrepare. Then inNativeCommandProcessor.Preparewe can useMyInvocation.ExpectingInputto check whether to redirect standard input.