Class GitFileLister
java.lang.Object
io.github.sergeloie.languagecheck.scan.GitFileLister
Lists the project files git knows about using
git ls-files --cached --others --exclude-standard: tracked files,
staged files, and untracked files that are not git-ignored.
The subprocess output is redirected to a temporary file and read back afterwards - on Windows the default pipe buffer truncates large outputs, so stdout is never streamed through a pipe.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longDefault timeout for the git subprocess, in seconds. -
Constructor Summary
ConstructorsConstructorDescriptionGitFileLister(File projectDir) GitFileLister(File projectDir, long timeoutSeconds) -
Method Summary
Modifier and TypeMethodDescriptionbooleanTrue ifprojectDirlooks like the root of a git working tree (a.gitentry exists - a directory for a normal clone, a file for worktrees and submodules).List all git-known files, relative to the project root.
-
Field Details
-
DEFAULT_TIMEOUT_SECONDS
public static final long DEFAULT_TIMEOUT_SECONDSDefault timeout for the git subprocess, in seconds.- See Also:
-
-
Constructor Details
-
GitFileLister
-
GitFileLister
-
-
Method Details
-
isGitRepository
public boolean isGitRepository()True ifprojectDirlooks like the root of a git working tree (a.gitentry exists - a directory for a normal clone, a file for worktrees and submodules). -
listRelativeFiles
List all git-known files, relative to the project root.- Returns:
- relative paths with '/' separators
- Throws:
IllegalStateException- when the project is not a git repositoryorg.gradle.api.GradleException- when git fails or times out
-