Example usage for org.eclipse.jgit.dircache DirCacheEntry isMerged

List of usage examples for org.eclipse.jgit.dircache DirCacheEntry isMerged

Introduction

In this page you can find the example usage for org.eclipse.jgit.dircache DirCacheEntry isMerged.

Prototype

public boolean isMerged() 

Source Link

Document

Returns whether this entry is in the fully-merged stage (0).

Usage

From source file:org.apache.openaz.xacml.admin.view.windows.GitPushWindow.java

License:Apache License

protected Object generateUntrackedEntry(final GitEntry entry) {
    Button add = new Button("Add");
    add.setImmediate(true);/*from w  ww  .  j ava  2  s .co  m*/
    add.addClickListener(new ClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(ClickEvent event) {
            try {
                DirCache cache = self.git.add().addFilepattern(entry.getName()).call();
                DirCacheEntry cacheEntry = cache.getEntry(entry.getName());
                assert cacheEntry != null;
                if (cacheEntry == null) {
                    return;
                }
                if (cacheEntry.isMerged()) {
                    self.refreshStatus();
                }
            } catch (GitAPIException e) {
                String error = "Failed to add: " + e.getLocalizedMessage();
                logger.error(error);
                AdminNotification.error(error);
            }
        }
    });
    return add;
}