Skip to content

Commit 4b4a1be

Browse files
committed
move libgit2_sys::init() call to transport::register()
1 parent 69334f8 commit 4b4a1be

File tree

3 files changed

+1
-2
lines changed

3 files changed

+1
-2
lines changed

git2-curl/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ curl = "0.4"
1717
url = "1.0"
1818
log = "0.4"
1919
git2 = { path = "..", version = "0.8", default-features = false }
20-
libgit2-sys = { path = "../libgit2-sys", version = "0.7.11" }
2120

2221
[dev-dependencies]
2322
civet = "0.11"

git2-curl/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ pub unsafe fn register(handle: Easy) {
7575
let handle = Arc::new(Mutex::new(handle));
7676
let handle2 = handle.clone();
7777
INIT.call_once(move || {
78-
libgit2_sys::init();
7978
git2::transport::register("http", move |remote| {
8079
factory(remote, handle.clone())
8180
}).unwrap();

src/transport.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ struct RawSmartSubtransportStream {
107107
pub unsafe fn register<F>(prefix: &str, factory: F) -> Result<(), Error>
108108
where F: Fn(&Remote) -> Result<Transport, Error> + Send + Sync + 'static
109109
{
110+
libgit2_sys::init();
110111
let mut data = Box::new(TransportData {
111112
factory: Box::new(factory),
112113
});

0 commit comments

Comments
 (0)