Skip to content

Fix overlay ctime stat cache#20

Open
elithrar wants to merge 2 commits intomainfrom
opencode/fix-stat-cache-ctime
Open

Fix overlay ctime stat cache#20
elithrar wants to merge 2 commits intomainfrom
opencode/fix-stat-cache-ctime

Conversation

@elithrar
Copy link
Copy Markdown
Collaborator

@elithrar elithrar commented May 6, 2026

Builds on Richard Morrill's timestamp fix in #17 by preserving Git's ctime stat-cache guard for writable overlay files.

Case Before After
Base attrs Missing atime/ctime could produce invalid zero timestamps Base attrs use stable commit time for atime/mtime/ctime
Overlay attrs ctime effectively followed caller-controlled mtime Overlay stores and reports ctime separately from mtime
Same-size rewrite + mtime restore Git could miss the dirty file Git still sees changed ctime and reports it dirty
Truncate Size/time metadata could drift from backing file changes Truncate updates overlay size, mtime, and ctime together

Tests: go build ./cmd/artifact-fs; go vet ./...; go test ./...; AFS_RUN_E2E_TESTS=1 go test -run TestE2EGitStatusDetectsSameSizeRewriteAfterMtimeRestore -v .

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