Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Prev Previous commit
test(sys): ctest for experimental sha256 OID support
  • Loading branch information
weihanglo committed Jan 1, 2026
commit ab41d66e1b00ca86ca37e69967adaab782dba4db
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
- run: cargo test --locked
- run: cargo test --features https,ssh
- run: cargo run -p systest
- run: cargo run -p systest --features unstable-sha256
- run: cargo test -p git2-curl

rustfmt:
Expand Down
3 changes: 3 additions & 0 deletions systest/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ libc = "0.2"

[build-dependencies]
ctest2 = "0.4"

[features]
unstable-sha256 = ["libgit2-sys/unstable-sha256"]
8 changes: 8 additions & 0 deletions systest/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ fn main() {
if let Some(root) = env::var_os("DEP_GIT2_ROOT") {
cfg.include(PathBuf::from(root).join("include"));
}

// Enable the unstable-sha256 rust cfg
// so ctest2 sees the correct function signatures
if env::var("CARGO_FEATURE_UNSTABLE_SHA256").is_ok() {
cfg.cfg("feature", Some("unstable-sha256"));
cfg.define("GIT_EXPERIMENTAL_SHA256", Some("1"));
}

cfg.header("git2.h")
.header("git2/sys/errors.h")
.header("git2/sys/transport.h")
Expand Down