Examples of readDirCache()


Examples of org.eclipse.jgit.lib.Repository.readDirCache()

    assertEquals(true, pushStatus.isOK());

    // this is how EGit checks for conflicts
    Repository db1 = getRepositoryForContentLocation(contentLocation1);
    Git git = new Git(db1);
    DirCache cache = db1.readDirCache();
    DirCacheEntry entry = cache.getEntry("test.txt");
    assertTrue(entry.getStage() == 0);

    // clone2: change
    JSONObject testTxt2 = getChild(project2, "test.txt");
View Full Code Here

Examples of org.eclipse.jgit.lib.Repository.readDirCache()

    git = new Git(db2);
    PullResult pullResult = git.pull().call();
    assertEquals(pullResult.getMergeResult().getMergeStatus(), MergeStatus.CONFLICTING);

    // this is how EGit checks for conflicts
    cache = db2.readDirCache();
    entry = cache.getEntry("test.txt");
    assertTrue(entry.getStage() > 0);

    assertStatus(new StatusResult().setConflictingNames("test.txt"), gitStatusUri2);
  }
View Full Code Here

Examples of org.eclipse.jgit.lib.Repository.readDirCache()

        if (diffConfig.getRenameDetectionType() != RenameDetectionType.FALSE) {
          TreeWalk walk = new TreeWalk(repository);
          CanonicalTreeParser baseLineIterator = new CanonicalTreeParser();
          baseLineIterator.reset(reader, baselineCommit.getTree());
          walk.addTree(baseLineIterator);
          walk.addTree(new DirCacheIterator(repository.readDirCache()));
          List<DiffEntry> diffs = DiffEntry.scan(walk, true);
          RenameDetector renameDetector = new RenameDetector(
              repository);
          renameDetector.addAll(diffs);
          List<DiffEntry> renames = renameDetector.compute();
View Full Code Here

Examples of org.eclipse.jgit.lib.Repository.readDirCache()

    Repository movedRepo = RepositoryMapping.getMapping(project2)
        .getRepository();
    assertEquals("P2",
        movedRepo.getDirectory().getParentFile()
            .getName());
    DirCache dc = movedRepo.readDirCache();
    assertEquals(1, dc.getEntryCount());
    assertEquals("file.txt", dc.getEntry(0).getPathString());

    assertFalse(ResourcesPlugin.getWorkspace().getRoot().getProject("Project-1").exists());
  }
View Full Code Here

Examples of org.eclipse.jgit.lib.Repository.readDirCache()

    Repository movedRepo = RepositoryMapping.getMapping(project2)
        .getRepository();
    assertEquals("Project-1",
        movedRepo.getDirectory().getParentFile()
            .getName());
    DirCache dc = movedRepo.readDirCache();
    assertEquals(1, dc.getEntryCount());
    assertEquals("file.txt", dc.getEntry(0).getPathString());

    assertFalse(ResourcesPlugin.getWorkspace().getRoot().getProject("Project-1").exists());
  }
View Full Code Here

Examples of org.eclipse.jgit.lib.Repository.readDirCache()

    Repository movedRepo = RepositoryMapping.getMapping(project2)
        .getRepository();
    assertEquals("P2",
        movedRepo.getDirectory().getParentFile()
            .getName());
    DirCache dc = movedRepo.readDirCache();
    assertEquals(1, dc.getEntryCount());
    assertEquals("file.txt", dc.getEntry(0).getPathString());

    assertFalse(ResourcesPlugin.getWorkspace().getRoot().getProject("P2").exists());
  }
View Full Code Here

Examples of org.eclipse.jgit.lib.Repository.readDirCache()

      assertNotNull(status);
      assertEquals(IStatus.WARNING, status.getSeverity());
    }

    assertTrue("File should still exist at old location", file.exists());
    DirCache indexAfter = repo.readDirCache();
    DirCacheEntry entry = indexAfter.getEntry(filePath);
    assertEquals("Expected entry to still be in non-zero (conflict) stage",
        DirCacheEntry.STAGE_1, entry.getStage());
  }
View Full Code Here

Examples of org.eclipse.jgit.lib.Repository.readDirCache()

      assertNotNull(status);
      assertEquals(IStatus.WARNING, status.getSeverity());
    }

    assertTrue("File should still exist at old location", file.exists());
    DirCache indexAfter = repo.readDirCache();
    DirCacheEntry entry = indexAfter.getEntry(filePath);
    assertEquals("Expected entry to still be in non-zero (conflict) stage",
        DirCacheEntry.STAGE_1, entry.getStage());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.