Peel tags during resolve of foo^
Once we start talking about parents of tags, we are in the commit graph, so treat all objects from this point as commits. This fixes spurious IncorrectObjectTypeExceptions on resolving expressions like tag^^. Change-Id: I29ece1fdb49c9c5b9ca415efcd1876bc72e97120
This commit is contained in:
parent
4407423d29
commit
891a2d75e7
|
@ -178,9 +178,11 @@ public void testDerefTag() throws IOException {
|
|||
assertEquals("d86a2aada2f5e7ccf6f11880bfb9ab404e8a8864",db.resolve("refs/tags/B10th^0").name());
|
||||
assertEquals("d86a2aada2f5e7ccf6f11880bfb9ab404e8a8864",db.resolve("refs/tags/B10th~0").name());
|
||||
assertEquals("0966a434eb1a025db6b71485ab63a3bfbea520b6",db.resolve("refs/tags/B10th^").name());
|
||||
assertEquals("2c349335b7f797072cf729c4f3bb0914ecb6dec9",db.resolve("refs/tags/B10th^^").name());
|
||||
assertEquals("0966a434eb1a025db6b71485ab63a3bfbea520b6",db.resolve("refs/tags/B10th^1").name());
|
||||
assertEquals("0966a434eb1a025db6b71485ab63a3bfbea520b6",db.resolve("refs/tags/B10th~1").name());
|
||||
assertEquals("2c349335b7f797072cf729c4f3bb0914ecb6dec9",db.resolve("refs/tags/B10th~2").name());
|
||||
assertEquals("2c349335b7f797072cf729c4f3bb0914ecb6dec9",db.resolve("refs/tags/B10th^~1").name());
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -509,7 +509,7 @@ private Object resolve(final RevWalk rw, final String revstr)
|
|||
done = k;
|
||||
break;
|
||||
default:
|
||||
rev = rw.parseAny(rev);
|
||||
rev = rw.peel(rev);
|
||||
if (rev instanceof RevCommit) {
|
||||
RevCommit commit = ((RevCommit) rev);
|
||||
if (commit.getParentCount() == 0)
|
||||
|
|
Loading…
Reference in New Issue