-
-
Notifications
You must be signed in to change notification settings - Fork 318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Oxidize comtrya
#1321
Comments
Scratch that, let me try and implement this again and see what happens. |
Hi @Byron, I've updated GitSync to (which Comtrya uses) to use this for fn clone_repository(&self) -> Result<(), errors::GitSyncError> {
info!("Attempting to clone {} to {:?}", self.repo, self.dir,);
unsafe {
match gix::interrupt::init_handler(1, || {}) {
Ok(_) => (),
Err(error) => {
return Err(GitSyncError::GenericError { error });
}
};
}
if !self.dir.exists() {
match std::fs::create_dir_all(&self.dir) {
Ok(_) => {}
Err(error) => {
return Err(GitSyncError::GenericError { error });
}
}
}
let url = match gix::url::parse(self.repo.as_str().into()) {
Ok(url) => url,
Err(error) => {
return Err(GitSyncError::GixParseError { error });
}
};
let mut prepare_clone = match gix::prepare_clone(url, &self.dir) {
Ok(prepared_fetch) => prepared_fetch,
Err(error) => {
return Err(GitSyncError::GixCloneError { error });
}
};
let (mut prepare_checkout, _) = match prepare_clone
.fetch_then_checkout(gix::progress::Discard, &gix::interrupt::IS_INTERRUPTED)
{
Ok(checkout) => checkout,
Err(error) => {
return Err(GitSyncError::GixCloneFetchError { error });
}
};
match prepare_checkout
.main_worktree(gix::progress::Discard, &gix::interrupt::IS_INTERRUPTED)
{
Ok(repository) => repository,
Err(error) => {
return Err(GitSyncError::GixCloneCheckoutError { error });
}
};
Ok(())
} and this works well. We also have a I've also tried just using Any advice? |
Draft PR |
Thanks for trying it out!
Is the question-mark operation
One cannot yet checkout into an existing repository, and I'd hope it refuses to do so into an existing non-empty directory as it would bluntly overwrite everything. It's only possible to checkout the initial clone. It will take a while until |
Required Features
See the sibling issue in comtrya/comtrya#347
The text was updated successfully, but these errors were encountered: