Skip to content

filterdiff: don't add prefixes to /dev/null - #182

Open
SAY-5 wants to merge 1 commit into
twaugh:0.4.xfrom
SAY-5:filterdiff-devnull-prefix
Open

SAY-5 wants to merge 1 commit into
twaugh:0.4.xfrom
SAY-5:filterdiff-devnull-prefix

Conversation

@SAY-5

@SAY-5 SAY-5 commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Pull Request Guidelines

Important: Please note our branching strategy:

  • master branch is for development towards 0.5.0
  • 0.4.x branch is for stable 0.4.x releases and bug fixes

If you're submitting a bug fix for the stable release:

  • Target the 0.4.x branch
  • Bug fixes will be merged into master if needed

If you're submitting a new feature:

  • Target the master branch

Description

output_header_line() added the --addprefix, --addoldprefix and --addnewprefix prefix to every ---/+++ name, so file additions and deletions came out as --- src/3rdparty//dev/null. This checks the name before writing the prefix and leaves /dev/null alone, the same way stripped() already does. Fixes #179.

Type of Change

Bug fix (targets 0.4.x)

Testing

Added tests/filterdiff-devnull, which runs an add and a delete through --addprefix and through --addoldprefix/--addnewprefix and compares the output. It fails without the change. lsdiff --addprefix was already fine since it lists the real file name.

Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
@codecov

codecov Bot commented Nov 20, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 83.79%. Comparing base (490f515) to head (691247f).

Additional details and impacted files
@@            Coverage Diff             @@
##            0.4.x     #182      +/-   ##
==========================================
+ Coverage   83.59%   83.79%   +0.20%     
==========================================
  Files           5        5              
  Lines        4219     4222       +3     
  Branches     1008     1011       +3     
==========================================
+ Hits         3527     3538      +11     
+ Misses        692      684       -8     
Flag Coverage Δ
unittests 83.79% <100.00%> (+0.20%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

1 participant