Update to git2-0.19

Update the `git2` dependencies to `0.19`, which also allows the uncommenting of
two tests in the `diff` test suite -- as reported by [issue #149][#149].

[#149]: https://github.com/radicle-dev/radicle-git/issues/149

Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
X-Clacks-Overhead: GNU Terry Pratchett
This commit is contained in:
Fintan Halpenny
2024-06-28 12:08:44 +01:00
parent 0dd1383ed6
commit 224ad08366
8 changed files with 48 additions and 50 deletions
Generated
+4 -4
View File
@@ -316,9 +316,9 @@ dependencies = [
[[package]]
name = "git2"
version = "0.18.2"
version = "0.19.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1b3ba52851e73b46a4c3df1d89343741112003f0f6f13beb0dfac9e457c3fdcd"
checksum = "b903b73e45dc0c6c596f2d37eccece7c1c8bb6e4407b001096387c63d0d93724"
dependencies = [
"bitflags 2.4.2",
"libc",
@@ -385,9 +385,9 @@ checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd"
[[package]]
name = "libgit2-sys"
version = "0.16.2+1.7.2"
version = "0.17.0+1.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ee4126d8b4ee5c9d9ea891dd875cfdc1e9d0950437179104b183d7d8a74d24e8"
checksum = "10472326a8a6477c3c20a64547b0059e4b0d086869eee31e6d7da728a8eb7224"
dependencies = [
"cc",
"libc",
+1 -1
View File
@@ -13,7 +13,7 @@ thiserror = "1"
either = "1.8.0"
[dependencies.git2]
version = "0.18.1"
version = "0.19"
default-features = false
features = ["vendored-libgit2"]
+1 -1
View File
@@ -21,7 +21,7 @@ proptest = "1"
path = ".."
[dependencies.git2]
version = "0.18.1"
version = "0.19"
default-features = false
features = ["vendored-libgit2"]
+1 -1
View File
@@ -26,7 +26,7 @@ percent-encoding = "2"
thiserror = "1"
[dependencies.git2]
version = "0.18.1"
version = "0.19"
default-features = false
features = ["vendored-libgit2"]
+1 -1
View File
@@ -24,7 +24,7 @@ serde = "1"
serde_json = "1"
[dependencies.git2]
version = "0.18.1"
version = "0.19"
default-features = false
features = ["vendored-libgit2"]
+1 -1
View File
@@ -36,7 +36,7 @@ thiserror = "1.0"
url = "2.5"
[dependencies.git2]
version = "0.18.1"
version = "0.19"
default-features = false
features = ["vendored-libgit2"]
+1 -1
View File
@@ -20,7 +20,7 @@ serde_json = "1"
url = "2.5"
[dev-dependencies.git2]
version = "0.18.1"
version = "0.19"
default-features = false
features = ["vendored-libgit2"]
+38 -40
View File
@@ -630,44 +630,42 @@ index f89e4c0..7c56eb7 100644
);
}
// TODO(xphoniex): uncomment once libgit2 has fixed the bug
//#[test]
//fn test_old_missing_eof_newline() {
// let buf = r#"
//diff --git a/.env b/.env
//index f89e4c0..7c56eb7 100644
//--- a/.env
//+++ b/.env
//@@ -1 +1 @@
//-hello=123
//\ No newline at end of file
//+hello=1234
//"#;
// let diff = git2::Diff::from_buffer(buf.as_bytes()).unwrap();
// let diff = Diff::try_from(diff).unwrap();
// assert_eq!(
// diff.modified().next().unwrap().diff.eof(),
// Some(EofNewLine::OldMissing)
// );
//}
#[test]
fn test_old_missing_eof_newline() {
let buf = r#"
diff --git a/.env b/.env
index f89e4c0..7c56eb7 100644
--- a/.env
+++ b/.env
@@ -1 +1 @@
-hello=123
\ No newline at end of file
+hello=1234
"#;
let diff = git2::Diff::from_buffer(buf.as_bytes()).unwrap();
let diff = Diff::try_from(diff).unwrap();
assert_eq!(
diff.modified().next().unwrap().diff.eof(),
Some(EofNewLine::OldMissing)
);
}
// TODO(xphoniex): uncomment once libgit2 has fixed the bug
//#[test]
//fn test_new_missing_eof_newline() {
// let buf = r#"
//diff --git a/.env b/.env
//index f89e4c0..7c56eb7 100644
//--- a/.env
//+++ b/.env
//@@ -1 +1 @@
//-hello=123
//+hello=1234
//\ No newline at end of file
//"#;
// let diff = git2::Diff::from_buffer(buf.as_bytes()).unwrap();
// let diff = Diff::try_from(diff).unwrap();
// assert_eq!(
// diff.modified().next().unwrap().diff.eof(),
// Some(EofNewLine::NewMissing)
// );
//}
#[test]
fn test_new_missing_eof_newline() {
let buf = r#"
diff --git a/.env b/.env
index f89e4c0..7c56eb7 100644
--- a/.env
+++ b/.env
@@ -1 +1 @@
-hello=123
+hello=1234
\ No newline at end of file
"#;
let diff = git2::Diff::from_buffer(buf.as_bytes()).unwrap();
let diff = Diff::try_from(diff).unwrap();
assert_eq!(
diff.modified().next().unwrap().diff.eof(),
Some(EofNewLine::NewMissing)
);
}