Skip to content

Commit 734c0a3

Browse files
committed
Update to libgit2 0.28.2
This includes a semver bump for all crates, as a few APIs have been renamed in 0.28. Upstream provides `deprecated.h` aliases, if we'd like to follow suit, but I feel it's better to just move forward. - `giterr_*` -> `git_error_*` - `GITERR_*` -> `GIT_ERROR_*` - `git_otype` -> `git_object_t` - `GIT_OBJ_*` -> `GIT_OBJECT_*` - `git_ref_t` -> `git_reference_t` - `GIT_REF_*` -> `GIT_REFERENCE_*` - `git_idxentry_*` -> `git_index_entry_*` - `GIT_IDXENTRY_*` -> `GIT_INDEX_ENTRY_*` - `git_buf_free` -> `git_buf_dispose` Proxy support is now builtin to `libgit2`, so `libcurl` is no longer a dependency at all. Proxies were also the reason for `git2-curl` to exist, which seems to be unnecessary for a while now, since `libgit2` used `libcurl` itself since 0.23 anyway. Maybe `git2-curl` can just be retired now, but I've updated it just for the sake of compatibility. The minimum pkg-config libgit2 is now documented and tested for 0.28. While it previously claimed support for 0.25.1, this was broken by `git_config_entry`'s `include_depth` field, which was added *after* the 0.27 release branched.
1 parent 146332a commit 734c0a3

File tree

19 files changed

+227
-279
lines changed

19 files changed

+227
-279
lines changed

.gitmodules

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
[submodule "libgit2-sys/libgit2"]
22
path = libgit2-sys/libgit2
33
url = https://github.com/libgit2/libgit2
4+
branch = maint/v0.28

Cargo.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22

33
name = "git2"
4-
version = "0.8.0"
4+
version = "0.9.0"
55
authors = ["Josh Triplett <[email protected]>", "Alex Crichton <[email protected]>"]
66
license = "MIT/Apache-2.0"
77
readme = "README.md"
@@ -23,7 +23,7 @@ url = "1.0"
2323
bitflags = "1.0"
2424
libc = "0.2"
2525
log = "0.4"
26-
libgit2-sys = { path = "libgit2-sys", version = "0.7.11" }
26+
libgit2-sys = { path = "libgit2-sys", version = "0.8.0" }
2727

2828
[target."cfg(all(unix, not(target_os = \"macos\")))".dependencies]
2929
openssl-sys = { version = "0.9.0", optional = true }
@@ -39,10 +39,9 @@ thread-id = "3.3.0" # remove when we work with minimal-versions without it
3939

4040
[features]
4141
unstable = []
42-
default = ["ssh", "https", "curl", "ssh_key_from_memory"]
42+
default = ["ssh", "https", "ssh_key_from_memory"]
4343
ssh = ["libgit2-sys/ssh"]
4444
https = ["libgit2-sys/https", "openssl-sys", "openssl-probe"]
45-
curl = ["libgit2-sys/curl"]
4645
vendored-openssl = ["openssl-sys/vendored"]
4746
ssh_key_from_memory = ["libgit2-sys/ssh_key_from_memory"]
4847

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ version of Rust known to pass tests.
1919

2020
## Version of libgit2
2121

22-
Currently this library requires libgit2 0.25.1. The source for libgit2 is
22+
Currently this library requires libgit2 0.28.0. The source for libgit2 is
2323
included in the libgit2-sys crate so there's no need to pre-install the libgit2
2424
library, the libgit2-sys crate will figure that and/or build that for you.
2525

git2-curl/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22

33
name = "git2-curl"
4-
version = "0.9.0"
4+
version = "0.10.0"
55
authors = ["Josh Triplett <[email protected]>", "Alex Crichton <[email protected]>"]
66
license = "MIT/Apache-2.0"
77
repository = "https://github.com/rust-lang/git2-rs"
@@ -16,7 +16,7 @@ Intended to be used with the git2 crate.
1616
curl = "0.4"
1717
url = "1.0"
1818
log = "0.4"
19-
git2 = { path = "..", version = "0.8", default-features = false }
19+
git2 = { path = "..", version = "0.9", default-features = false }
2020

2121
[dev-dependencies]
2222
civet = "0.11"

libgit2-sys/Cargo.toml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "libgit2-sys"
3-
version = "0.7.11"
3+
version = "0.8.0"
44
authors = ["Josh Triplett <[email protected]>", "Alex Crichton <[email protected]>"]
55
links = "git2"
66
build = "build.rs"
@@ -16,13 +16,12 @@ name = "libgit2_sys"
1616
path = "lib.rs"
1717

1818
[dependencies]
19-
curl-sys = { version = "0.4.10", optional = true }
2019
libc = "0.2"
2120
libssh2-sys = { version = "0.2.11", optional = true }
2221
libz-sys = "1.0.22"
2322

2423
[build-dependencies]
25-
pkg-config = "0.3"
24+
pkg-config = "0.3.7"
2625
cc = "1.0.25"
2726

2827
[target.'cfg(unix)'.dependencies]
@@ -31,5 +30,4 @@ openssl-sys = { version = "0.9", optional = true }
3130
[features]
3231
ssh = ["libssh2-sys"]
3332
https = ["openssl-sys"]
34-
curl = ["curl-sys"]
3533
ssh_key_from_memory = []

libgit2-sys/build.rs

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,13 @@ use std::process::Command;
99
fn main() {
1010
let https = env::var("CARGO_FEATURE_HTTPS").is_ok();
1111
let ssh = env::var("CARGO_FEATURE_SSH").is_ok();
12-
let curl = env::var("CARGO_FEATURE_CURL").is_ok();
1312

1413
if env::var("LIBGIT2_SYS_USE_PKG_CONFIG").is_ok() {
15-
if pkg_config::find_library("libgit2").is_ok() {
14+
let mut cfg = pkg_config::Config::new();
15+
if let Ok(lib) = cfg.atleast_version("0.28.0").probe("libgit2") {
16+
for include in &lib.include_paths {
17+
println!("cargo:root={}", include.display());
18+
}
1619
return
1720
}
1821
}
@@ -121,21 +124,14 @@ fn main() {
121124
}
122125
}
123126
} else {
124-
cfg.file("libgit2/src/hash/hash_generic.c");
127+
features.push_str("#define GIT_SHA1_COLLISIONDETECT 1\n");
128+
cfg.define("SHA1DC_NO_STANDARD_INCLUDES", "1");
129+
cfg.define("SHA1DC_CUSTOM_INCLUDE_SHA1_C", "\"common.h\"");
130+
cfg.define("SHA1DC_CUSTOM_INCLUDE_UBC_CHECK_C", "\"common.h\"");
131+
cfg.file("libgit2/src/hash/sha1dc/sha1.c");
132+
cfg.file("libgit2/src/hash/sha1dc/ubc_check.c");
125133
}
126134

127-
if curl {
128-
features.push_str("#define GIT_CURL 1\n");
129-
if let Some(path) = env::var_os("DEP_CURL_INCLUDE") {
130-
cfg.include(path);
131-
}
132-
// Handle dllimport/dllexport on windows by making sure that if we built
133-
// curl statically (as told to us by the `curl-sys` crate) we define the
134-
// correct values for curl's header files.
135-
if env::var_os("DEP_CURL_STATIC").is_some() {
136-
cfg.define("CURL_STATICLIB", None);
137-
}
138-
}
139135
if let Some(path) = env::var_os("DEP_Z_INCLUDE") {
140136
cfg.include(path);
141137
}

0 commit comments

Comments
 (0)