Skip to content

Conversation

WooWan
Copy link
Contributor

@WooWan WooWan commented Aug 10, 2025

What's the problem this PR addresses?

This PR adds --initial-branch=master option to ensure consistent test behavior across different development environments.

Git has used main as the default branch for quite some time now, while our tests expect master. When I ran the integration tests with my default configuration (using main), they failed due to this mismatch.
This change ensures tests pass reliably regardless of local git configuration and lowers the barrier to entry for new contributors!

Example error:

 FAIL  pkg-tests-specs/sources/commands/version/check.test.js (13.598 s)
  ● Commands › version check › it shouldn't detect a change when pulling master

    Temporary fixture folder: /private/var/folders/y2/dwrgd4rx32n7phb939mny5p00000gn/T/xfs-46e897df/test

    Command failed: git checkout master
    error: pathspec 'master' did not match any file(s) known to git


    ===== stdout:

    ```
    ```

    ===== stderr:

    ```
    error: pathspec 'master' did not match any file(s) known to git
    ```

...

How did you fix it?

Explicitly set initial branch to master to ensure consistent test behavior.

Checklist

  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

@arcanis arcanis merged commit cfa99b0 into yarnpkg:master Aug 20, 2025
26 checks passed
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.

2 participants