org.eclipse.jgit.lib
Class IndexDiff

java.lang.Object
  extended by org.eclipse.jgit.lib.IndexDiff

public class IndexDiff
extends java.lang.Object

Compares the Index, a Tree, and the working directory


Constructor Summary
IndexDiff(Repository repository)
          Construct an indexdiff for diffing the workdir against the index.
IndexDiff(Tree tree, GitIndex index)
          Construct an indexdiff for diffing the workdir against both the index and a tree.
 
Method Summary
 boolean diff()
          Run the diff operation.
 java.util.HashSet<java.lang.String> getAdded()
           
 java.util.HashSet<java.lang.String> getChanged()
           
 java.util.HashSet<java.lang.String> getMissing()
           
 java.util.HashSet<java.lang.String> getModified()
           
 java.util.HashSet<java.lang.String> getRemoved()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IndexDiff

public IndexDiff(Repository repository)
          throws java.io.IOException
Construct an indexdiff for diffing the workdir against the index.

Parameters:
repository -
Throws:
java.io.IOException

IndexDiff

public IndexDiff(Tree tree,
                 GitIndex index)
Construct an indexdiff for diffing the workdir against both the index and a tree.

Parameters:
tree -
index -
Method Detail

diff

public boolean diff()
             throws java.io.IOException
Run the diff operation. Until this is called, all lists will be empty

Returns:
if anything is different between index, tree, and workdir
Throws:
java.io.IOException

getAdded

public java.util.HashSet<java.lang.String> getAdded()
Returns:
list of files added to the index, not in the tree

getChanged

public java.util.HashSet<java.lang.String> getChanged()
Returns:
list of files changed from tree to index

getRemoved

public java.util.HashSet<java.lang.String> getRemoved()
Returns:
list of files removed from index, but in tree

getMissing

public java.util.HashSet<java.lang.String> getMissing()
Returns:
list of files in index, but not filesystem

getModified

public java.util.HashSet<java.lang.String> getModified()
Returns:
list of files on modified on disk relative to the index