Repository navigation
fix(git): wrong changeset file commit - #2277
Conversation
🦋 Changeset detectedLatest commit: ead294f 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 |
✅ Deploy Preview for changesets ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2277 +/- ##
=======================================
Coverage 84.57% 84.57%
=======================================
Files 80 80
Lines 3177 3177
Branches 894 894
=======================================
Hits 2687 2687
Misses 433 433
Partials 57 57 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Can you elaborate on this? We should be capturing the commits first before deleting the files. With the |
Ah true, I confused the method order. Nonetheless, I strongly recommend using the
Where exactly does it mention this? |
I tested it manually. If you delete When it fails, it also logs this which kinda explains it ("path not in the working tree"): |
Gotcha. I think the error happens because git doesn't fully understand that we want to pass the path argument (as the file doesn't exist). It interpretes our path as a revision, but this is no revision. So adding I initially included it because I also thought that the command would fail with the error you showed. However, since we get the commits before deleting, I think it isn't strictly necessarily to include the So IMHO we should keep the |
|
I'd prefer removing |
|
I removed it for now because if you use |
| expect(commits).toEqual([originalCommit]); | ||
| }); | ||
|
|
||
| it("reads the SHA of a file-add when tweaked then moved to pre", async () => { |
Description
This PR fixes a regression added here, where similar changeset files can lead to wrong commit SHA lookups if the file content is very similar.
The fix adds the
C(copy) git type to the--diff-filteroption, which means that two changeset files will not be mixed up by git just because they have similar content.@changesets/changelog-github#2272