| Modifier and Type | Class and Description |
|---|---|
| private static class | |
| public static enum | IndexDiff.
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). |
| public static interface | IndexDiff.
A factory to producing WorkingTreeIterators |
| Modifier and Type | Field and Description |
|---|---|
| private Set | |
| private Set | |
| private Set | |
| private Map | |
| private DirCache | |
| private Map | |
| private TreeFilter | |
| private Set | |
| private SubmoduleWalk. | |
| private static final int | |
| private IndexDiffFilter | |
| private final WorkingTreeIterator | |
| private Set | |
| private Set | |
| private Set | |
| private Set | |
| private final Repository | |
| private Map | |
| private static final int | |
| private final AnyObjectId | |
| private Set | |
| private static final int | |
| private IndexDiff. |
| Access | Constructor and Description |
|---|---|
| public | IndexDiff(Repository
a repository, String org. object.symbolic name e.g. HEAD An EmptyTreeIterator is used if
revstr, WorkingTreeIterator revstr cannot be resolved.iterator for working directory workingTreeIterator)Construct an IndexDiff |
| public | IndexDiff(Repository
a repository, ObjectId org. object.tree id. If null, an EmptyTreeIterator is used. objectId, WorkingTreeIterator iterator for working directory workingTreeIterator)Construct an Indexdiff |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public boolean | |
| public boolean | Returns: if anything is different between index, tree, and workdirthe factory)RepositoryBuilderFactory to use to create builders
to create submodule repositories, if needed; if null,
submodule repositories will be built using a plain
RepositoryBuilder.Run the diff operation. |
| public boolean | Returns: if anything is different between index, tree, and workdirfor reporting progress, may be null monitor, int number or estimated files in the working tree estWorkTreeSize, int number of estimated entries in the cache estIndexSize, final String a title)java. object.Run the diff operation. |
| public boolean | Returns: if anything is different between index, tree, and workdirfor reporting progress, may be null monitor, int number or estimated files in the working tree estWorkTreeSize, int number of estimated entries in the cache estIndexSize, String a title, RepositoryBuilderFactory java. object.the factory)RepositoryBuilderFactory to use to create builders
to create submodule repositories, if needed; if null,
submodule repositories will be built using a plain
RepositoryBuilder.Run the diff operation. |
| public Set | Returns: list of files added to the index, not in the treeGet list of files added to the index, not in the tree |
| public Set | Returns: list of files with the flag assume-unchangedGet list of files with the flag assume-unchanged |
| public Set | Returns: list of files changed from tree to indexGet list of files changed from tree to index |
| public Set | Returns: list of files that are in conflict, corresponds to the keys ofgetConflictingStageStates()Get list of files that are in conflict, corresponds to the keys of
|
| public Map | Returns: the map from each path ofgetConflicting() to its
corresponding org.Get the map from each path of |
| public Set | Returns: list of files / folders that are ignoredThe method returns the list of ignored files and folders. |
| public FileMode | Returns: file modea path)java. object.Get the file mode of the given path in the index |
| public Set | Returns: list of files in index, but not filesystemGet list of files in index, but not filesystem |
| public Set | Returns: list of files modified on disk relative to the indexGet list of files modified on disk relative to the index |
| public Set | Returns: the list of paths that IndexDiff has detected to differ and have the given file modea mode)org. object.Get the list of paths that IndexDiff has detected to differ and have the given file mode |
| public Set | Returns: list of files removed from index, but in treeGet list of files removed from index, but in tree |
| public Set | Returns: list of files that are not ignored, and not in the index.Get list of files that are not ignored, and not in the index. |
| public Set | Returns: list of folders containing only untracked files/foldersGet list of folders containing only untracked files/folders |
| private boolean | |
| private boolean | |
| private void | |
| public void | |
| public void | setIgnoreSubmoduleMode(SubmoduleWalk.
defines how modifications in submodules are treated modeDefines how modifications in submodules are treated |
| public void | setWorkingTreeItFactory(IndexDiff.
working tree iterator factory wTreeItAllows higher layers to set the factory for WorkingTreeIterators. |
| added | back to summary |
|---|---|
| private Set<String> added | |
| assumeUnchanged | back to summary |
|---|---|
| private Set<String> assumeUnchanged | |
| changed | back to summary |
|---|---|
| private Set<String> changed | |
| conflicts | back to summary |
|---|---|
| private Map<String, IndexDiff. | |
| dirCache | back to summary |
|---|---|
| private DirCache dirCache | |
| fileModes | back to summary |
|---|---|
| private Map<FileMode, Set<String>> fileModes | |
| filter | back to summary |
|---|---|
| private TreeFilter filter | |
| ignored | back to summary |
|---|---|
| private Set<String> ignored | |
| ignoreSubmoduleMode | back to summary |
|---|---|
| private SubmoduleWalk. | |
| INDEX | back to summary |
|---|---|
| private static final int INDEX | |
| indexDiffFilter | back to summary |
|---|---|
| private IndexDiffFilter indexDiffFilter | |
| initialWorkingTreeIterator | back to summary |
|---|---|
| private final WorkingTreeIterator initialWorkingTreeIterator | |
| missing | back to summary |
|---|---|
| private Set<String> missing | |
| missingSubmodules | back to summary |
|---|---|
| private Set<String> missingSubmodules | |
| modified | back to summary |
|---|---|
| private Set<String> modified | |
| removed | back to summary |
|---|---|
| private Set<String> removed | |
| repository | back to summary |
|---|---|
| private final Repository repository | |
| submoduleIndexDiffs | back to summary |
|---|---|
| private Map<String, IndexDiff> submoduleIndexDiffs | |
| TREE | back to summary |
|---|---|
| private static final int TREE | |
| tree | back to summary |
|---|---|
| private final AnyObjectId tree | |
| untracked | back to summary |
|---|---|
| private Set<String> untracked | |
| WORKDIR | back to summary |
|---|---|
| private static final int WORKDIR | |
| wTreeIt | back to summary |
|---|---|
| private IndexDiff. | |
| IndexDiff | back to summary |
|---|---|
| public IndexDiff(Repository repository, String revstr, WorkingTreeIterator workingTreeIterator) throws IOException Construct an IndexDiff
| |
| IndexDiff | back to summary |
|---|---|
| public IndexDiff(Repository repository, ObjectId objectId, WorkingTreeIterator workingTreeIterator) throws IOException Construct an Indexdiff
| |
| addConflict | back to summary |
|---|---|
| private void addConflict(String path, int stage) | |
| diff | back to summary |
|---|---|
| public boolean diff() throws IOException Run the diff operation. Until this is called, all lists will be empty.
Use
| |
| diff | back to summary |
|---|---|
| public boolean diff(RepositoryBuilderFactory factory) throws IOException Run the diff operation. Until this is called, all lists will be empty.
Use
The operation may create repositories for submodules using builders
provided by the given
| |
| diff | back to summary |
|---|---|
| public boolean diff(final ProgressMonitor monitor, int estWorkTreeSize, int estIndexSize, final String title) throws IOException Run the diff operation. Until this is called, all lists will be empty.
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 | back to summary |
|---|---|
| public boolean diff(ProgressMonitor monitor, int estWorkTreeSize, int estIndexSize, String title, RepositoryBuilderFactory factory) throws IOException Run the diff operation. Until this is called, all lists will be empty.
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
The operation may create repositories for submodules using builders
provided by the given
| |
| getAdded | back to summary |
|---|---|
| public Set Get list of files added to the index, not in the tree | |
| getAssumeUnchanged | back to summary |
|---|---|
| public Set Get list of files with the flag assume-unchanged | |
| getChanged | back to summary |
|---|---|
| public Set Get list of files changed from tree to index | |
| getConflicting | back to summary |
|---|---|
| public Set Get list of files that are in conflict, corresponds to the keys of
| |
| getConflictingStageStates | back to summary |
|---|---|
| public Map Get the map from each path of
| |
| getIgnoredNotInIndex | back to summary |
|---|---|
| public Set The method returns the list of ignored files and folders. Only the root folder of an ignored folder hierarchy is reported. If a/b/c is listed in the .gitignore then you should not expect a/b/c/d/e/f to be reported here. Only a/b/c will be reported. Furthermore only ignored files / folders are returned that are NOT in the index. | |
| getIndexMode | back to summary |
|---|---|
| public FileMode getIndexMode(String path) Get the file mode of the given path in the index
| |
| getMissing | back to summary |
|---|---|
| public Set Get list of files in index, but not filesystem | |
| getModified | back to summary |
|---|---|
| public Set Get list of files modified on disk relative to the index | |
| getPathsWithIndexMode | back to summary |
|---|---|
| public Set Get the list of paths that IndexDiff has detected to differ and have the given file mode
| |
| getRemoved | back to summary |
|---|---|
| public Set Get list of files removed from index, but in tree | |
| getUntracked | back to summary |
|---|---|
| public Set Get list of files that are not ignored, and not in the index. | |
| getUntrackedFolders | back to summary |
|---|---|
| public Set Get list of folders containing only untracked files/folders | |
| hasFiles | back to summary |
|---|---|
| private boolean hasFiles(File directory) | |
| isEntryGitLink | back to summary |
|---|---|
| private boolean isEntryGitLink(AbstractTreeIterator ti) | |
| recordFileMode | back to summary |
|---|---|
| private void recordFileMode(String path, FileMode mode) | |
| setFilter | back to summary |
|---|---|
| public void setFilter(TreeFilter filter) Sets a filter. Can be used e.g. for restricting the tree walk to a set of files.
| |
| setIgnoreSubmoduleMode | back to summary |
|---|---|
| public void setIgnoreSubmoduleMode(SubmoduleWalk. Defines how modifications in submodules are treated
| |
| setWorkingTreeItFactory | back to summary |
|---|---|
| public void setWorkingTreeItFactory(IndexDiff. Allows higher layers to set the factory for WorkingTreeIterators.
| |
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private final ProgressMonitor | |
| private int | |
| private final int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public TreeFilter | clone()
Implements abstract org. Creates and returns a copy of this object. |
| public boolean | include(TreeWalk
the walker the filter needs to examine. walker)Implements abstract org. Determine if the current entry is interesting to report. |
| public boolean | shouldBeRecursive()
Implements abstract org. Does this tree filter require a recursive walk to match everything? |
| count | back to summary |
|---|---|
| private int count | |
| monitor | back to summary |
|---|---|
| private final ProgressMonitor monitor | |
| stepSize | back to summary |
|---|---|
| private int stepSize | |
| total | back to summary |
|---|---|
| private final int total | |
| ProgressReportingFilter | back to summary |
|---|---|
| private ProgressReportingFilter(ProgressMonitor monitor, int total) | |
| clone | back to summary |
|---|---|
| public TreeFilter clone() Implements abstract org. Doc from org. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by This is a deep clone. If this filter embeds objects or other filters it must also clone those, to ensure the instances do not share mutable data.
| |
| include | back to summary |
|---|---|
| public boolean include(TreeWalk walker) throws MissingObjectException, IncorrectObjectTypeException, IOException Implements abstract org. Doc from org. Determine if the current entry is interesting to report.
This method is consulted for subtree entries even if
| |
| shouldBeRecursive | back to summary |
|---|---|
| public boolean shouldBeRecursive() Implements abstract org. Doc from org. Does this tree filter require a recursive walk to match everything? If this tree filter is matching on full entry path names and its pattern is looking for a '/' then the filter would require a recursive TreeWalk to accurately make its decisions. The walker is not required to enable recursive behavior for any particular filter, this is only a hint.
| |
This is used for figuring out what kind of conflict occurred.
IndexDiff#getConflictingStageStates()
| Modifier and Type | Field and Description |
|---|---|
| public static final IndexDiff. | ADDED_BY_THEM
Only exists in theirs. |
| public static final IndexDiff. | ADDED_BY_US
Only exists in ours. |
| public static final IndexDiff. | BOTH_ADDED
Exists in ours and theirs, but not in base. |
| public static final IndexDiff. | BOTH_DELETED
Exists in base, but neither in ours nor in theirs. |
| public static final IndexDiff. | BOTH_MODIFIED
Exists in all stages, content conflict. |
| public static final IndexDiff. | DELETED_BY_THEM
Exists in base and ours, but no in theirs. |
| public static final IndexDiff. | DELETED_BY_US
Exists in base and theirs, but not in ours. |
| private final int |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv static IndexDiff. | |
| pack-priv int | |
| public boolean | |
| public boolean | |
| public boolean | |
| public static IndexDiff. | |
| public static IndexDiff. |
| ADDED_BY_THEM | back to summary |
|---|---|
| public static final IndexDiff. Only exists in theirs. | |
| ADDED_BY_US | back to summary |
|---|---|
| public static final IndexDiff. Only exists in ours. | |
| BOTH_ADDED | back to summary |
|---|---|
| public static final IndexDiff. Exists in ours and theirs, but not in base. | |
| BOTH_DELETED | back to summary |
|---|---|
| public static final IndexDiff. Exists in base, but neither in ours nor in theirs. | |
| BOTH_MODIFIED | back to summary |
|---|---|
| public static final IndexDiff. Exists in all stages, content conflict. | |
| DELETED_BY_THEM | back to summary |
|---|---|
| public static final IndexDiff. Exists in base and ours, but no in theirs. | |
| DELETED_BY_US | back to summary |
|---|---|
| public static final IndexDiff. Exists in base and theirs, but not in ours. | |
| stageMask | back to summary |
|---|---|
| private final int stageMask | |
| StageState | back to summary |
|---|---|
| private StageState(int stageMask) | |
| fromMask | back to summary |
|---|---|
| pack-priv static IndexDiff. | |
| getStageMask | back to summary |
|---|---|
| pack-priv int getStageMask() | |
| hasBase | back to summary |
|---|---|
| public boolean hasBase() Whether there is a "base" stage entry
| |
| hasOurs | back to summary |
|---|---|
| public boolean hasOurs() Whether there is an "ours" stage entry
| |
| hasTheirs | back to summary |
|---|---|
| public boolean hasTheirs() Whether there is a "theirs" stage entry
| |
| valueOf | back to summary |
|---|---|
| public static IndexDiff. | |
| values | back to summary |
|---|---|
| public static IndexDiff. | |
| Modifier and Type | Method and Description |
|---|---|
| public WorkingTreeIterator | Returns: working tree iteratorthe repository repo)Get working tree iterator |
| getWorkingTreeIterator | back to summary |
|---|---|
| public WorkingTreeIterator getWorkingTreeIterator(Repository repo) Get working tree iterator
| |