Skip to content

Commit 3958d71

Browse files
committed
Provide all information generated by the handshake into the refmap result (#450)
1 parent ffa24a1 commit 3958d71

File tree

6 files changed

+12
-6
lines changed

6 files changed

+12
-6
lines changed

git-repository/src/config/cache/incubate.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ use super::{util, Error};
22

33
/// A utility to deal with the cyclic dependency between the ref store and the configuration. The ref-store needs the
44
/// object hash kind, and the configuration needs the current branch name to resolve conditional includes with `onbranch`.
5-
#[allow(dead_code)]
65
pub(crate) struct StageOne {
76
pub git_dir_config: git_config::File<'static>,
87
pub buf: Vec<u8>,

git-repository/src/open.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ impl Default for Options {
9090
}
9191

9292
#[derive(Default, Clone)]
93-
#[allow(dead_code)]
9493
pub(crate) struct EnvironmentOverrides {
9594
/// An override of the worktree typically from the environment, and overrides even worktree dirs set as parameter.
9695
///

git-repository/src/remote/connection/list_refs.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,12 @@ pub mod to_map {
136136
local: m.rhs.map(|c| c.into_owned()),
137137
})
138138
.collect();
139-
Ok(fetch::RefMap { mappings, fixes })
139+
Ok(fetch::RefMap {
140+
mappings,
141+
fixes,
142+
remote_refs: remote.refs,
143+
handshake: remote.outcome,
144+
})
140145
}
141146
}
142147
}

git-repository/src/remote/connection/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use crate::Remote;
22

33
pub(crate) struct HandshakeWithRefs {
4-
#[allow(dead_code)]
54
outcome: git_protocol::fetch::handshake::Outcome,
65
refs: Vec<git_protocol::fetch::Ref>,
76
}

git-repository/src/remote/mod.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ pub mod fetch {
3737
pub mappings: Vec<Mapping>,
3838
/// Information about the fixes applied to the `mapping` due to validation and sanitization.
3939
pub fixes: Vec<git_refspec::match_group::validate::Fix>,
40+
/// All refs advertised by the remote.
41+
pub remote_refs: Vec<git_protocol::fetch::Ref>,
42+
/// Additional information provided by the server as part of the handshake.
43+
///
44+
/// Note that the `refs` field is always `None` as the refs are placed in `remote_refs`.
45+
pub handshake: git_protocol::fetch::handshake::Outcome,
4046
}
4147

4248
/// Either an object id that the remote has or the matched remote ref itself.

git-repository/src/remote/url/scheme_permission.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![allow(dead_code, unused_variables)]
2-
31
use std::{borrow::Cow, collections::BTreeMap, convert::TryFrom};
42

53
use crate::bstr::{BStr, BString, ByteSlice};

0 commit comments

Comments
 (0)