Source:
protected void run() throws Exception { final Ref head = db.getRef(Constants.HEAD); if (head != null && head.isSymbolic()) { String branch = Repository.shortenRefName(head.getLeaf().getName()); out.println(MessageFormat.format("# " + CLIText.get().onBranch, branch)); } else out.println("# " + CLIText.get().notOnAnyBranch); org.eclipse.jgit.api.Status status = new Git(db).status().call(); Collection<String> added = status.getAdded(); Collection<String> changed = status.getChanged(); Collection<String> removed = status.getRemoved(); Collection<String> modified = status.getModified(); Collection<String> missing = status.getMissing(); Collection<String> untracked = status.getUntracked(); Collection<String> unmerged = status.getConflicting(); int nbToBeCommitted = added.size() + changed.size() + removed.size(); if (nbToBeCommitted > 0) { out.println("# " + CLIText.get().toBeCommitted); printList(CLIText.get().newFile, added); printList(CLIText.get().modified, changed); printList(CLIText.get().removed, removed); } int nbNotStagedForCommit = modified.size() + missing.size(); if (nbNotStagedForCommit > 0) { out.println("# " + CLIText.get().notStagedForCommit); printList(CLIText.get().modified, modified); printList(CLIText.get().removed, missing); } int nbUnmerged = unmerged.size(); if (nbUnmerged > 0) { out.println("# " + CLIText.get().unmergedPaths); printList(unmerged); } int nbUntracked = untracked.size(); if (showUntracked && nbUntracked > 0) { out.println("# " + CLIText.get().untrackedFiles); printList(untracked); } out.println(MessageFormat.format(CLIText.get().summaryStatus, nbToBeCommitted, nbNotStagedForCommit, nbUnmerged, nbUntracked)); }

Target:
protected void run() throws Exception { final Ref head = db.getRef(Constants.HEAD); if (head != null && head.isSymbolic()) { String branch = Repository.shortenRefName(head.getLeaf().getName()); out.println(CLIText.formatLine( MessageFormat.format(CLIText.get().onBranch, branch))); } else out.println(CLIText.formatLine(CLIText.get().notOnAnyBranch)); org.eclipse.jgit.api.Status status = new Git(db).status().call(); Collection<String> added = status.getAdded(); Collection<String> changed = status.getChanged(); Collection<String> removed = status.getRemoved(); Collection<String> modified = status.getModified(); Collection<String> missing = status.getMissing(); Collection<String> untracked = status.getUntracked(); Collection<String> unmerged = status.getConflicting(); int nbToBeCommitted = added.size() + changed.size() + removed.size(); if (nbToBeCommitted > 0) { out.println(CLIText.formatLine(CLIText.get().changesToBeCommitted)); printList(CLIText.get().statusNewFile, added); printList(CLIText.get().statusModified, changed); printList(CLIText.get().statusRemoved, removed); } int nbNotStagedForCommit = modified.size() + missing.size(); if (nbNotStagedForCommit > 0) { out.println(CLIText.formatLine(CLIText.get().changesNotStagedForCommit)); printList(CLIText.get().statusModified, modified); printList(CLIText.get().statusRemoved, missing); } int nbUnmerged = unmerged.size(); if (nbUnmerged > 0) { out.println(CLIText.formatLine(CLIText.get().unmergedPaths)); printList(unmerged); } int nbUntracked = untracked.size(); if (showUntracked && nbUntracked > 0) { out.println(CLIText.formatLine(CLIText.get().untrackedFiles)); printList(untracked); } out.println(MessageFormat.format(CLIText.get().summaryStatus, nbToBeCommitted, nbNotStagedForCommit, nbUnmerged, nbUntracked)); }