Skip to content

Commit b117510

Browse files
committed
Update to libgit2 1.6.1
1 parent d5320a8 commit b117510

File tree

14 files changed

+60
-75
lines changed

14 files changed

+60
-75
lines changed

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "git2"
3-
version = "0.16.1"
3+
version = "0.17.0"
44
authors = ["Josh Triplett <[email protected]>", "Alex Crichton <[email protected]>"]
55
license = "MIT OR Apache-2.0"
66
readme = "README.md"
@@ -20,7 +20,7 @@ url = "2.0"
2020
bitflags = "1.1.0"
2121
libc = "0.2"
2222
log = "0.4.8"
23-
libgit2-sys = { path = "libgit2-sys", version = "0.14.2" }
23+
libgit2-sys = { path = "libgit2-sys", version = "0.15.0" }
2424

2525
[target."cfg(all(unix, not(target_os = \"macos\")))".dependencies]
2626
openssl-sys = { version = "0.9.0", optional = true }

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ libgit2 bindings for Rust.
66

77
```toml
88
[dependencies]
9-
git2 = "0.16.1"
9+
git2 = "0.17.0"
1010
```
1111

1212
## Rust version requirements

git2-curl/Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "git2-curl"
3-
version = "0.17.0"
3+
version = "0.18.0"
44
authors = ["Josh Triplett <[email protected]>", "Alex Crichton <[email protected]>"]
55
license = "MIT OR Apache-2.0"
66
repository = "https://github.com/rust-lang/git2-rs"
@@ -16,7 +16,7 @@ edition = "2018"
1616
curl = "0.4.33"
1717
url = "2.0"
1818
log = "0.4"
19-
git2 = { path = "..", version = "0.16", default-features = false }
19+
git2 = { path = "..", version = "0.17", default-features = false }
2020

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

git2-curl/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
//! > **NOTE**: At this time this crate likely does not support a `git push`
1616
//! > operation, only clones.
1717
18-
#![doc(html_root_url = "https://docs.rs/git2-curl/0.17")]
18+
#![doc(html_root_url = "https://docs.rs/git2-curl/0.18")]
1919
#![deny(missing_docs)]
2020
#![warn(rust_2018_idioms)]
2121
#![cfg_attr(test, deny(warnings))]

libgit2-sys/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "libgit2-sys"
3-
version = "0.14.2+1.5.1"
3+
version = "0.15.0+1.6.1"
44
authors = ["Josh Triplett <[email protected]>", "Alex Crichton <[email protected]>"]
55
links = "git2"
66
build = "build.rs"

libgit2-sys/build.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,7 @@ fn main() {
1414
let try_to_use_system_libgit2 = !vendored && !zlib_ng_compat;
1515
if try_to_use_system_libgit2 {
1616
let mut cfg = pkg_config::Config::new();
17-
// These version ranges specifically request a version that includes
18-
// the SSH fixes for CVE-2023-22742 (1.5.1+ or 1.4.5+).
19-
if let Ok(lib) = cfg
20-
.range_version("1.5.1".."1.6.0")
21-
.probe("libgit2")
22-
.or_else(|_| cfg.range_version("1.4.5".."1.5.0").probe("libgit2"))
23-
{
17+
if let Ok(lib) = cfg.range_version("1.6.1".."1.7.0").probe("libgit2") {
2418
for include in &lib.include_paths {
2519
println!("cargo:root={}", include.display());
2620
}
@@ -194,7 +188,7 @@ fn main() {
194188
}
195189

196190
features.push_str("#endif\n");
197-
fs::write(include.join("git2/sys/features.h"), features).unwrap();
191+
fs::write(include.join("git2_features.h"), features).unwrap();
198192

199193
cfg.compile("git2");
200194

libgit2-sys/lib.rs

+35-41
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![doc(html_root_url = "https://docs.rs/libgit2-sys/0.14")]
1+
#![doc(html_root_url = "https://docs.rs/libgit2-sys/0.15")]
22
#![allow(non_camel_case_types, unused_extern_crates)]
33

44
// This is required to link libz when libssh2-sys is not included.
@@ -1160,37 +1160,40 @@ pub type git_diff_notify_cb = Option<
11601160
pub type git_diff_progress_cb =
11611161
Option<extern "C" fn(*const git_diff, *const c_char, *const c_char, *mut c_void) -> c_int>;
11621162

1163-
pub type git_diff_option_t = i32;
1164-
pub const GIT_DIFF_NORMAL: git_diff_option_t = 0;
1165-
pub const GIT_DIFF_REVERSE: git_diff_option_t = 1 << 0;
1166-
pub const GIT_DIFF_INCLUDE_IGNORED: git_diff_option_t = 1 << 1;
1167-
pub const GIT_DIFF_RECURSE_IGNORED_DIRS: git_diff_option_t = 1 << 2;
1168-
pub const GIT_DIFF_INCLUDE_UNTRACKED: git_diff_option_t = 1 << 3;
1169-
pub const GIT_DIFF_RECURSE_UNTRACKED_DIRS: git_diff_option_t = 1 << 4;
1170-
pub const GIT_DIFF_INCLUDE_UNMODIFIED: git_diff_option_t = 1 << 5;
1171-
pub const GIT_DIFF_INCLUDE_TYPECHANGE: git_diff_option_t = 1 << 6;
1172-
pub const GIT_DIFF_INCLUDE_TYPECHANGE_TREES: git_diff_option_t = 1 << 7;
1173-
pub const GIT_DIFF_IGNORE_FILEMODE: git_diff_option_t = 1 << 8;
1174-
pub const GIT_DIFF_IGNORE_SUBMODULES: git_diff_option_t = 1 << 9;
1175-
pub const GIT_DIFF_IGNORE_CASE: git_diff_option_t = 1 << 10;
1176-
pub const GIT_DIFF_DISABLE_PATHSPEC_MATCH: git_diff_option_t = 1 << 12;
1177-
pub const GIT_DIFF_SKIP_BINARY_CHECK: git_diff_option_t = 1 << 13;
1178-
pub const GIT_DIFF_ENABLE_FAST_UNTRACKED_DIRS: git_diff_option_t = 1 << 14;
1179-
pub const GIT_DIFF_UPDATE_INDEX: git_diff_option_t = 1 << 15;
1180-
pub const GIT_DIFF_INCLUDE_UNREADABLE: git_diff_option_t = 1 << 16;
1181-
pub const GIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED: git_diff_option_t = 1 << 17;
1182-
pub const GIT_DIFF_INDENT_HEURISTIC: git_diff_option_t = 1 << 18;
1183-
pub const GIT_DIFF_IGNORE_BLANK_LINES: git_diff_option_t = 1 << 19;
1184-
pub const GIT_DIFF_FORCE_TEXT: git_diff_option_t = 1 << 20;
1185-
pub const GIT_DIFF_FORCE_BINARY: git_diff_option_t = 1 << 21;
1186-
pub const GIT_DIFF_IGNORE_WHITESPACE: git_diff_option_t = 1 << 22;
1187-
pub const GIT_DIFF_IGNORE_WHITESPACE_CHANGE: git_diff_option_t = 1 << 23;
1188-
pub const GIT_DIFF_IGNORE_WHITESPACE_EOL: git_diff_option_t = 1 << 24;
1189-
pub const GIT_DIFF_SHOW_UNTRACKED_CONTENT: git_diff_option_t = 1 << 25;
1190-
pub const GIT_DIFF_SHOW_UNMODIFIED: git_diff_option_t = 1 << 26;
1191-
pub const GIT_DIFF_PATIENCE: git_diff_option_t = 1 << 28;
1192-
pub const GIT_DIFF_MINIMAL: git_diff_option_t = 1 << 29;
1193-
pub const GIT_DIFF_SHOW_BINARY: git_diff_option_t = 1 << 30;
1163+
git_enum! {
1164+
pub enum git_diff_option_t {
1165+
GIT_DIFF_NORMAL = 0,
1166+
GIT_DIFF_REVERSE = 1 << 0,
1167+
GIT_DIFF_INCLUDE_IGNORED = 1 << 1,
1168+
GIT_DIFF_RECURSE_IGNORED_DIRS = 1 << 2,
1169+
GIT_DIFF_INCLUDE_UNTRACKED = 1 << 3,
1170+
GIT_DIFF_RECURSE_UNTRACKED_DIRS = 1 << 4,
1171+
GIT_DIFF_INCLUDE_UNMODIFIED = 1 << 5,
1172+
GIT_DIFF_INCLUDE_TYPECHANGE = 1 << 6,
1173+
GIT_DIFF_INCLUDE_TYPECHANGE_TREES = 1 << 7,
1174+
GIT_DIFF_IGNORE_FILEMODE = 1 << 8,
1175+
GIT_DIFF_IGNORE_SUBMODULES = 1 << 9,
1176+
GIT_DIFF_IGNORE_CASE = 1 << 10,
1177+
GIT_DIFF_DISABLE_PATHSPEC_MATCH = 1 << 12,
1178+
GIT_DIFF_SKIP_BINARY_CHECK = 1 << 13,
1179+
GIT_DIFF_ENABLE_FAST_UNTRACKED_DIRS = 1 << 14,
1180+
GIT_DIFF_UPDATE_INDEX = 1 << 15,
1181+
GIT_DIFF_INCLUDE_UNREADABLE = 1 << 16,
1182+
GIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED = 1 << 17,
1183+
GIT_DIFF_INDENT_HEURISTIC = 1 << 18,
1184+
GIT_DIFF_IGNORE_BLANK_LINES = 1 << 19,
1185+
GIT_DIFF_FORCE_TEXT = 1 << 20,
1186+
GIT_DIFF_FORCE_BINARY = 1 << 21,
1187+
GIT_DIFF_IGNORE_WHITESPACE = 1 << 22,
1188+
GIT_DIFF_IGNORE_WHITESPACE_CHANGE = 1 << 23,
1189+
GIT_DIFF_IGNORE_WHITESPACE_EOL = 1 << 24,
1190+
GIT_DIFF_SHOW_UNTRACKED_CONTENT = 1 << 25,
1191+
GIT_DIFF_SHOW_UNMODIFIED = 1 << 26,
1192+
GIT_DIFF_PATIENCE = 1 << 28,
1193+
GIT_DIFF_MINIMAL = 1 << 29,
1194+
GIT_DIFF_SHOW_BINARY = 1 << 30,
1195+
}
1196+
}
11941197

11951198
#[repr(C)]
11961199
pub struct git_diff_find_options {
@@ -3917,15 +3920,6 @@ extern "C" {
39173920

39183921
pub fn git_odb_add_disk_alternate(odb: *mut git_odb, path: *const c_char) -> c_int;
39193922

3920-
pub fn git_odb_backend_loose(
3921-
out: *mut *mut git_odb_backend,
3922-
objects_dir: *const c_char,
3923-
compression_level: c_int,
3924-
do_fsync: c_int,
3925-
dir_mode: c_uint,
3926-
file_mode: c_uint,
3927-
) -> c_int;
3928-
39293923
pub fn git_odb_add_alternate(
39303924
odb: *mut git_odb,
39313925
backend: *mut git_odb_backend,

libgit2-sys/libgit2

Submodule libgit2 updated 514 files

src/diff.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -679,8 +679,7 @@ impl DiffOptions {
679679
opts
680680
}
681681

682-
fn flag(&mut self, opt: i32, val: bool) -> &mut DiffOptions {
683-
let opt = opt as u32;
682+
fn flag(&mut self, opt: raw::git_diff_option_t, val: bool) -> &mut DiffOptions {
684683
if val {
685684
self.raw.flags |= opt;
686685
} else {

src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
//! source `Repository`, to ensure that they do not outlive the repository
6666
//! itself.
6767
68-
#![doc(html_root_url = "https://docs.rs/git2/0.16")]
68+
#![doc(html_root_url = "https://docs.rs/git2/0.17")]
6969
#![allow(trivial_numeric_casts, trivial_casts)]
7070
#![deny(missing_docs)]
7171
#![warn(rust_2018_idioms)]

systest/build.rs

+5-11
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,11 @@ fn main() {
2626
// the real name of this field is ref but that is a reserved keyword
2727
(struct_ == "git_worktree_add_options" && f == "reference")
2828
});
29-
cfg.skip_signededness(|s| {
30-
match s {
31-
s if s.ends_with("_cb") => true,
32-
s if s.ends_with("_callback") => true,
33-
"git_push_transfer_progress" | "git_push_negotiation" | "git_packbuilder_progress" => {
34-
true
35-
}
36-
// TODO: fix this on the next major update of libgit2-sys
37-
"git_diff_option_t" => true,
38-
_ => false,
39-
}
29+
cfg.skip_signededness(|s| match s {
30+
s if s.ends_with("_cb") => true,
31+
s if s.ends_with("_callback") => true,
32+
"git_push_transfer_progress" | "git_push_negotiation" | "git_packbuilder_progress" => true,
33+
_ => false,
4034
});
4135

4236
// not entirely sure why this is failing...

tests/add_extensions.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,11 @@ fn test_add_extensions() -> Result<(), Error> {
1111

1212
let extensions = unsafe { get_extensions() }?;
1313

14-
assert_eq!(extensions.len(), 2);
14+
assert_eq!(extensions.len(), 3);
1515
assert_eq!(extensions.get(0), Some("noop"));
16-
assert_eq!(extensions.get(1), Some("custom"));
16+
// The objectformat extension was added in 1.6
17+
assert_eq!(extensions.get(1), Some("objectformat"));
18+
assert_eq!(extensions.get(2), Some("custom"));
1719

1820
Ok(())
1921
}

tests/get_extensions.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@ use git2::Error;
77
fn test_get_extensions() -> Result<(), Error> {
88
let extensions = unsafe { get_extensions() }?;
99

10-
assert_eq!(extensions.len(), 1);
10+
assert_eq!(extensions.len(), 2);
1111
assert_eq!(extensions.get(0), Some("noop"));
12+
// The objectformat extension was added in 1.6
13+
assert_eq!(extensions.get(1), Some("objectformat"));
1214

1315
Ok(())
1416
}

tests/remove_extensions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use git2::Error;
66
#[test]
77
fn test_remove_extensions() -> Result<(), Error> {
88
unsafe {
9-
set_extensions(&["custom", "!ignore", "!noop", "other"])?;
9+
set_extensions(&["custom", "!ignore", "!noop", "!objectformat", "other"])?;
1010
}
1111

1212
let extensions = unsafe { get_extensions() }?;

0 commit comments

Comments
 (0)