Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions app/src/main/rust/src/libgit2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,17 @@ pub fn init_lib(home_path: String) {
error!("gitconfig: {e}");
}
}

unsafe {
libgit2_sys::git_libgit2_opts(
libgit2_sys::GIT_OPT_SET_SERVER_CONNECT_TIMEOUT as std::ffi::c_int,
7000,
);
libgit2_sys::git_libgit2_opts(
libgit2_sys::GIT_OPT_SET_SERVER_TIMEOUT as std::ffi::c_int,
7000,
);
};
}

pub fn create_repo(repo_path: &str) -> Result<(), Error> {
Expand Down Expand Up @@ -241,6 +252,7 @@ pub fn commit_all(name: &str, email: &str, message: &str) -> Result<(), Error> {

pub fn push(cred: Option<Cred>) -> Result<(), Error> {
apply_ssh_workaround(false);

let repo = REPO.lock().expect("repo lock");
let repo = repo.as_ref().expect("repo");

Expand Down Expand Up @@ -272,6 +284,7 @@ pub fn push(cred: Option<Cred>) -> Result<(), Error> {

pub fn pull(cred: Option<Cred>, author: &GitAuthor) -> Result<(), Error> {
apply_ssh_workaround(false);

let repo = REPO.lock().expect("repo lock");
let repo = repo.as_ref().expect("repo");

Expand Down