Skip to content

Commit 5e6a282

Browse files
coopernetesclaude
andcommitted
test: fix ForwardingPostReceiveHookTest relying on host git init.defaultBranch
Without setInitialBranch("main"), JGit uses its built-in default ("master"), so refs/heads/main never gets created and RemoteRefUpdate fails in CI where no global init.defaultBranch=main is set. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent dd34226 commit 5e6a282

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

jgit-proxy-core/src/test/java/org/finos/gitproxy/git/ForwardingPostReceiveHookTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,10 @@ class ForwardingPostReceiveHookTest {
3535
@BeforeEach
3636
void setUp() throws Exception {
3737
// Local (proxy-side) repo
38-
localGit = Git.init().setDirectory(localDir.toFile()).call();
38+
localGit = Git.init()
39+
.setDirectory(localDir.toFile())
40+
.setInitialBranch("main")
41+
.call();
3942
localRepo = localGit.getRepository();
4043
localRepo.getConfig().setBoolean("commit", null, "gpgsign", false);
4144
localRepo.getConfig().save();

0 commit comments

Comments
 (0)