diff --git a/gitoxide-core/src/pack/receive.rs b/gitoxide-core/src/pack/receive.rs index ad89f0c2fe2..8270d244601 100644 --- a/gitoxide-core/src/pack/receive.rs +++ b/gitoxide-core/src/pack/receive.rs @@ -1,28 +1,29 @@ -use std::{ - borrow::Cow, - io, - path::PathBuf, - sync::{atomic::AtomicBool, Arc}, -}; - +use crate::net; +use crate::pack::receive::protocol::fetch::negotiate; +use crate::OutputFormat; +use gix::config::tree::Key; +use gix::protocol::maybe_async; +use gix::DynNestedProgress; pub use gix::{ hash::ObjectId, objs::bstr::{BString, ByteSlice}, odb::pack, protocol, protocol::{ - fetch::{Action, Arguments, Response}, + fetch::{Arguments, Response}, handshake::Ref, transport, transport::client::Capabilities, }, - Progress, + NestedProgress, Progress, +}; +use std::{ + io, + path::PathBuf, + sync::{atomic::AtomicBool, Arc}, }; - -use crate::OutputFormat; pub const PROGRESS_RANGE: std::ops::RangeInclusive = 1..=3; - pub struct Context { pub thread_limit: Option, pub format: OutputFormat, @@ -31,262 +32,141 @@ pub struct Context { pub object_hash: gix::hash::Kind, } -struct CloneDelegate { - ctx: Context, +#[maybe_async::maybe_async] +pub async fn receive( + protocol: Option, + url: &str, directory: Option, refs_directory: Option, - ref_filter: Option<&'static [&'static str]>, - wanted_refs: Vec, -} -static FILTER: &[&str] = &["HEAD", "refs/tags", "refs/heads"]; - -fn remote_supports_ref_in_want(server: &Capabilities) -> bool { - server - .capability("fetch") - .and_then(|cap| cap.supports("ref-in-want")) - .unwrap_or(false) -} - -impl protocol::fetch::DelegateBlocking for CloneDelegate { - fn prepare_ls_refs( - &mut self, - server: &Capabilities, - arguments: &mut Vec, - _features: &mut Vec<(&str, Option>)>, - ) -> io::Result { - if server.contains("ls-refs") { - arguments.extend(FILTER.iter().map(|r| format!("ref-prefix {r}").into())); - } - Ok(if self.wanted_refs.is_empty() { - ls_refs::Action::Continue - } else { - ls_refs::Action::Skip - }) - } - - fn prepare_fetch( - &mut self, - version: transport::Protocol, - server: &Capabilities, - _features: &mut Vec<(&str, Option>)>, - _refs: &[Ref], - ) -> io::Result { - if !self.wanted_refs.is_empty() && !remote_supports_ref_in_want(server) { - return Err(io::Error::new( - io::ErrorKind::Other, - "Want to get specific refs, but remote doesn't support this capability", - )); - } - if version == transport::Protocol::V1 { - self.ref_filter = Some(FILTER); - } - Ok(Action::Continue) - } + mut wanted_refs: Vec, + mut progress: P, + ctx: Context, +) -> anyhow::Result<()> +where + W: std::io::Write, + P: NestedProgress + 'static, + P::SubProgress: 'static, +{ + let mut transport = net::connect( + url, + gix::protocol::transport::client::connect::Options { + version: protocol.unwrap_or_default().into(), + ..Default::default() + }, + ) + .await?; + let trace_packetlines = std::env::var_os( + gix::config::tree::Gitoxide::TRACE_PACKET + .environment_override() + .expect("set"), + ) + .is_some(); - fn negotiate( - &mut self, - refs: &[Ref], - arguments: &mut Arguments, - _previous_response: Option<&Response>, - ) -> io::Result { - if self.wanted_refs.is_empty() { - for r in refs { - let (path, id, _) = r.unpack(); - if let Some(id) = id { - match self.ref_filter { - Some(ref_prefixes) => { - if ref_prefixes.iter().any(|prefix| path.starts_with_str(prefix)) { - arguments.want(id); - } - } - None => arguments.want(id), - } - } - } - } else { - for r in &self.wanted_refs { - arguments.want_ref(r.as_ref()); - } - } - Ok(Action::Cancel) + let agent = gix::protocol::agent(gix::env::agent()); + let mut handshake = gix::protocol::fetch::handshake( + &mut transport, + gix::protocol::credentials::builtin, + vec![("agent".into(), Some(agent.clone()))], + &mut progress, + ) + .await?; + if wanted_refs.is_empty() { + wanted_refs.push("refs/heads/*:refs/remotes/origin/*".into()); } -} - -#[cfg(feature = "blocking-client")] -mod blocking_io { - use std::{io, io::BufRead, path::PathBuf}; - - use gix::{ - bstr::BString, - config::tree::Key, - protocol, - protocol::{fetch::Response, handshake::Ref}, - NestedProgress, - }; - - use super::{receive_pack_blocking, CloneDelegate, Context}; - use crate::net; - - impl protocol::fetch::Delegate for CloneDelegate { - fn receive_pack( - &mut self, - input: impl BufRead, - progress: impl NestedProgress + 'static, - refs: &[Ref], - _previous_response: &Response, - ) -> io::Result<()> { + let fetch_refspecs: Vec<_> = wanted_refs + .into_iter() + .map(|ref_name| { + gix::refspec::parse(ref_name.as_bstr(), gix::refspec::parse::Operation::Fetch).map(|r| r.to_owned()) + }) + .collect::>()?; + let user_agent = ("agent", Some(agent.clone().into())); + let refmap = gix::protocol::fetch::RefMap::new( + &mut progress, + &fetch_refspecs, + gix::protocol::fetch::Context { + handshake: &mut handshake, + transport: &mut transport, + user_agent: user_agent.clone(), + trace_packetlines, + }, + gix::protocol::fetch::refmap::init::Options::default(), + ) + .await?; + let mut negotiate = Negotiate { refmap: &refmap }; + gix::protocol::fetch( + &refmap, + &mut negotiate, + |read_pack, progress, should_interrupt| { receive_pack_blocking( - self.directory.take(), - self.refs_directory.take(), - &mut self.ctx, - input, + directory, + refs_directory, + read_pack, progress, - refs, + &refmap.remote_refs, + should_interrupt, + ctx.out, + ctx.thread_limit, + ctx.object_hash, + ctx.format, ) - } - } - - pub fn receive( - protocol: Option, - url: &str, - directory: Option, - refs_directory: Option, - wanted_refs: Vec, - progress: P, - ctx: Context, - ) -> anyhow::Result<()> - where - W: std::io::Write, - P: NestedProgress + 'static, - P::SubProgress: 'static, - { - let transport = net::connect( - url, - gix::protocol::transport::client::connect::Options { - version: protocol.unwrap_or_default().into(), - ..Default::default() - }, - )?; - let delegate = CloneDelegate { - ctx, - directory, - refs_directory, - ref_filter: None, - wanted_refs, - }; - protocol::fetch( - transport, - delegate, - protocol::credentials::builtin, - progress, - protocol::FetchConnection::TerminateOnSuccessfulCompletion, - gix::env::agent(), - std::env::var_os( - gix::config::tree::Gitoxide::TRACE_PACKET - .environment_override() - .expect("set"), - ) - .is_some(), - )?; - Ok(()) - } + .map(|_| true) + }, + progress, + &ctx.should_interrupt, + gix::protocol::fetch::Context { + handshake: &mut handshake, + transport: &mut transport, + user_agent, + trace_packetlines, + }, + gix::protocol::fetch::Options { + shallow_file: "no shallow file required as we reject it to keep it simple".into(), + shallow: &Default::default(), + tags: Default::default(), + expected_object_hash: Default::default(), + reject_shallow_remote: true, + }, + ) + .await?; + Ok(()) } -#[cfg(feature = "blocking-client")] -pub use blocking_io::receive; -use gix::{protocol::ls_refs, NestedProgress}; - -#[cfg(feature = "async-client")] -mod async_io { - use std::{io, io::BufRead, path::PathBuf}; - - use async_trait::async_trait; - use futures_io::AsyncBufRead; - use gix::{ - bstr::{BString, ByteSlice}, - config::tree::Key, - odb::pack, - protocol, - protocol::{fetch::Response, handshake::Ref}, - Progress, - }; +struct Negotiate<'a> { + refmap: &'a gix::protocol::fetch::RefMap, +} - use super::{print, receive_pack_blocking, write_raw_refs, CloneDelegate, Context}; - use crate::{net, OutputFormat}; +impl gix::protocol::fetch::Negotiate for Negotiate<'_> { + fn mark_complete_and_common_ref(&mut self) -> Result { + Ok(negotiate::Action::MustNegotiate { + remote_ref_target_known: vec![], /* we don't really negotiate */ + }) + } - #[async_trait(?Send)] - impl protocol::fetch::Delegate for CloneDelegate { - async fn receive_pack( - &mut self, - input: impl AsyncBufRead + Unpin + 'async_trait, - progress: impl gix::NestedProgress + 'static, - refs: &[Ref], - _previous_response: &Response, - ) -> io::Result<()> { - receive_pack_blocking( - self.directory.take(), - self.refs_directory.take(), - &mut self.ctx, - futures_lite::io::BlockOn::new(input), - progress, - refs, - ) + fn add_wants(&mut self, arguments: &mut Arguments, _remote_ref_target_known: &[bool]) { + for id in self.refmap.mappings.iter().filter_map(|m| m.remote.as_id()) { + arguments.want(id); } } - pub async fn receive( - protocol: Option, - url: &str, - directory: Option, - refs_directory: Option, - wanted_refs: Vec, - progress: P, - ctx: Context, - ) -> anyhow::Result<()> - where - P: gix::NestedProgress + 'static, - W: io::Write + Send + 'static, - { - let transport = net::connect( - url, - #[allow(clippy::needless_update)] - gix::protocol::transport::client::connect::Options { - version: protocol.unwrap_or_default().into(), - ..Default::default() + fn one_round( + &mut self, + _state: &mut negotiate::one_round::State, + _arguments: &mut Arguments, + _previous_response: Option<&Response>, + ) -> Result<(negotiate::Round, bool), negotiate::Error> { + Ok(( + negotiate::Round { + haves_sent: 0, + in_vain: 0, + haves_to_send: 0, + previous_response_had_at_least_one_in_common: false, }, - ) - .await?; - let mut delegate = CloneDelegate { - ctx, - directory, - refs_directory, - ref_filter: None, - wanted_refs, - }; - blocking::unblock(move || { - futures_lite::future::block_on(protocol::fetch( - transport, - delegate, - protocol::credentials::builtin, - progress, - protocol::FetchConnection::TerminateOnSuccessfulCompletion, - gix::env::agent(), - std::env::var_os( - gix::config::tree::Gitoxide::TRACE_PACKET - .environment_override() - .expect("set"), - ) - .is_some(), - )) - }) - .await?; - Ok(()) + // is done + true, + )) } } -#[cfg(feature = "async-client")] -pub use self::async_io::receive; - #[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))] pub struct JsonBundleWriteOutcome { pub index_version: pack::index::Version, @@ -376,25 +256,30 @@ fn write_raw_refs(refs: &[Ref], directory: PathBuf) -> std::io::Result<()> { Ok(()) } -fn receive_pack_blocking( +#[allow(clippy::too_many_arguments)] +fn receive_pack_blocking( mut directory: Option, mut refs_directory: Option, - ctx: &mut Context, mut input: impl io::BufRead, - mut progress: impl NestedProgress + 'static, + progress: &mut dyn DynNestedProgress, refs: &[Ref], + should_interrupt: &AtomicBool, + mut out: impl std::io::Write, + thread_limit: Option, + object_hash: gix::hash::Kind, + format: OutputFormat, ) -> io::Result<()> { let options = pack::bundle::write::Options { - thread_limit: ctx.thread_limit, + thread_limit, index_version: pack::index::Version::V2, iteration_mode: pack::data::input::Mode::Verify, - object_hash: ctx.object_hash, + object_hash, }; let outcome = pack::Bundle::write_to_directory( &mut input, directory.take().as_deref(), - &mut progress, - &ctx.should_interrupt, + progress, + should_interrupt, None::, options, ) @@ -404,11 +289,11 @@ fn receive_pack_blocking( write_raw_refs(refs, directory)?; } - match ctx.format { - OutputFormat::Human => drop(print(&mut ctx.out, outcome, refs)), + match format { + OutputFormat::Human => drop(print(&mut out, outcome, refs)), #[cfg(feature = "serde")] OutputFormat::Json => { - serde_json::to_writer_pretty(&mut ctx.out, &JsonOutcome::from_outcome_and_refs(outcome, refs))?; + serde_json::to_writer_pretty(&mut out, &JsonOutcome::from_outcome_and_refs(outcome, refs))?; } }; Ok(()) diff --git a/gitoxide-core/src/repository/clone.rs b/gitoxide-core/src/repository/clone.rs index cf810deb389..88daf903e3e 100644 --- a/gitoxide-core/src/repository/clone.rs +++ b/gitoxide-core/src/repository/clone.rs @@ -89,7 +89,7 @@ pub(crate) mod function { if handshake_info { writeln!(out, "Handshake Information")?; - writeln!(out, "\t{:?}", fetch_outcome.ref_map.handshake)?; + writeln!(out, "\t{:?}", fetch_outcome.handshake)?; } match fetch_outcome.status { diff --git a/gitoxide-core/src/repository/fetch.rs b/gitoxide-core/src/repository/fetch.rs index 56fba6c31f3..bf1cbcce21d 100644 --- a/gitoxide-core/src/repository/fetch.rs +++ b/gitoxide-core/src/repository/fetch.rs @@ -70,7 +70,7 @@ pub(crate) mod function { if handshake_info { writeln!(out, "Handshake Information")?; - writeln!(out, "\t{:?}", res.ref_map.handshake)?; + writeln!(out, "\t{:?}", res.handshake)?; } let ref_specs = remote.refspecs(gix::remote::Direction::Fetch); diff --git a/gitoxide-core/src/repository/remote.rs b/gitoxide-core/src/repository/remote.rs index 341e0fb2f81..5a1cb061a34 100644 --- a/gitoxide-core/src/repository/remote.rs +++ b/gitoxide-core/src/repository/remote.rs @@ -72,7 +72,7 @@ mod refs_impl { .context("Remote didn't have a URL to connect to")? .to_bstring() )); - let map = remote + let (map, handshake) = remote .connect(gix::remote::Direction::Fetch) .await? .ref_map( @@ -86,7 +86,7 @@ mod refs_impl { if handshake_info { writeln!(out, "Handshake Information")?; - writeln!(out, "\t{:?}", map.handshake)?; + writeln!(out, "\t{handshake:?}")?; } match kind { refs::Kind::Tracking { .. } => print_refmap( diff --git a/gix/Cargo.toml b/gix/Cargo.toml index 604fa462f26..80aaffb1538 100644 --- a/gix/Cargo.toml +++ b/gix/Cargo.toml @@ -160,6 +160,7 @@ worktree-archive = ["gix-archive", "worktree-stream", "attributes"] async-network-client = [ "gix-protocol/async-client", "gix-pack/streaming-input", + "dep:gix-transport", "attributes", "credentials", ] diff --git a/gix/src/remote/connection/ref_map.rs b/gix/src/remote/connection/ref_map.rs index 72b295bfd5f..36d5fb27d8e 100644 --- a/gix/src/remote/connection/ref_map.rs +++ b/gix/src/remote/connection/ref_map.rs @@ -85,8 +85,14 @@ where /// - `gitoxide.userAgent` is read to obtain the application user agent for git servers and for HTTP servers as well. #[allow(clippy::result_large_err)] #[gix_protocol::maybe_async::maybe_async] - pub async fn ref_map(mut self, progress: impl Progress, options: Options) -> Result { - self.ref_map_by_ref(progress, options).await + pub async fn ref_map( + mut self, + progress: impl Progress, + options: Options, + ) -> Result<(fetch::RefMap, gix_protocol::handshake::Outcome), Error> { + let refmap = self.ref_map_by_ref(progress, options).await; + let handshake = self.handshake.expect("refmap always performs handshake"); + refmap.map(|map| (map, handshake)) } #[allow(clippy::result_large_err)] diff --git a/gix/tests/gix/remote/ref_map.rs b/gix/tests/gix/remote/ref_map.rs index 77a9eefd846..5dbdad08cf2 100644 --- a/gix/tests/gix/remote/ref_map.rs +++ b/gix/tests/gix/remote/ref_map.rs @@ -65,7 +65,7 @@ mod blocking_and_async_io { daemon.as_ref(), None, ); - let map = remote + let (map, _handshake) = remote .connect(Fetch) .await? .ref_map(progress::Discard, Default::default()) diff --git a/justfile b/justfile index f5a49d82641..c1b27f7658c 100755 --- a/justfile +++ b/justfile @@ -47,7 +47,6 @@ check: if cargo check -p gix-transport --all-features 2>/dev/null; then false; else true; fi if cargo check -p gix-protocol --all-features 2>/dev/null; then false; else true; fi cargo tree -p gix --no-default-features -e normal -i imara-diff 2>&1 | grep warning # warning happens if nothing found, no exit code :/ - if cargo tree -p gix --no-default-features -i gix-protocol 2>/dev/null; then false; else true; fi cargo tree -p gix --no-default-features -e normal -i gix-submodule 2>&1 | grep warning cargo tree -p gix --no-default-features -e normal -i gix-pathspec 2>&1 | grep warning cargo tree -p gix --no-default-features -e normal -i gix-filter 2>&1 | grep warning diff --git a/tests/journey/gix.sh b/tests/journey/gix.sh index 4251e0ec26f..dd180cff8c7 100644 --- a/tests/journey/gix.sh +++ b/tests/journey/gix.sh @@ -107,6 +107,8 @@ title "gix (with repository)" ) fi + # for some reason, on CI the daemon always shuts down before we can connect, + # or isn't actually ready despite having accepted the first connection already. (with "git:// protocol" launch-git-daemon (with "version 1" @@ -249,14 +251,14 @@ title "gix commit-graph" (with "version 2" (with "NO output directory" it "generates the correct output" && { - WITH_SNAPSHOT="$snapshot/file-v-any-no-output" \ + WITH_SNAPSHOT="$snapshot/file-v-any-no-output-p2" \ expect_run $SUCCESSFULLY "$exe_plumbing" --no-verbose free pack receive -p 2 .git } ) (with "output directory" mkdir out/ it "generates the correct output" && { - WITH_SNAPSHOT="$snapshot/file-v-any-with-output" \ + WITH_SNAPSHOT="$snapshot/file-v-any-with-output-p2" \ expect_run $SUCCESSFULLY "$exe_plumbing" --no-verbose free pack receive .git out/ } it "creates an index and a pack in the output directory" && { @@ -268,7 +270,7 @@ title "gix commit-graph" if test "$kind" = "max" || test "$kind" = "max-pure"; then (with "--format json" it "generates the correct output in JSON format" && { - WITH_SNAPSHOT="$snapshot/file-v-any-no-output-json" \ + WITH_SNAPSHOT="$snapshot/file-v-any-no-output-json-p2" \ expect_run $SUCCESSFULLY "$exe_plumbing" --no-verbose --format json free pack receive --protocol 2 .git } ) @@ -305,7 +307,7 @@ title "gix commit-graph" (with "NO output directory" (with "NO wanted refs" it "generates the correct output" && { - WITH_SNAPSHOT="$snapshot/file-v-any-no-output" \ + WITH_SNAPSHOT="$snapshot/file-v-any-no-output-p2" \ expect_run $SUCCESSFULLY "$exe_plumbing" --no-verbose free pack receive -p 2 git://localhost/ } ) @@ -324,7 +326,7 @@ title "gix commit-graph" ) (with "output directory" it "generates the correct output" && { - WITH_SNAPSHOT="$snapshot/file-v-any-with-output" \ + WITH_SNAPSHOT="$snapshot/file-v-any-with-output-p2" \ expect_run $SUCCESSFULLY "$exe_plumbing" --no-verbose free pack receive git://localhost/ out/ } ) diff --git a/tests/snapshots/plumbing/no-repo/pack/receive/file-v-any-no-output b/tests/snapshots/plumbing/no-repo/pack/receive/file-v-any-no-output index b908a0b0987..6ca12def6af 100644 --- a/tests/snapshots/plumbing/no-repo/pack/receive/file-v-any-no-output +++ b/tests/snapshots/plumbing/no-repo/pack/receive/file-v-any-no-output @@ -1,5 +1,5 @@ -index: c787de2aafb897417ca8167baeb146eabd18bc5f -pack: 346574b7331dc3a1724da218d622c6e1b6c66a57 +index: 8e48437a86dfb3939de997bb66b4bbedde9c2259 +pack: 24d2f055141373bf1011f1b0fce5dd8929a3a869 3f72b39ad1600e6dac63430c15e0d875e9d3f9d6 HEAD symref-target:refs/heads/main ee3c97678e89db4eab7420b04aef51758359f152 refs/heads/dev diff --git a/tests/snapshots/plumbing/no-repo/pack/receive/file-v-any-no-output-json b/tests/snapshots/plumbing/no-repo/pack/receive/file-v-any-no-output-json index ab2bb31f86b..e23d6acfa63 100644 --- a/tests/snapshots/plumbing/no-repo/pack/receive/file-v-any-no-output-json +++ b/tests/snapshots/plumbing/no-repo/pack/receive/file-v-any-no-output-json @@ -1,8 +1,8 @@ { "index": { "index_version": "V2", - "index_hash": "c787de2aafb897417ca8167baeb146eabd18bc5f", - "data_hash": "346574b7331dc3a1724da218d622c6e1b6c66a57", + "index_hash": "8e48437a86dfb3939de997bb66b4bbedde9c2259", + "data_hash": "24d2f055141373bf1011f1b0fce5dd8929a3a869", "num_objects": 9 }, "pack_kind": "V2", diff --git a/tests/snapshots/plumbing/no-repo/pack/receive/file-v-any-no-output-json-p2 b/tests/snapshots/plumbing/no-repo/pack/receive/file-v-any-no-output-json-p2 new file mode 100644 index 00000000000..64244a25ebf --- /dev/null +++ b/tests/snapshots/plumbing/no-repo/pack/receive/file-v-any-no-output-json-p2 @@ -0,0 +1,25 @@ +{ + "index": { + "index_version": "V2", + "index_hash": "8e48437a86dfb3939de997bb66b4bbedde9c2259", + "data_hash": "24d2f055141373bf1011f1b0fce5dd8929a3a869", + "num_objects": 9 + }, + "pack_kind": "V2", + "index_path": null, + "data_path": null, + "refs": [ + { + "Direct": { + "path": "refs/heads/dev", + "object": "ee3c97678e89db4eab7420b04aef51758359f152" + } + }, + { + "Direct": { + "path": "refs/heads/main", + "object": "3f72b39ad1600e6dac63430c15e0d875e9d3f9d6" + } + } + ] +} \ No newline at end of file diff --git a/tests/snapshots/plumbing/no-repo/pack/receive/file-v-any-no-output-non-existing-single-ref b/tests/snapshots/plumbing/no-repo/pack/receive/file-v-any-no-output-non-existing-single-ref index 62d4a6f5c56..d3d745bbd13 100644 --- a/tests/snapshots/plumbing/no-repo/pack/receive/file-v-any-no-output-non-existing-single-ref +++ b/tests/snapshots/plumbing/no-repo/pack/receive/file-v-any-no-output-non-existing-single-ref @@ -1 +1 @@ -Error: unknown ref refs/heads/does-not-exist \ No newline at end of file +Error: None of the refspec(s) refs/heads/does-not-exist matched any of the 2 refs on the remote \ No newline at end of file diff --git a/tests/snapshots/plumbing/no-repo/pack/receive/file-v-any-no-output-p2 b/tests/snapshots/plumbing/no-repo/pack/receive/file-v-any-no-output-p2 new file mode 100644 index 00000000000..c9e1ef4f9e4 --- /dev/null +++ b/tests/snapshots/plumbing/no-repo/pack/receive/file-v-any-no-output-p2 @@ -0,0 +1,5 @@ +index: 8e48437a86dfb3939de997bb66b4bbedde9c2259 +pack: 24d2f055141373bf1011f1b0fce5dd8929a3a869 + +ee3c97678e89db4eab7420b04aef51758359f152 refs/heads/dev +3f72b39ad1600e6dac63430c15e0d875e9d3f9d6 refs/heads/main \ No newline at end of file diff --git a/tests/snapshots/plumbing/no-repo/pack/receive/file-v-any-no-output-single-ref b/tests/snapshots/plumbing/no-repo/pack/receive/file-v-any-no-output-single-ref index f712606d55f..3ef28803768 100644 --- a/tests/snapshots/plumbing/no-repo/pack/receive/file-v-any-no-output-single-ref +++ b/tests/snapshots/plumbing/no-repo/pack/receive/file-v-any-no-output-single-ref @@ -1,2 +1,5 @@ -index: 3ff97f80d63a1261147ace4cb06191a2fd686ff6 -pack: de6c8d1e0ca3ee9331a3f92da74add15abd03049 \ No newline at end of file +index: c787de2aafb897417ca8167baeb146eabd18bc5f +pack: 346574b7331dc3a1724da218d622c6e1b6c66a57 + +ee3c97678e89db4eab7420b04aef51758359f152 refs/heads/dev +3f72b39ad1600e6dac63430c15e0d875e9d3f9d6 refs/heads/main \ No newline at end of file diff --git a/tests/snapshots/plumbing/no-repo/pack/receive/file-v-any-no-output-wanted-ref-p1 b/tests/snapshots/plumbing/no-repo/pack/receive/file-v-any-no-output-wanted-ref-p1 index c5203d08e6e..88a2166e807 100644 --- a/tests/snapshots/plumbing/no-repo/pack/receive/file-v-any-no-output-wanted-ref-p1 +++ b/tests/snapshots/plumbing/no-repo/pack/receive/file-v-any-no-output-wanted-ref-p1 @@ -1,4 +1 @@ -Error: Could not access repository or failed to read streaming pack file - -Caused by: - Want to get specific refs, but remote doesn't support this capability \ No newline at end of file +Error: None of the refspec(s) =refs/heads/main matched any of the 5 refs on the remote \ No newline at end of file diff --git a/tests/snapshots/plumbing/no-repo/pack/receive/file-v-any-with-output b/tests/snapshots/plumbing/no-repo/pack/receive/file-v-any-with-output index 821e8b0d90b..0002fa4dbc5 100644 --- a/tests/snapshots/plumbing/no-repo/pack/receive/file-v-any-with-output +++ b/tests/snapshots/plumbing/no-repo/pack/receive/file-v-any-with-output @@ -1,5 +1,5 @@ -index: c787de2aafb897417ca8167baeb146eabd18bc5f (out/pack-346574b7331dc3a1724da218d622c6e1b6c66a57.idx) -pack: 346574b7331dc3a1724da218d622c6e1b6c66a57 (out/pack-346574b7331dc3a1724da218d622c6e1b6c66a57.pack) +index: 8e48437a86dfb3939de997bb66b4bbedde9c2259 (out/pack-24d2f055141373bf1011f1b0fce5dd8929a3a869.idx) +pack: 24d2f055141373bf1011f1b0fce5dd8929a3a869 (out/pack-24d2f055141373bf1011f1b0fce5dd8929a3a869.pack) 3f72b39ad1600e6dac63430c15e0d875e9d3f9d6 HEAD symref-target:refs/heads/main ee3c97678e89db4eab7420b04aef51758359f152 refs/heads/dev diff --git a/tests/snapshots/plumbing/no-repo/pack/receive/file-v-any-with-output-p2 b/tests/snapshots/plumbing/no-repo/pack/receive/file-v-any-with-output-p2 new file mode 100644 index 00000000000..7c3547de8a0 --- /dev/null +++ b/tests/snapshots/plumbing/no-repo/pack/receive/file-v-any-with-output-p2 @@ -0,0 +1,5 @@ +index: 8e48437a86dfb3939de997bb66b4bbedde9c2259 (out/pack-24d2f055141373bf1011f1b0fce5dd8929a3a869.idx) +pack: 24d2f055141373bf1011f1b0fce5dd8929a3a869 (out/pack-24d2f055141373bf1011f1b0fce5dd8929a3a869.pack) + +ee3c97678e89db4eab7420b04aef51758359f152 refs/heads/dev +3f72b39ad1600e6dac63430c15e0d875e9d3f9d6 refs/heads/main \ No newline at end of file diff --git a/tests/snapshots/plumbing/no-repo/pack/receive/ls-in-output-dir b/tests/snapshots/plumbing/no-repo/pack/receive/ls-in-output-dir index 71db4814846..ce0f84643da 100644 --- a/tests/snapshots/plumbing/no-repo/pack/receive/ls-in-output-dir +++ b/tests/snapshots/plumbing/no-repo/pack/receive/ls-in-output-dir @@ -1,3 +1,3 @@ -pack-346574b7331dc3a1724da218d622c6e1b6c66a57.idx -pack-346574b7331dc3a1724da218d622c6e1b6c66a57.keep -pack-346574b7331dc3a1724da218d622c6e1b6c66a57.pack \ No newline at end of file +pack-24d2f055141373bf1011f1b0fce5dd8929a3a869.idx +pack-24d2f055141373bf1011f1b0fce5dd8929a3a869.keep +pack-24d2f055141373bf1011f1b0fce5dd8929a3a869.pack \ No newline at end of file