Skip to content

Add test for rename tracking per hunk #2039

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 9, 2025

Conversation

cruessler
Copy link
Contributor

  • Add test for source file name tracking per hunk
  • Remove obsolete comment

This PR adds a test case for the issue fixed in 7435ed5. The issue was related to the fact that, before the fix, source_file_name was only tracked globally, as opposed to locally, i. e. on a per-hunk basis.

The test case constructs a repository that has the same rename twice, in two different branches. Tracking source_file_name globally is insufficient to capture this history which is why this test fails without the fix.

cruessler and others added 3 commits June 7, 2025 13:16
This is a test case for the issue fixed in
7435ed5. The issue was related to the
fact that, before the fix, `source_file_name` was only tracked globally,
as opposed to locally, i. e. on a per-hunk basis.

The test case constructs a repository that has the same rename twice, in
two different branches. Tracking `source_file_name` globally is
insufficient to capture this history which is why this test fails
without the fix.
- an easier way of generate changing lines.
@Byron Byron force-pushed the add-test-for-rename-tracking branch from 932eaea to 8e2bc0f Compare June 9, 2025 09:22
Copy link
Member

@Byron Byron left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot, much appreciated!

I have started to move fixture scripts from verbose echo 'line1\nline2\n' to seq X Y and hope that other code here is also eligible for that.

Finally, I thought that now that tests stabilise, one could replace .unwrap() with ?, but didn't do that myself in the interest of time (and in feat this would also turn Option::unwrap() into ? and fail (these could then be .expect()).

@Byron Byron enabled auto-merge June 9, 2025 09:26
@Byron Byron merged commit 073487b into GitoxideLabs:main Jun 9, 2025
23 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