Skip to content

Commit acce232

Browse files
ovaistariqclaude
andcommitted
fix: Remove lock condition from mtime update for consistency
The mtime update logic in the `inode == parent` path was inconsistent with the `inode != parent` paths. In child directories (inode != parent), mtime updates occur regardless of the `lock` parameter. However, parent directories (inode == parent) only updated mtime when lock=true. This inconsistency meant that when lock=false (e.g., called from Rename), parent directories wouldn't get their mtime updated even when new items were found, leading to potentially stale timestamps. Remove the `&& lock` condition to ensure mtime updates happen consistently across all code paths whenever a directory is already sealed but new items are discovered during listing. Fixes review comment from Cursor bot. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent a96adb3 commit acce232

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

core/dir.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,8 +435,8 @@ func (parent *Inode) listObjectsSlurp(inode *Inode, startAfter string, sealEnd b
435435
sealSucceeded = parent.sealDirWithValidation()
436436
alreadySealed = !sealSucceeded && parent.dir.listDone
437437

438-
// Special case: if already sealed but got items, update mtime (lock=true only)
439-
if alreadySealed && hasItems && lock {
438+
// Special case: if already sealed but got items, update mtime
439+
if alreadySealed && hasItems {
440440
parent.updateDirectoryMtime()
441441
}
442442

0 commit comments

Comments
 (0)