Skip to content

Commit 32dc182

Browse files
committed
feat!: use git-credentials in git-protocol (#386)
1 parent 3d339d5 commit 32dc182

File tree

18 files changed

+38
-297
lines changed

18 files changed

+38
-297
lines changed

Cargo.lock

Lines changed: 9 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ check: ## Build all code in suitable configurations
9090
&& cargo check --features verbose-object-parsing-errors
9191
cd git-index && cargo check --features serde1
9292
cd git-credentials && cargo check --features serde1
93+
cd git-sec && cargo check --features serde1
9394
cd git-revision && cargo check --features serde1
9495
cd git-attributes && cargo check --features serde1
9596
cd git-glob && cargo check --features serde1

git-protocol/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ required-features = ["async-client"]
4242
git-features = { version = "^0.20.0", path = "../git-features", features = ["progress"] }
4343
git-transport = { version = "^0.16.0", path = "../git-transport" }
4444
git-hash = { version = "^0.9.3", path = "../git-hash" }
45+
git-credentials = { version = "^0.1.0", path = "../git-credentials" }
4546

4647
quick-error = "2.0.0"
4748
serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"]}

git-protocol/src/credentials.rs

Lines changed: 0 additions & 175 deletions
This file was deleted.

git-protocol/src/fetch/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ quick_error! {
1818
from()
1919
source(err)
2020
}
21-
Credentials(err: credentials::Error) {
21+
Credentials(err: credentials::helper::Error) {
2222
display("Failed to obtain, approve or reject credentials")
2323
from()
2424
source(err)

git-protocol/src/fetch_fn.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ pub async fn fetch<F, D, T>(
5858
fetch_mode: FetchConnection,
5959
) -> Result<(), Error>
6060
where
61-
F: FnMut(credentials::Action<'_>) -> credentials::Result,
61+
F: FnMut(credentials::helper::Action<'_>) -> credentials::helper::Result,
6262
D: Delegate,
6363
T: client::Transport,
6464
{
@@ -85,8 +85,8 @@ where
8585
drop(result); // needed to workaround this: https://github.com/rust-lang/rust/issues/76149
8686
let url = transport.to_url();
8787
progress.set_name("authentication");
88-
let credentials::Outcome { identity, next } =
89-
authenticate(credentials::Action::Fill(&url))?.expect("FILL provides an identity");
88+
let credentials::helper::Outcome { identity, next } =
89+
authenticate(credentials::helper::Action::Fill(&url))?.expect("FILL provides an identity");
9090
transport.set_identity(identity)?;
9191
progress.step();
9292
progress.set_name("handshake (authenticated)");

git-protocol/src/lib.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@
1010
#![deny(unsafe_code)]
1111
#![deny(rust_2018_idioms, missing_docs)]
1212

13+
pub use git_credentials as credentials;
1314
/// A convenience export allowing users of git-protocol to use the transport layer without their own cargo dependency.
1415
pub use git_transport as transport;
1516

16-
///
17-
pub mod credentials;
1817
///
1918
#[cfg(any(feature = "blocking-client", feature = "async-client"))]
2019
pub mod fetch;

git-protocol/tests/async-protocol.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@ pub fn fixture_bytes(path: &str) -> Vec<u8> {
55
.expect("fixture to be present and readable")
66
}
77

8-
mod credentials;
98
mod fetch;
109
mod remote_progress;

git-protocol/tests/blocking-protocol.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,5 @@ pub fn fixture_bytes(path: &str) -> Vec<u8> {
55
.expect("fixture to be present and readable")
66
}
77

8-
mod credentials;
98
mod fetch;
109
mod remote_progress;

git-protocol/tests/credentials/mod.rs

Lines changed: 0 additions & 86 deletions
This file was deleted.

0 commit comments

Comments
 (0)