diff --git a/opengrok-indexer/src/test/java/org/opengrok/indexer/history/FileHistoryCacheTest.java b/opengrok-indexer/src/test/java/org/opengrok/indexer/history/FileHistoryCacheTest.java index 830dd9e3cbc..c8c60d4a639 100644 --- a/opengrok-indexer/src/test/java/org/opengrok/indexer/history/FileHistoryCacheTest.java +++ b/opengrok-indexer/src/test/java/org/opengrok/indexer/history/FileHistoryCacheTest.java @@ -823,7 +823,7 @@ static void changeFileAndCommit(Git git, File file, String comment) throws Excep fos.write(comment.getBytes(StandardCharsets.UTF_8)); } - git.commit().setMessage(comment).setAuthor(authorName, authorEmail).setAll(true).call(); + git.commit().setSign(false).setMessage(comment).setAuthor(authorName, authorEmail).setAll(true).call(); } /** @@ -868,7 +868,7 @@ void testRenamedFileHistoryWithPerPartes(int maxCount) throws Exception { assertTrue(fooFile.renameTo(barFile)); git.add().addFilepattern("bar.txt").call(); git.rm().addFilepattern("foo.txt").call(); - git.commit().setMessage("rename").setAuthor("foo", "foo@bar").setAll(true).call(); + git.commit().setSign(false).setMessage("rename").setAuthor("foo", "foo@bar").setAll(true).call(); changeFileAndCommit(git, barFile, "4"); changeFileAndCommit(git, barFile, "5"); diff --git a/opengrok-indexer/src/test/java/org/opengrok/indexer/history/GitRepositoryTest.java b/opengrok-indexer/src/test/java/org/opengrok/indexer/history/GitRepositoryTest.java index 708006f45e5..b1da08ac1dc 100644 --- a/opengrok-indexer/src/test/java/org/opengrok/indexer/history/GitRepositoryTest.java +++ b/opengrok-indexer/src/test/java/org/opengrok/indexer/history/GitRepositoryTest.java @@ -180,6 +180,7 @@ void testDetermineCurrentVersionAfterChange() throws Exception { String comment = "Added testfile"; String authorName = "Foo Bar"; gitClone.commit() + .setSign(false) .setMessage(comment) .setAuthor(authorName, "foo@bar.com") .call(); @@ -255,7 +256,7 @@ void testGetHistoryInBranch() throws Exception { int numEntries = history.getHistoryEntries().size(); assertTrue(numEntries > 0); - RevCommit commit = gitClone.commit(). + RevCommit commit = gitClone.commit().setSign(false). setAuthor("Snufkin", "snufkin@moomin.valley"). setMessage("fresh commit on a new branch").setAllowEmpty(true).call(); assertNotNull(commit); diff --git a/opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexDatabaseTest.java b/opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexDatabaseTest.java index 7c938243cb5..b70717b85c2 100644 --- a/opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexDatabaseTest.java +++ b/opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexDatabaseTest.java @@ -318,7 +318,7 @@ static RevCommit changeFileAndCommit(Git git, File file, String comment) throws } private static RevCommit commitFile(Git git, String comment, String authorName, String authorEmail) throws GitAPIException { - return git.commit().setMessage(comment).setAuthor(authorName, authorEmail).setAll(true).call(); + return git.commit().setSign(false).setMessage(comment).setAuthor(authorName, authorEmail).setAll(true).call(); } private void addFileAndCommit(Git git, String newFileName, File repositoryRoot, String message) throws Exception { @@ -359,7 +359,7 @@ private void addMergeCommit(Git git, File repositoryRoot) throws Exception { // Commit the merge separately so that the author can be set. // (MergeCommand - a result of git.merge() - does not have the setAuthor() method) - git.commit().setAuthor("foo bar", "foobar@example.com").call(); + git.commit().setSign(false).setAuthor("foo bar", "foobar@example.com").call(); } private void changeGitRepository(File repositoryRoot) throws Exception { @@ -396,7 +396,7 @@ private void changeGitRepository(File repositoryRoot, boolean addSymlinks) throw File rmFile = new File(repositoryRoot, deletedFileName); assertTrue(rmFile.exists()); git.rm().addFilepattern(deletedFileName).call(); - git.commit().setMessage("delete").setAuthor("foo", "foobar@example.com").setAll(true).call(); + git.commit().setSign(false).setMessage("delete").setAuthor("foo", "foobar@example.com").setAll(true).call(); assertFalse(rmFile.exists()); // Rename some file. @@ -408,7 +408,7 @@ private void changeGitRepository(File repositoryRoot, boolean addSymlinks) throw assertTrue(fooFile.renameTo(barFile)); git.add().addFilepattern(barFileName).call(); git.rm().addFilepattern(fooFileName).call(); - git.commit().setMessage("rename").setAuthor("foo", "foobar@example.com").setAll(true).call(); + git.commit().setSign(false).setMessage("rename").setAuthor("foo", "foobar@example.com").setAll(true).call(); assertTrue(barFile.exists()); assertFalse(fooFile.exists()); @@ -441,7 +441,7 @@ private void addSymlinksToGitRepository(Git git, File repositoryRoot) throws Exc addFilepattern(fileLinkName). addFilepattern(dirLinkName).call(); - git.commit().setMessage("add symlinks").setAuthor("foo", "foobar@example.com"). + git.commit().setSign(false).setMessage("add symlinks").setAuthor("foo", "foobar@example.com"). setAll(true).call(); } @@ -1154,6 +1154,7 @@ void testNullifiedChanges() throws Exception { changeFileAndCommit(gitParent, barFile, "change bar"); // Revert the changes done to foo.txt so that the changes got nullified for the subsequent pull. + gitParent.getRepository().getConfig().setBoolean("commit", null, "gpgsign", false); gitParent.revert().include(commit).call(); // Bring the changes to the repository to be indexed. Again, done for better simulation. diff --git a/opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexerVsDeletedDocumentsTest.java b/opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexerVsDeletedDocumentsTest.java index cc81c443fe0..077c3d5927d 100644 --- a/opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexerVsDeletedDocumentsTest.java +++ b/opengrok-indexer/src/test/java/org/opengrok/indexer/index/IndexerVsDeletedDocumentsTest.java @@ -266,7 +266,7 @@ void testIndexTraversalWithDeletedDocuments(boolean projectsEnabled, boolean use } } if (gitRepo != null) { - gitRepo.commit().setMessage("initial content").setAuthor(authorName, authorEmail).call(); + gitRepo.commit().setSign(false).setMessage("initial content").setAuthor(authorName, authorEmail).call(); } // Add the project and optionally detect the Git repository. env.setProjects(new HashMap<>()); @@ -324,7 +324,7 @@ void testIndexTraversalWithDeletedDocuments(boolean projectsEnabled, boolean use } if (gitRepo != null) { - gitRepo.commit().setMessage(String.format("iteration %d", i)).setAuthor(authorName, authorEmail).call(); + gitRepo.commit().setSign(false).setMessage(String.format("iteration %d", i)).setAuthor(authorName, authorEmail).call(); } listener.reset();