From 88a6a4e6d882fc7a3a0b4017d772a3fe38e57598 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Tue, 30 Apr 2024 08:17:12 +0200 Subject: [PATCH 1/2] fix: don't unwrap when reading possibly left-over bytes from pack-stream (#1352) --- gix/src/remote/connection/fetch/error.rs | 2 ++ gix/src/remote/connection/fetch/receive_pack.rs | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/gix/src/remote/connection/fetch/error.rs b/gix/src/remote/connection/fetch/error.rs index 5034dcb5d4e..29326b3a763 100644 --- a/gix/src/remote/connection/fetch/error.rs +++ b/gix/src/remote/connection/fetch/error.rs @@ -45,6 +45,8 @@ pub enum Error { RejectShallowRemote, #[error(transparent)] NegotiationAlgorithmConfig(#[from] config::key::GenericErrorWithValue), + #[error("Failed to read remaining bytes in stream")] + ReadRemainingBytes(#[source] std::io::Error), } impl gix_protocol::transport::IsSpuriousError for Error { diff --git a/gix/src/remote/connection/fetch/receive_pack.rs b/gix/src/remote/connection/fetch/receive_pack.rs index 7634b34cf32..e0231f51a0a 100644 --- a/gix/src/remote/connection/fetch/receive_pack.rs +++ b/gix/src/remote/connection/fetch/receive_pack.rs @@ -287,7 +287,7 @@ where #[cfg(not(feature = "async-network-client"))] let has_read_to_end = { rd.stopped_at().is_some() }; if !has_read_to_end { - std::io::copy(&mut rd, &mut std::io::sink()).unwrap(); + std::io::copy(&mut rd, &mut std::io::sink()).map_err(Error::ReadRemainingBytes)?; } #[cfg(feature = "async-network-client")] { From 52f203a0db47c03cf4c7a5a67618999aac32ff82 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Tue, 7 May 2024 21:01:40 +0200 Subject: [PATCH 2/2] fix windows CI by trying installations of pure Rust version instead Note that this doesn't truly capture the intent of the test anymore, as the idea was to install the best-performing, default version. But this broke due to ASM-hashes now failing on Windows and I reckon that fixing it might be harder than one would think. So here is the quick-fix, to get CI going again. --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 285afbbb5e9..e6827c49d11 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -150,7 +150,7 @@ jobs: - name: "Install prerequisites" run: vcpkg install zlib:x64-windows-static-md - name: "Installation from crates.io: gitoxide" - run: cargo +${{ matrix.rust }} install --target ${{ matrix.target }} --target-dir install-artifacts --debug --force gitoxide + run: cargo +${{ matrix.rust }} install --target ${{ matrix.target }} --no-default-features --features max-pure --target-dir install-artifacts --debug --force gitoxide shell: msys2 {0} lint: