Class GitStatusConsumer
java.lang.Object
org.apache.maven.scm.util.AbstractConsumer
org.apache.maven.scm.provider.git.gitexe.command.status.GitStatusConsumer
- All Implemented Interfaces:
org.codehaus.plexus.util.cli.StreamConsumer
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final PatternThe pattern used to match added file lines.Entries are relative to working directory, not to the repositoryroot.private static final PatternThe pattern used to match deleted file lines.private static final PatternThe pattern used to match modified file lines.private URIprivate static final PatternThe pattern used to match renamed file lines.private ScmFileSetprivate final FileFields inherited from class org.apache.maven.scm.util.AbstractConsumer
logger -
Constructor Summary
ConstructorsConstructorDescriptionGitStatusConsumer(File workingDirectory) Consumer when workingDirectory and repositoryRootDirectory are the same.GitStatusConsumer(File workingDirectory, URI relativeRepositoryPath) Assuming that you have to discover the repositoryRoot, this is how you can get therelativeRepositoryPathGitStatusConsumer(File workingDirectory, URI relativeRepositoryPath, ScmFileSet scmFileSet) Assuming that you have to discover the repositoryRoot, this is how you can get therelativeRepositoryPathGitStatusConsumer(File workingDirectory, ScmFileSet scmFileSet) Assuming that you have to discover the repositoryRoot, this is how you can get therelativeRepositoryPath -
Method Summary
Modifier and TypeMethodDescriptionvoidconsumeLine(String line) private booleanprivate booleanisFileNameInFileList(List<File> fileList, String fileName) static StringresolvePath(String fileEntry, URI path) static URIresolveURI(String fileEntry, URI path) private static StringstripQuotes(String str) private static StringDequote a quoted string generated by git status --porcelain.static URIuriFromPath(String path) Create an URI whose getPath() returns the given path and getScheme() returns null.Methods inherited from class org.apache.maven.scm.util.AbstractConsumer
parseDate, parseDate
-
Field Details
-
ADDED_PATTERN
The pattern used to match added file lines. -
MODIFIED_PATTERN
The pattern used to match modified file lines. -
DELETED_PATTERN
The pattern used to match deleted file lines. -
RENAMED_PATTERN
The pattern used to match renamed file lines. -
workingDirectory
-
scmFileSet
-
changedFiles
Entries are relative to working directory, not to the repositoryroot. -
relativeRepositoryPath
-
-
Constructor Details
-
GitStatusConsumer
Consumer when workingDirectory and repositoryRootDirectory are the same.- Parameters:
workingDirectory- the working directory
-
GitStatusConsumer
Assuming that you have to discover the repositoryRoot, this is how you can get therelativeRepositoryPathURI.create( repositoryRoot ).relativize( fileSet.getBasedir().toURI() )
- Parameters:
workingDirectory- the working directoryrelativeRepositoryPath- the working directory relative to the repository root- Since:
- 1.9
- See Also:
-
GitStatusConsumer
Assuming that you have to discover the repositoryRoot, this is how you can get therelativeRepositoryPathURI.create( repositoryRoot ).relativize( fileSet.getBasedir().toURI() )
- Parameters:
workingDirectory- the working directoryscmFileSet- fileset with includes and excludes- Since:
- 1.11.0
- See Also:
-
GitStatusConsumer
Assuming that you have to discover the repositoryRoot, this is how you can get therelativeRepositoryPathURI.create( repositoryRoot ).relativize( fileSet.getBasedir().toURI() )
- Parameters:
workingDirectory- the working directoryrelativeRepositoryPath- the working directory relative to the repository rootscmFileSet- fileset with includes and excludes- Since:
- 1.11.0
- See Also:
-
-
Method Details
-
consumeLine
-
isFileNameInFileList
-
isFile
-
resolvePath
-
resolveURI
- Parameters:
fileEntry- the fileEntry, must not benullpath- the path, must not benull- Returns:
- TODO
-
uriFromPath
Create an URI whose getPath() returns the given path and getScheme() returns null. The path may contain spaces, colons, and other special characters.- Parameters:
path- the path- Returns:
- the new URI
-
getChangedFiles
-
stripQuotes
- Parameters:
str- the (potentially quoted) string, must not benull- Returns:
- the string with a pair of double quotes removed (if they existed)
-
unescape
Dequote a quoted string generated by git status --porcelain. The leading and trailing quotes have already been removed.- Parameters:
fileEntry-- Returns:
- TODO
-