Skip to content
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

Fix handling of symlink files #133

Merged
merged 2 commits into from
Dec 12, 2024
Merged

Conversation

Pennycook
Copy link
Contributor

Related issues

Fixes #132.

Proposed changes

  • Add a regression test for source files that are symlinks to other source files.
  • Update setmap construction to ensure that symlinks are only counted once.

The original test_duplicates only covered the case where a codebase contains a
directory that is a symlink to another directory; we did not have a
corresponding test to cover the case where a codebase contains a source file
that is a symlink to another source file.

Signed-off-by: John Pennycook <[email protected]>
If a symlink and its target are both in the code base, we should only count the
file's contributions to code divergence once. The simplest way to achieve this
is to skip processing of the symlink when constructing the setmap.

Signed-off-by: John Pennycook <[email protected]>
@Pennycook Pennycook added the bug Something isn't working label Nov 28, 2024
@Pennycook Pennycook added this to the 2.0.0 milestone Nov 28, 2024
Copy link
Contributor

@laserkelvin laserkelvin left a comment

Choose a reason for hiding this comment

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

LGTM

@Pennycook Pennycook merged commit 060c70d into intel:main Dec 12, 2024
3 checks passed
@Pennycook Pennycook deleted the symlink-files branch December 12, 2024 10:51
@Pennycook Pennycook mentioned this pull request Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

symlink files are not handled correctly
2 participants