Skip to content

Make AheadBehindTest branch explicit - #942

Draft
NginxL wants to merge 1 commit into
git-commit-id:masterfrom
NginxL:fix/653-independent-initial-branch
Draft

NginxL wants to merge 1 commit into
git-commit-id:masterfrom
NginxL:fix/653-independent-initial-branch

Conversation

@NginxL

@NginxL NginxL commented Dec 5, 2026

Copy link
Copy Markdown

Fixes #653.

AheadBehindTest now initializes the bare remote on an explicit test branch and uses the same branch for both clones and the local tracking configuration. The test no longer depends on a contributor's init.defaultBranch=master setting.

Checks

  • Confirmed all hard-coded master references in AheadBehindTest.java were replaced by one branch constant.
  • Ran an equivalent native-git fixture: bare remote initialized with --initial-branch=test, initial commit pushed, second clone created on test, and pull succeeded.
  • git diff --check and git diff --cached --check passed.
  • Rechecked that AheadBehindTest relies on defaultBranch=master in .gitconfig #653 had no assignee or linked open PR before opening this one.

Gaps

  • The focused Maven/JUnit test was not run locally: this machine has no Java runtime or mvn executable, and installing a JDK/Maven is outside this batch's tooling limits. Cached Maven dependencies alone cannot execute the test.
  • JGit compilation and the four AheadBehindTest cases are therefore left to CI; the used Git.init().setInitialBranch(...) API matches the fix direction discussed in AheadBehindTest relies on defaultBranch=master in .gitconfig #653.

AI disclosure: this contribution was prepared with AI assistance and reviewed against the test setup and issue reproduction. The commit includes a DCO Signed-off-by trailer.

Initialize the bare remote and both clones on a dedicated test branch so the setup no longer depends on init.defaultBranch=master in contributor git configuration.

AI disclosure: this contribution was prepared with AI assistance and reviewed against the reported JGit setup path.

Signed-off-by: NginxL <8777777+NginxL@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AheadBehindTest relies on defaultBranch=master in .gitconfig

1 participant