Skip to content

fetch pack #539

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 115 commits into from
Sep 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
8b6ecb2
print information about filtered ref-specs as well.
Byron Sep 21, 2022
6df179b
feat: `RefSpecRef::prefix()` to return the two-component prefix of a …
Byron Sep 21, 2022
45394d5
improve docs a little (#450)
Byron Sep 21, 2022
3a38d1b
change: turn `prepare_ls_refs` in `fetch::refs()` into `FnOnce`. (#450)
Byron Sep 21, 2022
278ff7a
fix: `RefSpecRef` instruction uses the correct lifetime. (#450)
Byron Sep 21, 2022
25f0640
feat: `Remote::rem_map()` now specifies ref-prefixes to the remote. (…
Byron Sep 21, 2022
38373bc
Allow to turn remote-filtering off. (#450)
Byron Sep 21, 2022
02245a6
update fetch feature list with `wait-for-done` (#450)
Byron Sep 22, 2022
c3e4b2a
refactor (#450)
Byron Sep 22, 2022
5475cc2
pass extra handshake parameters via options in `ref-map` (#450)
Byron Sep 22, 2022
0dc7206
first sktech of fetch module (#450)
Byron Sep 22, 2022
5bef0a0
FAIL: try to make the transport configurable after being boxed, but… …
Byron Sep 22, 2022
fbb96e4
Revert "FAIL: try to make the transport configurable after being boxe…
Byron Sep 22, 2022
1cf66c4
change!: `client::http::connect()` returns `Transport<Impl>` directly…
Byron Sep 22, 2022
211e65d
Make it easier to connect to http if well-known to allow additional c…
Byron Sep 22, 2022
47d5cd6
don't fail if we can't indicate the end of interaction to the server …
Byron Sep 22, 2022
744ed03
feat: add `client::fetch_pack()` allowing to fetch a pack after a han…
Byron Sep 22, 2022
f87b7eb
remove: `client::fetch_pack()` isn't worth it after all. (#450)
Byron Sep 22, 2022
f0f4db6
sketch of 'Prepare' struct to configure fetch after ref-map was obtai…
Byron Sep 22, 2022
78ad3df
feat!: add `fetch::Transport::configure` to generically configure any…
Byron Sep 22, 2022
e842843
adapt to changes in `git-transport` (#450)
Byron Sep 22, 2022
d1cb6cc
fix build (#450)
Byron Sep 22, 2022
9b86a1f
remove connect_http() method to encourage changing settings using `tr…
Byron Sep 22, 2022
779eefe
Use `&dyn Any` instead of unspecified serialization format, as it's t…
Byron Sep 22, 2022
7993f6a
fix build (#450)
Byron Sep 22, 2022
f8fb04a
refactor (#450)
Byron Sep 23, 2022
d686020
Merge branch 'main' into fetch-pack
Byron Sep 23, 2022
4b1e3b3
feat: add `Repository::find_default_remote()` which works on detached…
Byron Sep 23, 2022
249c54e
allow stopping fetches after preparing it (#450)
Byron Sep 23, 2022
5c24425
be a bit clearer on how configuration should be done. (#450)
Byron Sep 23, 2022
67801a3
sketch the receive() method to finally receive a pack. (#450)
Byron Sep 23, 2022
d2bea00
feat: add `config::SnapshotMut::forget()` to forget all changes befor…
Byron Sep 23, 2022
4367994
feat: add `config::SnapshotMut::commit()` to make clear it's transact…
Byron Sep 23, 2022
591afd5
rename!: `bundle::write::Options::index_kind` -> `::index_version`. (…
Byron Sep 23, 2022
d5254c2
adapt to changes in `git-pack` (#450)
Byron Sep 23, 2022
5a3155a
obtain configuration for index version (with respect for lenient conf…
Byron Sep 23, 2022
8d17dc6
also extract index threads (#450)
Byron Sep 23, 2022
92e082a
A very first version of `gix progress show` (#450)
Byron Sep 23, 2022
317e02a
add support for more types of configurations (#450)
Byron Sep 23, 2022
b42b08a
refactor (#450)
Byron Sep 23, 2022
65e6496
Add tabled for nicer printing (#450)
Byron Sep 23, 2022
5c0d0ab
add more records (#450)
Byron Sep 23, 2022
6abd5a4
complete listing of records based on current usage, probably (#450)
Byron Sep 23, 2022
eade88f
slightly nicer styling of config keys (#450)
Byron Sep 23, 2022
8dadd70
thanks clippy
Byron Sep 23, 2022
97a5e97
complete pack generation options based on configuration (#450)
Byron Sep 24, 2022
5e93ef5
refactor (#450)
Byron Sep 24, 2022
31a7089
feat: make some private methods public to give callers more flexibili…
Byron Sep 24, 2022
3c188b2
Add remotes.<group> as planned feature for remotes (#450)
Byron Sep 24, 2022
4997e56
port part of the negotation logic over, but a lot is still missing (#…
Byron Sep 24, 2022
4850202
Improve docs slightly (#450)
Byron Sep 25, 2022
0b6ed60
fix: `bundle::write::Error` is now publicly available (#450)
Byron Sep 25, 2022
0bcb2fd
feat: `fetch::Arguments::is_empty()` to help decide if arguments shou…
Byron Sep 25, 2022
aad17ba
A first test for validating nothing-new is a no-op (#450)
Byron Sep 25, 2022
72ce7fd
add test to show that empty packs won't be written as expected behavi…
Byron Sep 25, 2022
4d90815
allow git-repository to grow (#450)
Byron Sep 25, 2022
e05c1fe
feat: Allow defaulting `client::Capabilities`. (#450)
Byron Sep 25, 2022
aed93d2
feat: Allow defaulting `fetch::handshake::Outcome`. (#450)
Byron Sep 25, 2022
5f73b25
Don't degenerate information in case there is no update needed. (#450)
Byron Sep 25, 2022
b46347f
rename!: `index::write::Outcome::index_kind` -> `::index_version`. (#…
Byron Sep 26, 2022
474156f
adapt to changes in `git-pack` (#450)
Byron Sep 26, 2022
2962dc2
A first sketch of validating a fetch. (#450)
Byron Sep 26, 2022
8499c3e
thanks clippy
Byron Sep 26, 2022
f8fe6e4
fix journey tests (#450)
Byron Sep 26, 2022
ce1a373
speed up fetch tests by giving them their own repo-fixture (#450)
Byron Sep 26, 2022
d5c1f92
try to make naive negotiation better, but… (#450)
Byron Sep 26, 2022
0387794
improve naieve algorithm to be a bit better in our test-case (#450)
Byron Sep 26, 2022
2ec8175
greatly improved performance for write-test. (#450)
Byron Sep 26, 2022
96f2fd8
refactor (#450)
Byron Sep 26, 2022
1f2d609
lay the ground-works for testing the update of refs (#450)
Byron Sep 26, 2022
4a5d3b4
make `remote::fetch::refs::update()` public to facilitate testing (#450)
Byron Sep 26, 2022
8e1555d
fix build (#450)
Byron Sep 26, 2022
c355823
the first somewhat synthetic test to check for no changes. (#450)
Byron Sep 26, 2022
2828674
more update tests (#450)
Byron Sep 26, 2022
658c125
feat: `FullName::try_from(&BString)` for convenience. (#450)
Byron Sep 26, 2022
c101d50
a big step towards ref updates, now it needs specs (#450)
Byron Sep 26, 2022
d7f63a6
feat: `RefSpec::allow_non_fast_forward()` to get information about 'f…
Byron Sep 26, 2022
a9f2c45
Provide refspecs to refs::update() to obtain force information (#450)
Byron Sep 26, 2022
9f9b610
Make `fetch::refs::update()` private again, move tests accordingly. (…
Byron Sep 26, 2022
e4edc18
the first successful test (#450)
Byron Sep 26, 2022
7ced240
tests for all the cases excluding fast-forwards (#450)
Byron Sep 26, 2022
e25460b
Add failing test to show we need to respect dry-run mode (or the lack…
Byron Sep 27, 2022
7076891
add information about planned lock timeout support (from configuratio…
Byron Sep 27, 2022
8fe4bf4
actually apply ref updates (#450)
Byron Sep 27, 2022
1bb910e
prepare for worktree-aware checked-out branch handling… (#450)
Byron Sep 27, 2022
3a0fb1b
change!: remote `lock_mode` from all methods dealing with reference e…
Byron Sep 27, 2022
e88de0f
change!: All methods editing references don't take the author as para…
Byron Sep 27, 2022
da147bf
auto-update previously cached values after changing the configuration…
Byron Sep 27, 2022
830c450
read core.excludesFile lazily (and don't cache it yet) (#450)
Byron Sep 27, 2022
f47a31d
refactor (#450)
Byron Sep 27, 2022
e699291
change!: `file::Transaction::prepare()` now takes two `git_lock::acqu…
Byron Sep 27, 2022
d40beb3
adapt to changes in `git-ref` (#450)
Byron Sep 27, 2022
fd18320
update progress information to include packedRefsTimeout (#450)
Byron Sep 27, 2022
cc75647
Add test for commit-and-rollback method, and fix it (#450)
Byron Sep 27, 2022
b514966
more robust assignment of re-evaluated cached values (#450)
Byron Sep 27, 2022
dde9e63
more tests for SnapshotMut and now it's working properly (#450)
Byron Sep 27, 2022
005469c
isolate test properly (#450)
Byron Sep 27, 2022
6981b71
more robust tests that depend on time. (#450)
Byron Sep 27, 2022
09da4c5
feat: add `Env::unset()` for convenience (#450)
Byron Sep 27, 2022
25d6106
unset other variables that we know may affect some functions that nee…
Byron Sep 27, 2022
9704c2f
further harden tests to only allow environment variables for those wh…
Byron Sep 27, 2022
2a67531
fix docs (#450)
Byron Sep 27, 2022
870b680
add failing test to validate worktree-checkout check (#450)
Byron Sep 28, 2022
5a6c102
reject updating checked-out branches (#450)
Byron Sep 28, 2022
93917cb
Merge branch 'main' into fetch-pack
Byron Sep 28, 2022
18581d0
refactor (#450)
Byron Sep 29, 2022
ba41b6c
no-clobber special case for tags (#450)
Byron Sep 29, 2022
d79a7a6
assure objects exist before setting them. (#450)
Byron Sep 29, 2022
b521748
thanks clippy
Byron Sep 29, 2022
91859d5
facilities to test reflog messages (#450)
Byron Sep 29, 2022
9a072bd
refactor (#450)
Byron Sep 29, 2022
6ebbbc1
support reflog message prefix (#450)
Byron Sep 30, 2022
2a76908
test all reflog messages that are expected, sans fast-forward (#450)
Byron Sep 30, 2022
370ed3d
feat: `transaction::Change::new_value()` to get easy access to new va…
Byron Sep 30, 2022
ef9fa98
dry-run mode for fetch (#450)
Byron Sep 30, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ env_logger = { version = "0.9.0", default-features = false }
crosstermion = { version = "0.10.1", optional = true, default-features = false }
futures-lite = { version = "1.12.0", optional = true, default-features = false, features = ["std"] }

# for progress
owo-colors = "3.5.0"
tabled = { version = "0.8.0", default-features = false }

document-features = { version = "0.2.0", optional = true }

[profile.dev.package]
Expand Down
15 changes: 15 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,21 @@
* We `thiserror` generally.
* Adhere to the [stability guide](https://github.com/Byron/gitoxide/blob/main/STABILITY.md)

## Configuration and overrides

As a general rule, respect and implement all applicable [git-config](https://git-scm.com/docs/git-config) by default, but allow the
caller to set overrides. How overrides work depends on the goals of the particular API so it can be done on the main call path,
forcing a choice, or more typically, as a side-lane where overrides can be done on demand.

Note that it should be possible to obtain the current configuration for modification by the user for selective overrides, either
by calling methods or by obtaining a data structure that can be set as a whole using a `get -> modify -> set` cycle.

Note that without any of that, one should document that with `config_snapshot_mut()` any of the relevant configuration can be
changed in memory before invoking a method in order to affect it.

Parameters which are not available in git or specific to `gitoxide` or the needs of the caller can be passed as parameters or via
`Options` or `Context` structures as needed.

## General

* **async**
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ Please see _'Development Status'_ for a listing of all crates and their capabili
* Based on the [git-hours] algorithm.
* See the [discussion][git-hours-discussion] for some performance data.
* **the `gix` program** _(plumbing)_ - lower level commands for use in automation
* **progress** - provide an overview of what works and what doesn't from the perspective of the git configuration.
This is likely to change a lot over time depending on actual needs, but maybe useful for you to see
if particular git-configuration is picked up and where it deviates.
* **config** - list the complete git configuration in human-readable form and optionally filter sections by name.
* **exclude**
* [x] **query** - check if path specs are excluded via gits exclusion rules like `.gitignore`.
Expand Down
2 changes: 1 addition & 1 deletion etc/check-package-size.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@ echo "in root: gitoxide CLI"
(enter git-odb && indent cargo diet -n --package-size-limit 120KB)
(enter git-protocol && indent cargo diet -n --package-size-limit 50KB)
(enter git-packetline && indent cargo diet -n --package-size-limit 35KB)
(enter git-repository && indent cargo diet -n --package-size-limit 175KB)
(enter git-repository && indent cargo diet -n --package-size-limit 185KB)
(enter git-transport && indent cargo diet -n --package-size-limit 55KB)
(enter gitoxide-core && indent cargo diet -n --package-size-limit 90KB)
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ value = branch-override-by-include
deref: false,
}),
git_repository::lock::acquire::Fail::Immediately,
git_repository::lock::acquire::Fail::Immediately,
)?
.commit(repo.committer_or_default())?;

Expand Down
2 changes: 2 additions & 0 deletions git-pack/src/bundle/write/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@ use std::io;

use git_tempfile::handle::Writable;

/// The error returned by [`Bundle::write_to_directory()`][crate::Bundle::write_to_directory()]
#[derive(thiserror::Error, Debug)]
#[allow(missing_docs)]
pub enum Error {
#[error("An IO error occurred when reading the pack or creating a temporary file")]
Io(#[from] io::Error),
Expand Down
4 changes: 2 additions & 2 deletions git-pack/src/bundle/write/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use git_tempfile::{handle::Writable, AutoRemove, ContainingDirectory};
use crate::data;

mod error;
use error::Error;
pub use error::Error;

mod types;
use types::{LockWriter, PassThrough};
Expand Down Expand Up @@ -228,7 +228,7 @@ impl crate::Bundle {
Options {
thread_limit,
iteration_mode: _,
index_kind,
index_version: index_kind,
object_hash,
}: Options,
data_file: Arc<parking_lot::Mutex<git_tempfile::Handle<Writable>>>,
Expand Down
4 changes: 2 additions & 2 deletions git-pack/src/bundle/write/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ pub struct Options {
/// Determine how much processing to spend on protecting against corruption or recovering from errors.
pub iteration_mode: crate::data::input::Mode,
/// The version of pack index to write, should be [`crate::index::Version::default()`]
pub index_kind: crate::index::Version,
pub index_version: crate::index::Version,
/// The kind of hash to use when writing the bundle.
pub object_hash: git_hash::Kind,
}
Expand All @@ -22,7 +22,7 @@ impl Default for Options {
Options {
thread_limit: None,
iteration_mode: crate::data::input::Mode::Verify,
index_kind: Default::default(),
index_version: Default::default(),
object_hash: Default::default(),
}
}
Expand Down
2 changes: 1 addition & 1 deletion git-pack/src/index/write/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pub enum Error {
IteratorInvariantNoRefDelta,
#[error("The iterator failed to set a trailing hash over all prior pack entries in the last provided entry")]
IteratorInvariantTrailer,
#[error("Did not encounter a single base")]
#[error("Did not encounter a single base - refusing to write empty pack.")]
IteratorInvariantBasesPresent,
#[error("Only u32::MAX objects can be stored in a pack, found {0}")]
IteratorInvariantTooManyObjects(usize),
Expand Down
13 changes: 4 additions & 9 deletions git-pack/src/index/write/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ pub(crate) struct TreeEntry {
#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
pub struct Outcome {
/// The version of the verified index
pub index_kind: crate::index::Version,
pub index_version: crate::index::Version,
/// The verified checksum of the verified index
pub index_hash: git_hash::ObjectId,

Expand Down Expand Up @@ -171,7 +171,7 @@ impl crate::index::File {
modify_base(data, entry, bytes, kind.hash());
Ok::<_, Error>(())
},
crate::cache::delta::traverse::Options {
traverse::Options {
object_progress: root_progress.add_child("Resolving"),
size_progress: root_progress.add_child("Decoding"),
thread_limit,
Expand Down Expand Up @@ -207,20 +207,15 @@ impl crate::index::File {
progress::MessageLevel::Success,
);
Ok(Outcome {
index_kind: kind,
index_version: kind,
index_hash,
data_hash: pack_hash,
num_objects,
})
}
}

fn modify_base(
entry: &mut crate::index::write::TreeEntry,
pack_entry: &crate::data::Entry,
decompressed: &[u8],
hash: git_hash::Kind,
) {
fn modify_base(entry: &mut TreeEntry, pack_entry: &crate::data::Entry, decompressed: &[u8], hash: git_hash::Kind) {
fn compute_hash(kind: git_object::Kind, bytes: &[u8], object_hash: git_hash::Kind) -> git_hash::ObjectId {
let mut hasher = git_features::hash::hasher(object_hash);
hasher.update(&git_object::encode::loose_header(kind, bytes.len()));
Expand Down
4 changes: 2 additions & 2 deletions git-pack/tests/pack/bundle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ mod write_to_directory {
fn expected_outcome() -> Result<pack::bundle::write::Outcome, Box<dyn std::error::Error>> {
Ok(pack::bundle::write::Outcome {
index: pack::index::write::Outcome {
index_kind: pack::index::Version::V2,
index_version: pack::index::Version::V2,
index_hash: git_hash::ObjectId::from_hex(b"544a7204a55f6e9cacccf8f6e191ea8f83575de3")?,
data_hash: git_hash::ObjectId::from_hex(b"0f3ea84cd1bba10c2a03d736a460635082833e59")?,
num_objects: 42,
Expand Down Expand Up @@ -156,7 +156,7 @@ mod write_to_directory {
pack::bundle::write::Options {
thread_limit: None,
iteration_mode: pack::data::input::Mode::Verify,
index_kind: pack::index::Version::V2,
index_version: pack::index::Version::V2,
object_hash: git_hash::Kind::Sha1,
},
)
Expand Down
15 changes: 15 additions & 0 deletions git-pack/tests/pack/data/output/count_and_entries.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,21 @@ fn traversals() -> crate::Result {
Ok(())
}

#[test]
fn empty_pack_is_not_allowed() {
assert_eq!(
write_and_verify(
db(DbKind::DeterministicGeneratedContent).unwrap(),
vec![],
hex_to_id("029d08823bd8a8eab510ad6ac75c823cfd3ed31e"),
None,
)
.unwrap_err()
.to_string(),
"Did not encounter a single base - refusing to write empty pack."
);
}

fn write_and_verify(
db: git_odb::HandleArc,
entries: Vec<output::Entry>,
Expand Down
2 changes: 1 addition & 1 deletion git-pack/tests/pack/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ mod version {
outcome.num_objects, num_objects,
"it wrote the entire iterator worth of entries"
);
assert_eq!(outcome.index_kind, desired_kind);
assert_eq!(outcome.index_version, desired_kind);
assert_eq!(
outcome.index_hash,
git_hash::ObjectId::from(&expected[end_of_pack_hash..end_of_index_hash])
Expand Down
3 changes: 2 additions & 1 deletion git-protocol/src/fetch/arguments/blocking_io.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ use git_transport::{client, client::TransportV2Ext};
use crate::fetch::{Arguments, Command};

impl Arguments {
pub(crate) fn send<'a, T: client::Transport + 'a>(
/// Send fetch arguments to the server, and indicate this is the end of negotiations only if `add_done_argument` is present.
pub fn send<'a, T: client::Transport + 'a>(
&mut self,
transport: &'a mut T,
add_done_argument: bool,
Expand Down
12 changes: 11 additions & 1 deletion git-protocol/src/fetch/arguments/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ use std::fmt;
use bstr::{BStr, BString, ByteVec};

/// The arguments passed to a server command.
#[derive(Debug)]
pub struct Arguments {
/// The active features/capabilities of the fetch invocation
#[cfg(any(feature = "async-client", feature = "blocking-client"))]
Expand All @@ -24,6 +25,13 @@ pub struct Arguments {
}

impl Arguments {
/// Return true if there is no argument at all.
///
/// This can happen if callers assure that they won't add 'wants' if their 'have' is the same, i.e. if the remote has nothing
/// new for them.
pub fn is_empty(&self) -> bool {
self.args.is_empty()
}
/// Return true if ref filters is supported.
pub fn can_use_filter(&self) -> bool {
self.filter
Expand Down Expand Up @@ -125,8 +133,10 @@ impl Arguments {
fn prefixed(&mut self, prefix: &str, value: impl fmt::Display) {
self.args.push(format!("{}{}", prefix, value).into());
}
/// Create a new instance to help setting up arguments to send to the server as part of a `fetch` operation
/// for which `features` are the available and configured features to use.
#[cfg(any(feature = "async-client", feature = "blocking-client"))]
pub(crate) fn new(version: git_transport::Protocol, features: Vec<crate::fetch::command::Feature>) -> Self {
pub fn new(version: git_transport::Protocol, features: Vec<crate::fetch::command::Feature>) -> Self {
use crate::fetch::Command;
let has = |name: &str| features.iter().any(|f| f.0 == name);
let filter = has("filter");
Expand Down
18 changes: 14 additions & 4 deletions git-protocol/src/fetch/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,12 @@ mod with_io {
"filter ", // filter-spec
// ref-in-want feature
"want-ref ", // ref path
// sideband-all feature
"sideband-all",
// packfile-uris feature
"packfile-uris ", // protocols
// wait-for-done feature
"wait-for-done",
],
}
}
Expand All @@ -79,9 +82,14 @@ mod with_io {
"no-done",
"filter",
],
git_transport::Protocol::V2 => {
&["shallow", "filter", "ref-in-want", "sideband-all", "packfile-uris"]
}
git_transport::Protocol::V2 => &[
"shallow",
"filter",
"ref-in-want",
"sideband-all",
"packfile-uris",
"wait-for-done",
],
},
}
}
Expand All @@ -104,7 +112,9 @@ mod with_io {
}
}

pub(crate) fn default_features(
/// Turns on all modern features for V1 and all supported features for V2, returning them as a vector of features.
/// Note that this is the basis for any fetch operation as these features fulfil basic requirements and reasonably up-to-date servers.
pub fn default_features(
&self,
version: git_transport::Protocol,
server_capabilities: &Capabilities,
Expand Down
2 changes: 1 addition & 1 deletion git-protocol/src/fetch/handshake.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use git_transport::client::Capabilities;
use crate::fetch::Ref;

/// The result of the [`handshake()`][super::handshake()] function.
#[derive(Debug, Clone)]
#[derive(Default, Debug, Clone)]
#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
pub struct Outcome {
/// The protocol version the server responded with. It might have downgraded the desired version.
Expand Down
4 changes: 2 additions & 2 deletions git-protocol/src/fetch/refs/function.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ use super::Error;
use crate::fetch::{indicate_end_of_interaction, refs::from_v2_refs, Command, LsRefsAction, Ref};

/// Invoke an ls-refs command on `transport` (assuming `protocol_version` 2 or panic), which requires a prior handshake that yielded
/// server `capabilities`. `prepare_ls_refs(arguments, features)` can be used to alter the _ls-refs_. `progress` is used to provide feedback.
/// server `capabilities`. `prepare_ls_refs(capabilities, arguments, features)` can be used to alter the _ls-refs_. `progress` is used to provide feedback.
#[maybe_async]
pub async fn refs(
mut transport: impl Transport,
protocol_version: Protocol,
capabilities: &Capabilities,
mut prepare_ls_refs: impl FnMut(
prepare_ls_refs: impl FnOnce(
&Capabilities,
&mut Vec<BString>,
&mut Vec<(&str, Option<&str>)>,
Expand Down
Loading