diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 88c3c6c9f1..98ed1523a4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,8 +33,8 @@ jobs: - name: Install Rust (rustup) run: rustup update ${{ matrix.rust }} --no-self-update && rustup default ${{ matrix.rust }} shell: bash - - run: cargo test --no-default-features --locked - - run: cargo test + - run: cargo test --locked + - run: cargo test --features https,ssh - run: cargo run -p systest - run: cargo test -p git2-curl diff --git a/Cargo.toml b/Cargo.toml index 4f53a90c03..30a496deaf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,3 +45,9 @@ zlib-ng-compat = ["libgit2-sys/zlib-ng-compat"] [workspace] members = ["systest", "git2-curl"] + +[package.metadata.docs.rs] +features = ["https", "ssh"] + +[[examples]] +required-features = ["https", "ssh"] diff --git a/README.md b/README.md index ca00ad9672..bbbeb54820 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,20 @@ libgit2 bindings for Rust. -```toml -[dependencies] -git2 = "0.21" +``` +cargo add git2 +``` + +## Features + +By default, git2 includes support for working with local repositories, but does +not include network support (e.g. cloning remote repositories). If you want to +use features that require network support, you may need the `"https"` and/or +`"ssh"` features. If you support user-provided repository URLs, you probably +want to enable both. + +``` +cargo add git2 --features https,ssh ``` ## Rust version requirements