|
|
@ -267,7 +267,7 @@ public class RepositoryResolveTest extends SampleDataRepositoryTestCase { |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void resolveExprSimple() throws Exception { |
|
|
|
public void resolveExprSimple() throws Exception { |
|
|
|
Git git = new Git(db); |
|
|
|
try (Git git = new Git(db)) { |
|
|
|
writeTrashFile("file.txt", "content"); |
|
|
|
writeTrashFile("file.txt", "content"); |
|
|
|
git.add().addFilepattern("file.txt").call(); |
|
|
|
git.add().addFilepattern("file.txt").call(); |
|
|
|
git.commit().setMessage("create file").call(); |
|
|
|
git.commit().setMessage("create file").call(); |
|
|
@ -275,10 +275,11 @@ public class RepositoryResolveTest extends SampleDataRepositoryTestCase { |
|
|
|
assertEquals("refs/heads/master", db.simplify("refs/heads/master")); |
|
|
|
assertEquals("refs/heads/master", db.simplify("refs/heads/master")); |
|
|
|
assertEquals("HEAD", db.simplify("HEAD")); |
|
|
|
assertEquals("HEAD", db.simplify("HEAD")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void resolveUpstream() throws Exception { |
|
|
|
public void resolveUpstream() throws Exception { |
|
|
|
Git git = new Git(db); |
|
|
|
try (Git git = new Git(db)) { |
|
|
|
writeTrashFile("file.txt", "content"); |
|
|
|
writeTrashFile("file.txt", "content"); |
|
|
|
git.add().addFilepattern("file.txt").call(); |
|
|
|
git.add().addFilepattern("file.txt").call(); |
|
|
|
RevCommit c1 = git.commit().setMessage("create file").call(); |
|
|
|
RevCommit c1 = git.commit().setMessage("create file").call(); |
|
|
@ -297,6 +298,7 @@ public class RepositoryResolveTest extends SampleDataRepositoryTestCase { |
|
|
|
git.commit().setMessage("create file").call(); |
|
|
|
git.commit().setMessage("create file").call(); |
|
|
|
assertEquals("refs/remotes/origin/main", db.simplify("@{upstream}")); |
|
|
|
assertEquals("refs/remotes/origin/main", db.simplify("@{upstream}")); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
@Test |
|
|
|
public void invalidNames() throws AmbiguousObjectException, IOException { |
|
|
|
public void invalidNames() throws AmbiguousObjectException, IOException { |
|
|
|