Skip to content

fix(backup): detect modified files using SHA-256 checksums#70

Merged
olxgdm merged 7 commits into
mainfrom
69-backup-command-skips-modified-files-when-backup-already-exists
Jun 1, 2026
Merged

fix(backup): detect modified files using SHA-256 checksums#70
olxgdm merged 7 commits into
mainfrom
69-backup-command-skips-modified-files-when-backup-already-exists

Conversation

@olxgdm

@olxgdm olxgdm commented May 27, 2026

Copy link
Copy Markdown
Owner

Fix backup synchronization logic to detect modified tracked files instead of checking only for backup file existence.

Previously, the backup command skipped files whenever a stored backup already existed, even if the original file had been modified after the initial backup.

This change introduces SHA-256 checksum comparison between the original file and the stored backup to determine whether the backup is up to date.

Changes

  • Replaced backup existence check with checksum-based validation
  • Added SHA-256 file hashing using OpenSSL (EVP_* API)
  • Added StoredBackupIsUpToDate() logic
  • Updated backup flow to re-backup modified files
  • Added OpenSSL crypto linkage in CMake

Result

Backup execution now:

  • skips files only when contents are identical
  • correctly detects modified tracked files
  • creates updated backups when file contents change

Technical Notes

  • SHA-256 hashes are calculated incrementally using buffered file reads
  • OpenSSL Crypto component is linked via OpenSSL::Crypto

@olxgdm olxgdm linked an issue May 27, 2026 that may be closed by this pull request
@olxgdm olxgdm force-pushed the 69-backup-command-skips-modified-files-when-backup-already-exists branch from 1eeebc2 to 43e028d Compare May 28, 2026 17:44
@olxgdm olxgdm self-assigned this Jun 1, 2026
@sonarqubecloud

sonarqubecloud Bot commented Jun 1, 2026

Copy link
Copy Markdown

@olxgdm olxgdm merged commit 22d32be into main Jun 1, 2026
6 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.

Backup command skips modified files when backup already exists

1 participant