assertEquals("d0114ab8ac326bab30e3a657a0397578c5a1af88",db.resolve("49322bb17d3acc9146f98c97d078513228bbf3c0^03").name());
}
+ @Test
+ public void testObjectId_objectid_invalid_explicit_parent() throws IOException {
+ assertEquals("42e4e7c5e507e113ebbb7801b16b52cf867b7ce1",db.resolve("6462e7d8024396b14d7651e2ec11e2bbf07a05c4^1").name());
+ assertNull(db.resolve("6462e7d8024396b14d7651e2ec11e2bbf07a05c4^2"));
+ assertEquals("42e4e7c5e507e113ebbb7801b16b52cf867b7ce1",db.resolve("42e4e7c5e507e113ebbb7801b16b52cf867b7ce1^0").name());
+ assertNull(db.resolve("42e4e7c5e507e113ebbb7801b16b52cf867b7ce1^1"));
+ assertNull(db.resolve("42e4e7c5e507e113ebbb7801b16b52cf867b7ce1^2"));
+ }
+
@Test
public void testRef_refname() throws IOException {
assertEquals("49322bb17d3acc9146f98c97d078513228bbf3c0",db.resolve("master^0").name());
assertEquals("1203b03dc816ccbb67773f28b3c19318654b0bc8",db.resolve("49322bb17d3acc9146f98c97d078513228bbf3c0~~~0").name());
}
+ @Test
+ public void testDistance_past_root() throws IOException {
+ assertEquals("42e4e7c5e507e113ebbb7801b16b52cf867b7ce1",db.resolve("6462e7d8024396b14d7651e2ec11e2bbf07a05c4~1").name());
+ assertNull(db.resolve("6462e7d8024396b14d7651e2ec11e2bbf07a05c4~~"));
+ assertNull(db.resolve("6462e7d8024396b14d7651e2ec11e2bbf07a05c4~2"));
+ assertNull(db.resolve("6462e7d8024396b14d7651e2ec11e2bbf07a05c4~99"));
+ assertNull(db.resolve("42e4e7c5e507e113ebbb7801b16b52cf867b7ce1~~"));
+ assertNull(db.resolve("42e4e7c5e507e113ebbb7801b16b52cf867b7ce1~2"));
+ assertNull(db.resolve("42e4e7c5e507e113ebbb7801b16b52cf867b7ce1~99"));
+ assertEquals("42e4e7c5e507e113ebbb7801b16b52cf867b7ce1",db.resolve("master~6").name());
+ assertNull(db.resolve("master~7"));
+ assertNull(db.resolve("master~6~"));
+ }
+
@Test
public void testTree() throws IOException {
assertEquals("6020a3b8d5d636e549ccbd0c53e2764684bb3125",db.resolve("49322bb17d3acc9146f98c97d078513228bbf3c0^{tree}").name());
if (name == null)
name = new String(revChars, done, i);
rev = parseSimple(rw, name);
+ name = null;
if (rev == null)
return null;
}
// detached
name = Constants.HEAD;
Ref ref = getRef(name);
+ name = null;
if (ref == null)
return null;
if (ref.isSymbolic())
if (name.equals(""))
name = Constants.HEAD;
Ref ref = getRef(name);
+ name = null;
if (ref == null)
return null;
// @{n} means current branch, not HEAD@{1} unless
if (ref.isSymbolic())
ref = ref.getLeaf();
rev = resolveReflog(rw, ref, time);
- name = null;
}
i = m;
} else
if (name.equals(""))
name = Constants.HEAD;
rev = parseSimple(rw, name);
+ name = null;
}
if (rev == null)
return null;