diff options
author | Han-Wen Nienhuys <hanwen@google.com> | 2019-11-17 15:05:57 -0800 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2019-11-26 01:57:19 +0100 |
commit | 9cb8e2f31035d265b83ba4e295aa3abb4c737ebf (patch) | |
tree | c11f6b01deda4f82d0390932ee17013b43807c6c /org.eclipse.jgit.test | |
parent | e0744891fe233f1b78b55ea14675d5766d3ac321 (diff) | |
download | jgit-9cb8e2f31035d265b83ba4e295aa3abb4c737ebf.tar.gz jgit-9cb8e2f31035d265b83ba4e295aa3abb4c737ebf.zip |
RepositoryCache: don't require HEAD in git repositories
Reftable-enabled repositories don't have a file called HEAD. Check for
reftable/ instead.
This fixes repository creation on reftable in Gerrit.
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Change-Id: I778c2be01d96aaf135affae4b457b5fe5b483bee
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileReftableTest.java | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileReftableTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileReftableTest.java index e0e20fb4dd..0e06d459a2 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileReftableTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/FileReftableTest.java @@ -73,6 +73,7 @@ import org.eclipse.jgit.lib.RefUpdate; import org.eclipse.jgit.lib.RefUpdate.Result; import org.eclipse.jgit.lib.ReflogEntry; import org.eclipse.jgit.lib.ReflogReader; +import org.eclipse.jgit.lib.RepositoryCache; import org.eclipse.jgit.revwalk.RevWalk; import org.eclipse.jgit.test.resources.SampleDataRepositoryTestCase; import org.eclipse.jgit.transport.ReceiveCommand; @@ -508,6 +509,11 @@ public class FileReftableTest extends SampleDataRepositoryTestCase { } @Test + public void isGitRepository() { + assertTrue(RepositoryCache.FileKey.isGitRepository(db.getDirectory(), db.getFS())); + } + + @Test public void testRenameDestExists() throws IOException { ObjectId rb = db.resolve("refs/heads/b"); writeSymref(Constants.HEAD, "refs/heads/b"); |