Infer the default branch during changeset init - #2246
Conversation
✅ Deploy Preview for changesets ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
🦋 Changeset detectedLatest commit: 91be9fb The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2246 +/- ##
==========================================
+ Coverage 84.53% 84.61% +0.07%
==========================================
Files 80 80
Lines 3168 3184 +16
Branches 892 897 +5
==========================================
+ Hits 2678 2694 +16
Misses 433 433
Partials 57 57 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
I'm not sure about this approach, there's no guarantee that the user will be on the default branch when they run changeset init and it would be confusing if we suggest the wrong default value. |
|
Checking |
Closes #807.
When
changeset initasks for a base branch, it now reads the symbolicorigin/HEADand verifies that its target ref exists. It continues usingmainif Git is unavailable or the ref cannot be resolved. A branch entered at the prompt still takes precedence.Focused tests cover non-
main, missing, dangling, non-origin, unavailable-Git, and explicit-input cases. The focused 49 tests, build, typecheck, lint, and format checks pass.The full suite reports 915 passing tests and one unchanged
packages/writeformatter-fixture failure:pnpm exec oxfmtexits with status 1 inside its isolated temporary workspace.