Commit b5f9211
authored
gvfs: clear DIE_IF_CORRUPT in streaming incore fallback (#873)
The upstream refactoring in 4c89d31 (streaming: rely on object
sources to create object stream, 2025-11-23) changed how
istream_source() discovers objects. Previously, it called
odb_read_object_info_extended() with flags=0 to locate the object, then
tried the source-specific opener (e.g. open_istream_loose). If that
failed (e.g. corrupt loose object), it fell back to open_istream_incore
which re-read the object — by which time the read-object hook had
already re-fetched a clean copy.
After the refactoring, istream_source() iterates over sources directly.
When a corrupt loose object is found,
odb_source_loose_read_object_stream fails and the loop continues to the
next source. When no source has the object, it falls through to
open_istream_incore, which calls odb_read_object_info_extended with
OBJECT_INFO_DIE_IF_CORRUPT. This encounters the same corrupt loose file
still on disk and dies before the read-object hook gets a chance to
re-download a clean replacement.
Fix this by clearing OBJECT_INFO_DIE_IF_CORRUPT in open_istream_incore
when GVFS_MISSING_OK is set, matching the existing pattern in
odb_read_object.
This fixes the GitCorruptObjectTests functional test failures
(GitRequestsReplacementForAllNullObject,
GitRequestsReplacementForObjectCorruptedWithBadData,
GitRequestsReplacementForTruncatedObject) that appeared when upgrading
from v2.50.1.vfs.0.1 to v2.53.0.vfs.0.0.
This is a companion to #782 (which predates
4c89d31,
though, therefore it is not _exactly_ an omission of that PR).1 file changed
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
158 | 159 | | |
159 | 160 | | |
160 | 161 | | |
| 162 | + | |
| 163 | + | |
161 | 164 | | |
162 | 165 | | |
163 | 166 | | |
164 | 167 | | |
165 | 168 | | |
166 | | - | |
167 | | - | |
| 169 | + | |
168 | 170 | | |
169 | 171 | | |
170 | 172 | | |
| |||
0 commit comments