int share = SharabilityQuery.getSharability(file.getParentFile());
if (share == SharabilityQuery.NOT_SHARABLE ||
(share == SharabilityQuery.MIXED &&
SharabilityQuery.getSharability(file) == SharabilityQuery.NOT_SHARABLE)) {
return new StatusInfo(StatusInfo.STATUS_NOTVERSIONED_EXCLUDED, null, false);
}
int status = StatusInfo.STATUS_UNKNOWN;
String name = getRelative(root, file);
try {
index = new IndexDiff(repo);
index.diff();
} catch (IOException ex) {
Exceptions.printStackTrace(ex);
return new StatusInfo(status, null, false);
}
if (index.getAdded().contains(name)) {
status = StatusInfo.STATUS_VERSIONED_ADDEDLOCALLY;
} else if (index.getRemoved().contains(name)) {
status = StatusInfo.STATUS_VERSIONED_REMOVEDLOCALLY;
} else if (index.getMissing().contains(name)) {
status = StatusInfo.STATUS_VERSIONED_DELETEDLOCALLY;
} else if (index.getChanged().contains(name)) {
status = StatusInfo.STATUS_VERSIONED_MODIFIEDLOCALLY;
} else if (index.getModified().contains(name)) {
status = StatusInfo.STATUS_VERSIONED_MODIFIEDLOCALLY;
} else {
status = StatusInfo.STATUS_VERSIONED_UPTODATE;
}
StatusInfo info = new StatusInfo(status, null, false);
return info;
}