Examples of DiffEntry


Examples of org.eclipse.jgit.diff.DiffEntry

    }

    if (n.sourceCommit == null)
      return result(n);

    DiffEntry r = findRename(parent, n.sourceCommit, n.sourcePath);
    if (r == null)
      return result(n);

    if (0 == r.getOldId().prefixCompare(n.sourceBlob)) {
      // A 100% rename without any content change can also
      // skip directly to the parent.
      n.sourceCommit = parent;
      n.sourcePath = PathFilter.create(r.getOldPath());
      push(n);
      return false;
    }

    Candidate next = n.create(parent, PathFilter.create(r.getOldPath()));
    next.sourceBlob = r.getOldId().toObjectId();
    next.renameScore = r.getScore();
    next.loadText(reader);
    return split(next, n);
  }
View Full Code Here

Examples of org.eclipse.jgit.diff.DiffEntry

        if (parent.has(SEEN))
          continue;
        if (ids != null && ids[pIdx] != null)
          continue;

        DiffEntry r = findRename(parent, n.sourceCommit, n.sourcePath);
        if (r == null)
          continue;

        if (n instanceof ReverseCandidate) {
          if (ids == null)
            ids = new ObjectId[pCnt];
          ids[pCnt] = r.getOldId().toObjectId();
        } else if (0 == r.getOldId().prefixCompare(n.sourceBlob)) {
          // A 100% rename without any content change can also
          // skip directly to the parent. Note this bypasses an
          // earlier parent that had the path (above) but did not
          // have an exact content match. For performance reasons
          // we choose to follow the one parent over trying to do
          // possibly both parents.
          n.sourceCommit = parent;
          n.sourcePath = PathFilter.create(r.getOldPath());
          push(n);
          return false;
        }

        renames[pIdx] = r;
View Full Code Here

Examples of org.eclipse.jgit.diff.DiffEntry

    }

    if (n.sourceCommit == null)
      return result(n);

    DiffEntry r = findRename(parent, n.sourceCommit, n.sourcePath);
    if (r == null)
      return result(n);

    if (0 == r.getOldId().prefixCompare(n.sourceBlob)) {
      // A 100% rename without any content change can also
      // skip directly to the parent.
      n.sourceCommit = parent;
      n.sourcePath = PathFilter.create(r.getOldPath());
      push(n);
      return false;
    }

    Candidate next = n.create(parent, PathFilter.create(r.getOldPath()));
    next.sourceBlob = r.getOldId().toObjectId();
    next.renameScore = r.getScore();
    next.loadText(reader);
    return split(next, n);
  }
View Full Code Here

Examples of org.eclipse.jgit.diff.DiffEntry

        if (parent.has(SEEN))
          continue;
        if (ids != null && ids[pIdx] != null)
          continue;

        DiffEntry r = findRename(parent, n.sourceCommit, n.sourcePath);
        if (r == null)
          continue;

        if (n instanceof ReverseCandidate) {
          if (ids == null)
            ids = new ObjectId[pCnt];
          ids[pCnt] = r.getOldId().toObjectId();
        } else if (0 == r.getOldId().prefixCompare(n.sourceBlob)) {
          // A 100% rename without any content change can also
          // skip directly to the parent. Note this bypasses an
          // earlier parent that had the path (above) but did not
          // have an exact content match. For performance reasons
          // we choose to follow the one parent over trying to do
          // possibly both parents.
          n.sourceCommit = parent;
          n.sourcePath = PathFilter.create(r.getOldPath());
          push(n);
          return false;
        }

        renames[pIdx] = r;
View Full Code Here

Examples of org.eclipse.jgit.diff.DiffEntry

    }

    if (n.sourceCommit == null)
      return result(n);

    DiffEntry r = findRename(parent, n.sourceCommit, n.sourcePath);
    if (r == null)
      return result(n);

    if (0 == r.getOldId().prefixCompare(n.sourceBlob)) {
      // A 100% rename without any content change can also
      // skip directly to the parent.
      n.sourceCommit = parent;
      n.sourcePath = PathFilter.create(r.getOldPath());
      push(n);
      return false;
    }

    Candidate next = n.create(parent, PathFilter.create(r.getOldPath()));
    next.sourceBlob = r.getOldId().toObjectId();
    next.renameScore = r.getScore();
    next.loadText(reader);
    return split(next, n);
  }
View Full Code Here

Examples of org.eclipse.jgit.diff.DiffEntry

        if (parent.has(SEEN))
          continue;
        if (ids != null && ids[pIdx] != null)
          continue;

        DiffEntry r = findRename(parent, n.sourceCommit, n.sourcePath);
        if (r == null)
          continue;

        if (n instanceof ReverseCandidate) {
          if (ids == null)
            ids = new ObjectId[pCnt];
          ids[pCnt] = r.getOldId().toObjectId();
        } else if (0 == r.getOldId().prefixCompare(n.sourceBlob)) {
          // A 100% rename without any content change can also
          // skip directly to the parent. Note this bypasses an
          // earlier parent that had the path (above) but did not
          // have an exact content match. For performance reasons
          // we choose to follow the one parent over trying to do
          // possibly both parents.
          n.sourceCommit = parent;
          n.sourcePath = PathFilter.create(r.getOldPath());
          push(n);
          return false;
        }

        renames[pIdx] = r;
View Full Code Here

Examples of org.eclipse.jgit.diff.DiffEntry

    };
    new CommitFinder(testRepo).setFilter(filter).find();
    Collection<DiffEntry> diffs = ref.get();
    assertNotNull(diffs);
    assertEquals(1, diffs.size());
    DiffEntry diff = diffs.iterator().next();
    assertEquals(ChangeType.ADD, diff.getChangeType());
    assertEquals(DiffEntry.DEV_NULL, diff.getOldPath());
    assertEquals("test.txt", diff.getNewPath());
  }
View Full Code Here

Examples of org.eclipse.jgit.diff.DiffEntry

    };
    new CommitFinder(testRepo).setFilter(filter).find();
    Collection<DiffEntry> diffs = ref.get();
    assertNotNull(diffs);
    assertEquals(1, diffs.size());
    DiffEntry diff = diffs.iterator().next();
    assertEquals(ChangeType.MODIFY, diff.getChangeType());
    assertEquals("test.txt", diff.getOldPath());
    assertEquals("test.txt", diff.getNewPath());
  }
View Full Code Here

Examples of org.eclipse.jgit.diff.DiffEntry

    };
    new CommitFinder(testRepo).setFilter(filter).find();
    Collection<DiffEntry> diffs = ref.get();
    assertNotNull(diffs);
    assertEquals(1, diffs.size());
    DiffEntry diff = diffs.iterator().next();
    assertEquals(ChangeType.MODIFY, diff.getChangeType());
    assertEquals("test.txt", diff.getOldPath());
    assertEquals("test.txt", diff.getNewPath());
  }
View Full Code Here

Examples of org.eclipse.jgit.diff.DiffEntry

    write(file, "b");

    List<DiffEntry> diffs = git.diff().call();
    assertNotNull(diffs);
    assertEquals(1, diffs.size());
    DiffEntry diff = diffs.get(0);
    assertEquals(ChangeType.MODIFY, diff.getChangeType());
    assertEquals("test.txt", diff.getOldPath());
    assertEquals("test.txt", diff.getNewPath());
  }
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.