}
cmds.add(new org.eclipse.jgit.internal.storage.reftree.Command(
null,
- db.peel(r)));
+ db.getRefDatabase().peel(r)));
}
tree.apply(cmds);
return tree;
Iterator<RevCommit> log = git.log().all().call().iterator();
assertTrue(log.hasNext());
RevCommit commit = log.next();
- tag = db.peel(tag);
+ tag = db.getRefDatabase().peel(tag);
assertEquals(commit.getName(), tag.getPeeledObjectId().getName());
assertTrue(commits.contains(commit));
RevWalk walk = new RevWalk(db)) {
RevCommit commit = git.commit().setMessage("initial commit").call();
Ref tagRef = git.tag().setName("tag").call();
- assertEquals(commit.getId(), db.peel(tagRef).getPeeledObjectId());
+ assertEquals(commit.getId(),
+ db.getRefDatabase().peel(tagRef).getPeeledObjectId());
assertEquals("tag", walk.parseTag(tagRef.getObjectId()).getTagName());
}
}
@Test
- public void testTagging() throws GitAPIException, JGitInternalException {
+ public void testTagging()
+ throws GitAPIException, JGitInternalException, IOException {
try (Git git = new Git(db)) {
git.commit().setMessage("initial commit").call();
RevCommit commit = git.commit().setMessage("second commit").call();
git.commit().setMessage("third commit").call();
Ref tagRef = git.tag().setObjectId(commit).setName("tag").call();
- assertEquals(commit.getId(), db.peel(tagRef).getPeeledObjectId());
+ assertEquals(commit.getId(),
+ db.getRefDatabase().peel(tagRef).getPeeledObjectId());
}
}
Ref ref = r.findRef(refname);
if (ref == null) return null;
- ref = r.peel(ref);
+ ref = r.getRefDatabase().peel(ref);
ObjectId id = ref.getObjectId();
return id;
} catch (IOException e) {
public LogCommand all() throws IOException {
for (Ref ref : getRepository().getRefDatabase().getRefs()) {
if(!ref.isPeeled())
- ref = getRepository().peel(ref);
+ ref = getRepository().getRefDatabase().peel(ref);
ObjectId objectId = ref.getPeeledObjectId();
if (objectId == null)
refLogMessage.append(ref.getName());
// handle annotated tags
- ref = repo.peel(ref);
+ ref = repo.getRefDatabase().peel(ref);
ObjectId objectId = ref.getPeeledObjectId();
if (objectId == null)
objectId = ref.getObjectId();
* new Ref object representing the same data as Ref, but isPeeled()
* will be true and getPeeledObjectId will contain the peeled object
* (or null).
+ * @deprecated use {@code getRefDatabase().peel(ref)} instead.
*/
+ @Deprecated
@NonNull
public Ref peel(Ref ref) {
try {
String peelPart = ""; //$NON-NLS-1$
if (derefTags) {
if (!ref.isPeeled() && repository != null) {
- ref = repository.peel(ref);
+ ref = repository.getRefDatabase().peel(ref);
}
ObjectId peeledObjectId = ref.getPeeledObjectId();
if (peeledObjectId != null) {
if (!ref.isPeeled()) {
if (repository == null)
continue;
- ref = repository.peel(ref);
+ ref = repository.getRefDatabase().peel(ref);
}
if (ref.getPeeledObjectId() != null)
}
if (!ref.isPeeled())
- ref = db.peel(ref);
+ ref = db.getRefDatabase().peel(ref);
ObjectId peeledId = ref.getPeeledObjectId();
objectId = ref.getObjectId();