public class IndexDiff extends Object
Modifier and Type | Class and Description |
---|---|
static class |
IndexDiff.StageState
Represents the state of the index for a certain path regarding the stages
- which stages exist for a path and which not (base, ours, theirs).
|
Constructor and Description |
---|
IndexDiff(Repository repository,
ObjectId objectId,
WorkingTreeIterator workingTreeIterator)
Construct an Indexdiff
|
IndexDiff(Repository repository,
String revstr,
WorkingTreeIterator workingTreeIterator)
Construct an IndexDiff
|
Modifier and Type | Method and Description |
---|---|
boolean |
diff()
Run the diff operation.
|
boolean |
diff(ProgressMonitor monitor,
int estWorkTreeSize,
int estIndexSize,
String title)
Run the diff operation.
|
Set<String> |
getAdded() |
Set<String> |
getAssumeUnchanged() |
Set<String> |
getChanged() |
Set<String> |
getConflicting() |
Map<String,IndexDiff.StageState> |
getConflictingStageStates() |
Set<String> |
getIgnoredNotInIndex()
The method returns the list of ignored files and folders.
|
FileMode |
getIndexMode(String path)
Get the file mode of the given path in the index
|
Set<String> |
getMissing() |
Set<String> |
getModified() |
Set<String> |
getRemoved() |
Set<String> |
getUntracked() |
Set<String> |
getUntrackedFolders() |
void |
setFilter(TreeFilter filter)
Sets a filter.
|
public IndexDiff(Repository repository, String revstr, WorkingTreeIterator workingTreeIterator) throws IOException
repository
- revstr
- symbolic name e.g. HEAD
An EmptyTreeIterator is used if revstr
cannot be resolved.workingTreeIterator
- iterator for working directoryIOException
public IndexDiff(Repository repository, ObjectId objectId, WorkingTreeIterator workingTreeIterator) throws IOException
repository
- objectId
- tree id. If null, an EmptyTreeIterator is used.workingTreeIterator
- iterator for working directoryIOException
public void setFilter(TreeFilter filter)
filter
- public boolean diff() throws IOException
diff(ProgressMonitor, int, int, String)
if a progress
monitor is required.IOException
public boolean diff(ProgressMonitor monitor, int estWorkTreeSize, int estIndexSize, String title) throws IOException
The operation may be aborted by the progress monitor. In that event it
will report what was found before the cancel operation was detected.
Callers should ignore the result if monitor.isCancelled() is true. If a
progress monitor is not needed, callers should use diff()
instead. Progress reporting is crude and approximate and only intended
for informing the user.
monitor
- for reporting progress, may be nullestWorkTreeSize
- number or estimated files in the working treeestIndexSize
- number of estimated entries in the cachetitle
- IOException
public Set<String> getModified()
public Set<String> getUntracked()
public Set<String> getConflicting()
getConflictingStageStates()
public Map<String,IndexDiff.StageState> getConflictingStageStates()
getConflicting()
to its
corresponding IndexDiff.StageState
public Set<String> getIgnoredNotInIndex()
public Set<String> getAssumeUnchanged()
public Set<String> getUntrackedFolders()
Copyright © 2014. All rights reserved.