slawekjaranowski commented on PR #1461: URL: https://github.com/apache/maven-scm/pull/1461#issuecomment-7203677064
Heads-up: this overlaps with #1412 (untracked files). Both change the same parts of `GitStatusConsumer.consumeLine`, namely the pattern `if/else` chain and the loop that fills `changedFiles`, so whichever is merged second will conflict. There is also a semantic trap that the textual merge won't show. This PR reads `rawFiles.get(i)` for every entry in `files`, and #1412 adds an `UNTRACKED_PATTERN` branch that adds only to `files`. If the untracked branch doesn't also get `rawFiles.add(matcher.group(1))`, then `isMatchedByPatterns` throws `IndexOutOfBoundsException` for any untracked entry that is not in the file list. For example, `?? new-dir/` with a pattern-based file set (`includes` set), since the scanned list contains `new-dir/project.xml`, not `new-dir`. None of the existing tests combine a `??` line with `includes`, so this would not be caught. Whichever PR goes second should: - add `rawFiles.add(matcher.group(1))` in the untracked branch; - add a test for `?? new-file.xml` and `?? new-dir/` with `new ScmFileSet(dir, "**/*.xml", null)` and untracked entries enabled. Side note: even with both PRs, `?? new-dir/` won't match `**/*.xml`, so a new file inside a new directory is still not reported when `includes` is set. `git status --untracked-files=all` would list the files individually; see the discussion in #1412. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
