Skip to content

Commit

Permalink
[git-transport] remove default features to force being explicit every…
Browse files Browse the repository at this point in the history
…where
  • Loading branch information
Byron committed May 13, 2021
1 parent 9741ae1 commit d1b39f8
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 3 deletions.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,20 @@ check: ## Build all code in suitable configurations
&& cargo check
cd git-config && cargo check --all-features \
&& cargo check
cd git-transport && cargo check --all-features \
&& cargo check \
&& cargo check --features blocking-client \
&& cargo check --features http-client-curl
cd git-protocol && cargo check --all-features \
&& cargo check \
&& cargo check --features blocking-client

unit-tests: ## run all unit tests
cargo test --all --no-fail-fast
cd git-features && cargo test && cargo test --all-features
cd git-odb && cargo test && cargo test --all-features
cd git-transport && cargo test && cargo test --features http-client-curl && cargo test --no-default-features
cd git-protocol && cargo test --features blocking-client
cd gitoxide-core && cargo test --lib

continuous-unit-tests: ## run all unit tests whenever something changes
Expand Down
6 changes: 6 additions & 0 deletions git-protocol/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ doctest = false

[features]
serde1 = ["serde", "bstr/serde1", "git-transport/serde1", "git-hash/serde1"]
blocking-client = ["git-transport/blocking-client"]

[[test]]
name = "blocking-client"
path = "tests/protocol.rs"
required-features = ["blocking-client"]

[dependencies]
git-features = { version = "^0.14.0", path = "../git-features" }
Expand Down
3 changes: 3 additions & 0 deletions git-protocol/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ mod remote_progress;
pub use remote_progress::RemoteProgress;

///
#[cfg(feature = "blocking-client")]
pub mod credentials;
///
#[cfg(feature = "blocking-client")]
pub mod fetch;

#[doc(inline)]
#[cfg(feature = "blocking-client")]
pub use fetch::fetch;
2 changes: 2 additions & 0 deletions git-protocol/tests/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ pub fn fixture_bytes(path: &str) -> Vec<u8> {
std::fs::read(PathBuf::from("tests").join("fixtures").join(path)).expect("fixture to be present and readable")
}

#[cfg(feature = "blocking-client")]
mod credentials;
#[cfg(feature = "blocking-client")]
mod fetch;
mod remote_progress;
3 changes: 1 addition & 2 deletions git-transport/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ include = ["src/**/*"]
doctest = false

[features]
default = ["blocking-client"]
default = []
serde1 = ["serde"]
http-client-curl = ["curl", "base64", "git-features/io-pipe", "blocking-client"]
blocking-client = ["maybe-async/is_sync"]
Expand All @@ -30,7 +30,6 @@ required-features = ["http-client-curl"]
[[test]]
name = "async-transport"
path = "tests/async-transport.rs"
# default-features = false - when testing, use --no-default-features, nothing we can specify in test cases though.
required-features = []

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
Expand Down
2 changes: 1 addition & 1 deletion gitoxide-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ git-repository = { version = "^0.5.0", path = "../git-repository" }
git-object = { version = "^0.9.0", path = "../git-object" }
git-hash = { version = "^0.3.0", path = "../git-hash" }
git-odb = { version = "^0.15.0", path = "../git-odb", features = ["pack-cache-lru-static"] }
git-protocol = { version = "^0.7.0", path = "../git-protocol" }
git-protocol = { version = "^0.7.0", path = "../git-protocol", features = ["blocking-client"] }
git-features = { version = "^0.14.0", path = "../git-features" }
git-commitgraph = { version = "^0.4.0", path = "../git-commitgraph" }
git-config = { version = "^0.1.0", path = "../git-config" }
Expand Down

0 comments on commit d1b39f8

Please sign in to comment.