Repository navigation
git-internal v0.10.4
Release date: 2026-10-27 · Crate: git-internal 0.10.4 · Full changelog: CHANGELOG.md
git-internal v0.10.4 fixes a data-integrity bug in index writing reported in #184: every newly created index entry was marked assume-unchanged.
Fixed
Flags::new()no longer setsassume_valid(#184). Every entry built byIndexEntry::new,IndexEntry::new_from_fileandIndexEntry::new_from_blobwas previously written withCE_VALID(0x8000, Git's assume-unchanged bit). Git honours that bit unconditionally and skips the worktreestat. Any Git reading an index written by this crate silently ignored modifications and deletions:git statusandgit diffshowed nothing, andgit commit -aleft changes out. Strict bit-for-bit comparisons against Git-generated indexes also failed. Affected versions: 0.10.2 and 0.10.3, plus every earlier release with the sameFlags::new()default.- Reading is unchanged. A
CE_VALIDbit already present on disk is still preserved when the index is read and written back, the same as Git (update-index --refreshdoes not clear it either).
Changed
- The default of
Flags::new().assume_validis nowfalse. Callers that really want the assume-unchanged bit must setentry.flags.assume_valid = trueexplicitly. - Indexes written by earlier versions keep the bit after loading. A downstream that does not support assume-unchanged semantics (such as Libra, see libra-tools/libra#637) should clear it when loading or saving.
Tests
new_entries_do_not_set_assume_validchecksFlags::new()and all threeIndexEntryconstructors.assume_valid_is_written_only_when_explicitly_setreads the raw on-disk flags word. An ordinary entry is written without0x8000. An entry with an explicitassume_valid = truekeeps the bit on disk and after reading back.
Full diff: v0.10.3...v0.10.4