Skip to content

fix: exempt the Tauri icons from an LFS filter this repo does not use - #186

Merged
acamarata merged 1 commit into
mainfrom
fix/gitattributes-lfs-blocks-ref-switch
Sep 15, 2026
Merged

acamarata merged 1 commit into
mainfrom
fix/gitattributes-lfs-blocks-ref-switch

Conversation

@acamarata

Copy link
Copy Markdown
Collaborator

The bug

Any PR that changes a tracked PNG breaks Coverage Diff:

error: Your local changes to the following files would be overwritten by checkout:
        desktop/src-tauri/icons/128x128.png
        desktop/src-tauri/icons/128x128@2x.png
        desktop/src-tauri/icons/32x32.png
Aborting

Nothing modified those files. The job checks out the base ref to measure baseline coverage, then returns — and git refuses.

.gitattributes declares *.png filter=lfs diff=lfs merge=lfs -text, under a comment saying these types "should only exist in GitHub Releases, never tracked in git history". But this repo does not use LFS:

  • no .lfsconfig
  • 32 tracked PNGs, zero of them LFS pointers — all real blobs

Every GitHub-hosted runner ships git-lfs, so the clean filter reports a tracked PNG as locally modified, and any job that switches refs fails. This is latent for all 32 PNGs; it only surfaced now because #181 is the first PR in a while to change one.

Why this has to land separately

It cannot validate itself inside the PR that needs it. Coverage Diff spends part of its run on the base ref, where the exemption would not yet exist — so the return git checkout - is blocked even when the head has the fix. Observed exactly that on #181: with the fix on the head only, the base checkout succeeded and the base suite ran (32,430 passed), then coming back failed.

The exemption has to be on main first. This PR touches no PNG, so its own Coverage Diff has nothing to be blocked by.

The fix

desktop/src-tauri/icons/** -filter -diff -merge -text

Scoped to the Tauri icon directory because that is where it is forced: tauri.conf.json's bundle.icon reads those files from the working tree at build time, so "keep it in a Release instead" is not an option for them.

Deliberately not changed

The org-wide *.png filter=lfs rule stays. The broader observation — that filter=lfs prevents nothing and only breaks checkouts when LFS is installed — belongs to whoever owns that standard file, and changing it here would quietly alter behaviour for 29 other PNGs I have not looked at.

Coverage Diff failed on this PR:

  error: Your local changes to the following files would be overwritten by checkout:
        desktop/src-tauri/icons/128x128.png
        desktop/src-tauri/icons/128x128@2x.png
        desktop/src-tauri/icons/32x32.png
  Please commit your changes or stash them before you switch branches.

Nothing modified those files. The job checks out the base ref to compare coverage,
and git refused.

.gitattributes declares `*.png filter=lfs diff=lfs merge=lfs -text` under a comment
saying these types "should only exist in GitHub Releases, never tracked in git
history". But this repo does not use LFS at all: there is no .lfsconfig, and all 32
tracked PNGs are real blobs — none is a pointer. On a runner that HAS git-lfs
installed (every GitHub-hosted runner does) the clean filter reports a tracked PNG
as locally modified, so any job that switches refs fails.

This is latent for all 32 PNGs; this PR is simply the first in a while to change
one. Exempt the Tauri icon directory, which is where it actually matters: those
files must be tracked because tauri.conf.json's bundle.icon reads them from the
working tree at build time, so "keep it in a Release instead" is not available.

Committed locally with git-lfs absent, so the blobs are genuine image data — the
Windows and macOS builds that consumed them both passed and uploaded real
artifacts, which would not be true of pointer files.

The wider question — that `filter=lfs` does not prevent anything and only breaks
checkouts when LFS is present — is left for the org-wide .gitattributes owner.
@github-actions

Copy link
Copy Markdown

PR Checks Summary

Check Status
Lint & Format ⏭️ skipped
Type Check ⏭️ skipped
Unit Tests ⏭️ skipped
Build ⏭️ skipped

All checks passed! Ready for review.

@github-actions

Copy link
Copy Markdown

Security Scan Results: PASSED

Scanner Critical High
SAST 0 0
Dependencies 0 0

@acamarata
acamarata merged commit 8f7950b into main Sep 15, 2026
37 checks passed
@acamarata
acamarata deleted the fix/gitattributes-lfs-blocks-ref-switch branch September 15, 2026 00:09
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