Package org.eclipse.jgit.api

Examples of org.eclipse.jgit.api.SubmoduleSyncCommand


*/
public class SubmoduleSyncTest extends RepositoryTestCase {

  @Test
  public void repositoryWithNoSubmodules() throws GitAPIException {
    SubmoduleSyncCommand command = new SubmoduleSyncCommand(db);
    Map<String, String> modules = command.call();
    assertNotNull(modules);
    assertTrue(modules.isEmpty());
  }
View Full Code Here


    SubmoduleWalk generator = SubmoduleWalk.forIndex(db);
    assertTrue(generator.next());
    assertNull(generator.getConfigUrl());
    assertEquals(url, generator.getModulesUrl());

    SubmoduleSyncCommand command = new SubmoduleSyncCommand(db);
    Map<String, String> synced = command.call();
    assertNotNull(synced);
    assertEquals(1, synced.size());
    Entry<String, String> module = synced.entrySet().iterator().next();
    assertEquals(path, module.getKey());
    assertEquals(url, module.getValue());
View Full Code Here

    modulesConfig.setString(ConfigConstants.CONFIG_SUBMODULE_SECTION, path,
        ConfigConstants.CONFIG_KEY_URL, "../sub.git");
    modulesConfig.save();

    SubmoduleSyncCommand command = new SubmoduleSyncCommand(db);
    Map<String, String> synced = command.call();
    assertNotNull(synced);
    assertEquals(1, synced.size());
    Entry<String, String> module = synced.entrySet().iterator().next();
    assertEquals(path, module.getKey());
    assertEquals("git://server/sub.git", module.getValue());
View Full Code Here

      public void run(IProgressMonitor pm) throws CoreException {
        pm.beginTask("", 1); //$NON-NLS-1$
        Map<String, String> updates = null;
        try {
          SubmoduleSyncCommand sync = Git.wrap(repository)
              .submoduleSync();
          for (String path : paths)
            sync.addPath(path);
          updates = sync.call();
        } catch (GitAPIException e) {
          throw new TeamException(e.getLocalizedMessage(),
              e.getCause());
        } finally {
          if (updates != null && !updates.isEmpty())
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.api.SubmoduleSyncCommand

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.