Merge "Add helper for determining if status is clean"
This commit is contained in:
commit
885a389832
|
@ -60,7 +60,9 @@
|
||||||
* {@link #getChanged()}
|
* {@link #getChanged()}
|
||||||
*/
|
*/
|
||||||
public class Status {
|
public class Status {
|
||||||
private IndexDiff diff;
|
private final IndexDiff diff;
|
||||||
|
|
||||||
|
private final boolean clean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param diff
|
* @param diff
|
||||||
|
@ -68,6 +70,21 @@ public class Status {
|
||||||
public Status(IndexDiff diff) {
|
public Status(IndexDiff diff) {
|
||||||
super();
|
super();
|
||||||
this.diff = diff;
|
this.diff = diff;
|
||||||
|
clean = diff.getAdded().isEmpty() //
|
||||||
|
&& diff.getChanged().isEmpty() //
|
||||||
|
&& diff.getRemoved().isEmpty() //
|
||||||
|
&& diff.getMissing().isEmpty() //
|
||||||
|
&& diff.getModified().isEmpty() //
|
||||||
|
&& diff.getUntracked().isEmpty() //
|
||||||
|
&& diff.getConflicting().isEmpty();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return true if no differences exist between the working-tree, the index,
|
||||||
|
* and the current HEAD, false if differences do exist
|
||||||
|
*/
|
||||||
|
public boolean isClean() {
|
||||||
|
return clean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue