Example usage for org.eclipse.jgit.api SubmoduleStatusCommand call

List of usage examples for org.eclipse.jgit.api SubmoduleStatusCommand call

Introduction

In this page you can find the example usage for org.eclipse.jgit.api SubmoduleStatusCommand call.

Prototype

@Override
public Map<String, SubmoduleStatus> call() throws GitAPIException 

Source Link

Usage

From source file:org.eclipse.orion.server.git.servlets.GitSubmoduleHandlerV1.java

License:Open Source License

public static boolean updateSubmodules(Repository repo) throws GitAPIException {
    SubmoduleInitCommand init = new SubmoduleInitCommand(repo);
    init.call();/*from  www .  java 2s.c om*/
    SubmoduleUpdateCommand update = new SubmoduleUpdateCommand(repo);
    Collection<String> updated = update.call();
    SubmoduleStatusCommand status = new SubmoduleStatusCommand(repo);
    Map<String, SubmoduleStatus> statusResult = status.call();
    return updated.size() == statusResult.size();
}

From source file:org.eclipse.orion.server.git.servlets.GitSubmoduleHandlerV1.java

License:Open Source License

public static boolean syncSubmodules(Repository repo) throws GitAPIException {
    SubmoduleSyncCommand sync = new SubmoduleSyncCommand(repo);
    Map<String, String> synced = sync.call();
    SubmoduleStatusCommand status = new SubmoduleStatusCommand(repo);
    Map<String, SubmoduleStatus> statusResult = status.call();
    return synced.size() == statusResult.size();
}