JGitStatusCommand: filter results by fileSet.getFileList() if not empty#1370
Open
piercemar wants to merge 3 commits into
Open
JGitStatusCommand: filter results by fileSet.getFileList() if not empty#1370piercemar wants to merge 3 commits into
piercemar wants to merge 3 commits into
Conversation
Author
|
@michael-o , this is the jgit parallel to SCM-835 |
Member
|
Is this change covered by the TCK we have? |
Author
|
I'm afraid it's not. The TCK for Status command covers only the case where ScmFileSet has no filtering clause. |
Member
|
@kwin Are you OK with this change? I am. |
Member
|
Looks ok, lets try to add a TCK test for this, but we can do it after the merge. |
kwin
approved these changes
May 13, 2026
Author
|
Hello @michael-o, @kwin. Are you expecting anything else from my side here ? |
kwin
requested changes
Jun 8, 2026
| if (!fileSet.getFileList().isEmpty()) { | ||
| Set<String> fileSetPaths = | ||
| fileSet.getFileList().stream().map(File::toString).collect(Collectors.toSet()); | ||
| changedFiles.removeIf(scmFile -> !fileSetPaths.contains(scmFile.getPath())); |
Member
There was a problem hiding this comment.
The base directory of the fileSet is not necessarily the root directory of the working copy, therefore some file adjustments are necessary before comparing with changedFiles.path.
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.
JGitStatusCommand currently ignores fileSet.getFileList() and always returns the full repository status.
This causes inconsistent behavior compared to the gitexe provider, where GitStatusConsumer correctly filters results to only the requested files.
This PR fixes JGitStatusCommand to apply the same file-list filtering, so both providers behave consistently when a FileSet with specific files is supplied.
Testing: This case is not covered by the TCK
I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004