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;
}
}
+ @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");
public static boolean isGitRepository(File dir, FS fs) {
return fs.resolve(dir, Constants.OBJECTS).exists()
&& fs.resolve(dir, "refs").exists() //$NON-NLS-1$
- && isValidHead(new File(dir, Constants.HEAD));
+ && (fs.resolve(dir, Constants.REFTABLE).exists()
+ || isValidHead(new File(dir, Constants.HEAD)));
}
private static boolean isValidHead(File head) {