From e02c5b5930c2c9ba3e5423fe12e2ef0155017297 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Thu, 30 May 2024 20:31:36 +0200 Subject: Merging upstream version 1.74.1+dfsg1. Signed-off-by: Daniel Baumann --- vendor/gix-credentials/src/helper/invoke.rs | 7 ++-- vendor/gix-credentials/src/program/mod.rs | 42 +++++++++++----------- .../gix-credentials/src/protocol/context/serde.rs | 9 ++--- 3 files changed, 31 insertions(+), 27 deletions(-) (limited to 'vendor/gix-credentials/src') diff --git a/vendor/gix-credentials/src/helper/invoke.rs b/vendor/gix-credentials/src/helper/invoke.rs index 563f3b2ff..e5662f4ca 100644 --- a/vendor/gix-credentials/src/helper/invoke.rs +++ b/vendor/gix-credentials/src/helper/invoke.rs @@ -4,7 +4,7 @@ use crate::helper::{Action, Context, Error, NextAction, Outcome, Result}; impl Action { /// Send ourselves to the given `write` which is expected to be credentials-helper compatible - pub fn send(&self, mut write: impl std::io::Write) -> std::io::Result<()> { + pub fn send(&self, write: &mut dyn std::io::Write) -> std::io::Result<()> { match self { Action::Get(ctx) => ctx.write_to(write), Action::Store(last) | Action::Erase(last) => { @@ -40,11 +40,12 @@ pub fn invoke(helper: &mut crate::Program, action: &Action) -> Result { } pub(crate) fn raw(helper: &mut crate::Program, action: &Action) -> std::result::Result>, Error> { - let (stdin, stdout) = helper.start(action)?; + let (mut stdin, stdout) = helper.start(action)?; if let (Action::Get(_), None) = (&action, &stdout) { panic!("BUG: `Helper` impls must return an output handle to read output from if Action::Get is provided") } - action.send(stdin)?; + action.send(&mut stdin)?; + drop(stdin); let stdout = stdout .map(|mut stdout| { let mut buf = Vec::new(); diff --git a/vendor/gix-credentials/src/program/mod.rs b/vendor/gix-credentials/src/program/mod.rs index e13e0a5ec..801466018 100644 --- a/vendor/gix-credentials/src/program/mod.rs +++ b/vendor/gix-credentials/src/program/mod.rs @@ -39,29 +39,31 @@ impl Program { /// Parse the given input as per the custom helper definition, supporting `!