Skip to content

Commit 877951a

Browse files
committed
Be sure to clear the buffer after an intermediate read error happened and we ignore it.
That way there won't be partial results.
1 parent 32cfeac commit 877951a

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

gix-config/src/file/init/from_paths.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ impl File<'static> {
110110
path: path.clone()
111111
}
112112
);
113+
buf.clear();
113114
} else {
114115
return Err(Error::Io { source: err, path });
115116
}

gix/src/config/cache/incubate.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ fn load_config(
118118
};
119119
if lenient {
120120
log::warn!("ignoring: {err:#?}");
121+
buf.clear();
121122
} else {
122123
return Err(err);
123124
}

0 commit comments

Comments
 (0)