瀏覽代碼

Add helper for determining if status is clean

This checks if all collections that Status exposes are
empty or not

Change-Id: I0c342ab70dc36c1fd70acb4f8a924bb207d62f47
tags/v1.3.0.201202121842-rc4
Kevin Sawicki 12 年之前
父節點
當前提交
3d15298011
共有 1 個檔案被更改,包括 18 行新增1 行删除
  1. 18
    1
      org.eclipse.jgit/src/org/eclipse/jgit/api/Status.java

+ 18
- 1
org.eclipse.jgit/src/org/eclipse/jgit/api/Status.java 查看文件

* {@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
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…
取消
儲存