* @throws IllegalStateException
* @throws IOException
*/
public String indexState(Repository repo, int includedOptions)
throws IllegalStateException, IOException {
DirCache dc = repo.readDirCache();
StringBuilder sb = new StringBuilder();
TreeSet<Long> timeStamps = null;
// iterate once over the dircache just to collect all time stamps
if (0 != (includedOptions & MOD_TIME)) {
timeStamps = new TreeSet<Long>();
for (int i=0; i<dc.getEntryCount(); ++i)
timeStamps.add(Long.valueOf(dc.getEntry(i).getLastModified()));
}
// iterate again, now produce the result string
for (int i=0; i<dc.getEntryCount(); ++i) {
DirCacheEntry entry = dc.getEntry(i);
sb.append("["+entry.getPathString()+", mode:" + entry.getFileMode());
int stage = entry.getStage();
if (stage != 0)
sb.append(", stage:" + stage);
if (0 != (includedOptions & MOD_TIME)) {