Skip to content

fix: return explicit message when changes() compares identical versions#3

Merged
practicalmind-dev merged 1 commit into
PracticalMind:mainfrom
MohammadYusif:fix/issue-2
May 28, 2026
Merged

fix: return explicit message when changes() compares identical versions#3
practicalmind-dev merged 1 commit into
PracticalMind:mainfrom
MohammadYusif:fix/issue-2

Conversation

@MohammadYusif
Copy link
Copy Markdown
Contributor

Closes #2

## What

When `changes()` is called on two versions with identical content, the diff produces zero added and zero removed lines. Previously this rendered as:

system | v1 -> v2

  • ADDED (0 lines)
  • REMOVED (0 lines)

This is misleading — it looks like a real diff result rather than "nothing changed."

## Fix

Added an early-return check in `changes()` after filtering the diff lines. If both `added` and `removed` are empty, the method now returns:

No changes between v1 and v2.


## Test

Added `test_changes_identical_versions_returns_no_changes_message` in `tests/test_core.py`: saves the same content twice and asserts the exact "No changes between v1 and v2." message is returned.

@practicalmind-dev practicalmind-dev merged commit bd3be1e into PracticalMind:main May 28, 2026
4 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