@Override protected void doExecute() throws BuildException { Repository repo = git.getRepository(); FileTreeIterator workingTreeIterator = new FileTreeIterator(repo); try { IndexDiff diff = new IndexDiff(repo, Constants.HEAD, workingTreeIterator); diff.diff(); Status status = new Status(diff); if (!status.isClean()) { if (modificationExistProperty != null) { getProject().setProperty(modificationExistProperty, "true"); } if (isFailOnError()) { StringBuilder msg = new StringBuilder(); msg.append("The Git tree was modified."); msg.append("\n").append("Changed:").append(status.getChanged()); msg.append("\n").append("Added:").append(status.getAdded()); msg.append("\n").append("Modified:").append(status.getModified()); msg.append("\n").append("Missing:").append(status.getMissing()); msg.append("\n").append("Removed:").append(status.getRemoved()); msg.append("\n").append("Untracked:").append(status.getUntracked()); throw new GitBuildException(String.format(STATUS_NOT_CLEAN_TEMPLATE, msg.toString())); } } else { log(MESSAGE_UPTODATE_SUCCESS); } } catch (IOException ioe) { throw new GitBuildException(MESSAGE_UPTODATE_FAILED, ioe); } }
public Map<String, IndexDiff.StageState> getConflictingStageState() { return this.conflictingStage; }