From 3d823d3f28087be51fe373124783eea4bcaa9a5a Mon Sep 17 00:00:00 2001 From: Dan Rollo Date: Fri, 17 May 2019 15:34:20 -0400 Subject: [PATCH 1/7] update submodule libgit2 new commit to fix 'Host header omits non-default port numbers' - #405 --- libgit2-sys/libgit2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libgit2-sys/libgit2 b/libgit2-sys/libgit2 index 771dfd1dd1..4ef2b889a4 160000 --- a/libgit2-sys/libgit2 +++ b/libgit2-sys/libgit2 @@ -1 +1 @@ -Subproject commit 771dfd1dd1c27a4693dfdfea521c07e72f456b29 +Subproject commit 4ef2b889a45496f2afc8df1c5570ffc90e650bfa From 764877b2526856dd238c1f19671598eba79c1f43 Mon Sep 17 00:00:00 2001 From: Dan Rollo Date: Tue, 21 May 2019 15:02:06 -0400 Subject: [PATCH 2/7] change constant GIT_DIFF_INDENT_HEURISTIC in lib.rs to match declaration in libgit2-sys/libgit2/include/git2/diff.h Thanks @ehuss --- libgit2-sys/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libgit2-sys/lib.rs b/libgit2-sys/lib.rs index b1c4bdf5eb..5311492ac8 100644 --- a/libgit2-sys/lib.rs +++ b/libgit2-sys/lib.rs @@ -1112,7 +1112,7 @@ pub const GIT_DIFF_SHOW_UNMODIFIED: git_diff_option_t = 1 << 26; pub const GIT_DIFF_PATIENCE: git_diff_option_t = 1 << 28; pub const GIT_DIFF_MINIMAL: git_diff_option_t = 1 << 29; pub const GIT_DIFF_SHOW_BINARY: git_diff_option_t = 1 << 30; -pub const GIT_DIFF_INDENT_HEURISTIC: git_diff_option_t = 1 << 31; +pub const GIT_DIFF_INDENT_HEURISTIC: git_diff_option_t = 1 << 18; #[repr(C)] pub struct git_diff_find_options { From d475dc9af726e5aa9e83dcdede89cde6532ac9bf Mon Sep 17 00:00:00 2001 From: Dan Rollo Date: Tue, 21 May 2019 16:38:03 -0400 Subject: [PATCH 3/7] attempt to fix seg fault in the `all` test. Thanks again @ehuss --- git2-curl/Cargo.toml | 1 + git2-curl/tests/all.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/git2-curl/Cargo.toml b/git2-curl/Cargo.toml index d90d8b79ab..cf734b93fa 100644 --- a/git2-curl/Cargo.toml +++ b/git2-curl/Cargo.toml @@ -23,6 +23,7 @@ civet = "0.11" conduit = "0.8" conduit-git-http-backend = "0.8" tempfile = "3.0" +libgit2-sys = { path = "../libgit2-sys"} [[test]] name = "all" diff --git a/git2-curl/tests/all.rs b/git2-curl/tests/all.rs index 941020e185..c14db1a268 100644 --- a/git2-curl/tests/all.rs +++ b/git2-curl/tests/all.rs @@ -15,6 +15,7 @@ const PORT: u16 = 7848; fn main() { unsafe { + libgit2_sys::init(); git2_curl::register(curl::easy::Easy::new()); } From 25383888cd832d142b0f272db4b3a4104d9af822 Mon Sep 17 00:00:00 2001 From: Dan Rollo Date: Wed, 22 May 2019 11:45:24 -0400 Subject: [PATCH 4/7] reorder constant location to match sequential values of existing constants --- libgit2-sys/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libgit2-sys/lib.rs b/libgit2-sys/lib.rs index 5311492ac8..7cb1ad055e 100644 --- a/libgit2-sys/lib.rs +++ b/libgit2-sys/lib.rs @@ -1102,6 +1102,7 @@ pub const GIT_DIFF_ENABLE_FAST_UNTRACKED_DIRS: git_diff_option_t = 1 << 14; pub const GIT_DIFF_UPDATE_INDEX: git_diff_option_t = 1 << 15; pub const GIT_DIFF_INCLUDE_UNREADABLE: git_diff_option_t = 1 << 16; pub const GIT_DIFF_INCLUDE_UNREADABLE_AS_UNTRACKED: git_diff_option_t = 1 << 17; +pub const GIT_DIFF_INDENT_HEURISTIC: git_diff_option_t = 1 << 18; pub const GIT_DIFF_FORCE_TEXT: git_diff_option_t = 1 << 20; pub const GIT_DIFF_FORCE_BINARY: git_diff_option_t = 1 << 21; pub const GIT_DIFF_IGNORE_WHITESPACE: git_diff_option_t = 1 << 22; @@ -1112,7 +1113,6 @@ pub const GIT_DIFF_SHOW_UNMODIFIED: git_diff_option_t = 1 << 26; pub const GIT_DIFF_PATIENCE: git_diff_option_t = 1 << 28; pub const GIT_DIFF_MINIMAL: git_diff_option_t = 1 << 29; pub const GIT_DIFF_SHOW_BINARY: git_diff_option_t = 1 << 30; -pub const GIT_DIFF_INDENT_HEURISTIC: git_diff_option_t = 1 << 18; #[repr(C)] pub struct git_diff_find_options { From 437e22e8512456df7575c572ddec5eb8f9419015 Mon Sep 17 00:00:00 2001 From: Dan Rollo Date: Wed, 22 May 2019 11:46:47 -0400 Subject: [PATCH 5/7] add version to dev dependency --- git2-curl/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git2-curl/Cargo.toml b/git2-curl/Cargo.toml index cf734b93fa..00cbebb36b 100644 --- a/git2-curl/Cargo.toml +++ b/git2-curl/Cargo.toml @@ -23,7 +23,7 @@ civet = "0.11" conduit = "0.8" conduit-git-http-backend = "0.8" tempfile = "3.0" -libgit2-sys = { path = "../libgit2-sys"} +libgit2-sys = { path = "../libgit2-sys", version = "0.7.11" } [[test]] name = "all" From 69334f85e3c963b06f3b5220042599585eec8503 Mon Sep 17 00:00:00 2001 From: Dan Rollo Date: Wed, 22 May 2019 12:10:48 -0400 Subject: [PATCH 6/7] move init call into `git2_curl::register` --- git2-curl/Cargo.toml | 2 +- git2-curl/src/lib.rs | 1 + git2-curl/tests/all.rs | 1 - 3 files changed, 2 insertions(+), 2 deletions(-) diff --git a/git2-curl/Cargo.toml b/git2-curl/Cargo.toml index 00cbebb36b..e9d75ea2b8 100644 --- a/git2-curl/Cargo.toml +++ b/git2-curl/Cargo.toml @@ -17,13 +17,13 @@ curl = "0.4" url = "1.0" log = "0.4" git2 = { path = "..", version = "0.8", default-features = false } +libgit2-sys = { path = "../libgit2-sys", version = "0.7.11" } [dev-dependencies] civet = "0.11" conduit = "0.8" conduit-git-http-backend = "0.8" tempfile = "3.0" -libgit2-sys = { path = "../libgit2-sys", version = "0.7.11" } [[test]] name = "all" diff --git a/git2-curl/src/lib.rs b/git2-curl/src/lib.rs index 90fe412b7f..a9ae589945 100644 --- a/git2-curl/src/lib.rs +++ b/git2-curl/src/lib.rs @@ -75,6 +75,7 @@ pub unsafe fn register(handle: Easy) { let handle = Arc::new(Mutex::new(handle)); let handle2 = handle.clone(); INIT.call_once(move || { + libgit2_sys::init(); git2::transport::register("http", move |remote| { factory(remote, handle.clone()) }).unwrap(); diff --git a/git2-curl/tests/all.rs b/git2-curl/tests/all.rs index c14db1a268..941020e185 100644 --- a/git2-curl/tests/all.rs +++ b/git2-curl/tests/all.rs @@ -15,7 +15,6 @@ const PORT: u16 = 7848; fn main() { unsafe { - libgit2_sys::init(); git2_curl::register(curl::easy::Easy::new()); } From 4b4a1be075f25cabe63c79716f631b7ff1eb581e Mon Sep 17 00:00:00 2001 From: Dan Rollo Date: Thu, 23 May 2019 11:05:59 -0400 Subject: [PATCH 7/7] move libgit2_sys::init() call to transport::register() --- git2-curl/Cargo.toml | 1 - git2-curl/src/lib.rs | 1 - src/transport.rs | 1 + 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/git2-curl/Cargo.toml b/git2-curl/Cargo.toml index e9d75ea2b8..d90d8b79ab 100644 --- a/git2-curl/Cargo.toml +++ b/git2-curl/Cargo.toml @@ -17,7 +17,6 @@ curl = "0.4" url = "1.0" log = "0.4" git2 = { path = "..", version = "0.8", default-features = false } -libgit2-sys = { path = "../libgit2-sys", version = "0.7.11" } [dev-dependencies] civet = "0.11" diff --git a/git2-curl/src/lib.rs b/git2-curl/src/lib.rs index a9ae589945..90fe412b7f 100644 --- a/git2-curl/src/lib.rs +++ b/git2-curl/src/lib.rs @@ -75,7 +75,6 @@ pub unsafe fn register(handle: Easy) { let handle = Arc::new(Mutex::new(handle)); let handle2 = handle.clone(); INIT.call_once(move || { - libgit2_sys::init(); git2::transport::register("http", move |remote| { factory(remote, handle.clone()) }).unwrap(); diff --git a/src/transport.rs b/src/transport.rs index d34db9f88b..4762c38ba5 100644 --- a/src/transport.rs +++ b/src/transport.rs @@ -107,6 +107,7 @@ struct RawSmartSubtransportStream { pub unsafe fn register(prefix: &str, factory: F) -> Result<(), Error> where F: Fn(&Remote) -> Result + Send + Sync + 'static { + libgit2_sys::init(); let mut data = Box::new(TransportData { factory: Box::new(factory), });