This commit is contained in:
Hubert 2021-07-18 14:01:04 +02:00
parent a3bf4afe51
commit 2278b46a88
2 changed files with 4 additions and 4 deletions

View File

@ -10,7 +10,7 @@ impl From<git2::Error> for Error {
} }
impl From<Error> for actix_web::error::Error { impl From<Error> for actix_web::error::Error {
fn from(_: Error) -> Self { fn from(e: Error) -> Self {
HttpResponseBuilder::new(StatusCode::BAD_GATEWAY).body("").into() HttpResponseBuilder::new(StatusCode::BAD_GATEWAY).body(e.0).into()
} }
} }

View File

@ -163,11 +163,11 @@ async fn git_main(
let owner = Owner { name : ownername}; let owner = Owner { name : ownername};
let repo = Repository {name : reponame, owner}; let repo = Repository {name : reponame, owner};
let user = User { name : "Hubert".to_string()}; let user = User { name : "Hubert".to_string()};
let gitrepo = GitRepo::new(format!("{}/{}/{}.git", &gitust.repo_root_path, &repo.owner.name, &repo.name).as_str())?; let path = rootname.split("/").map_accum("/git/".to_string() + &repo.owner.name + "/" + &repo.name + "/" + commit.value(), |str_ref, b| {
let path : Vec<(String, String)> = rootname.split("/").map_accum("/git/".to_string() + &ownername + "/" + &reponame + "/" + &commitname, |str_ref, b| {
let href = b + "/" + str_ref; let href = b + "/" + str_ref;
((str_ref.to_string(), href.clone()), href) ((str_ref.to_string(), href.clone()), href)
}).collect(); }).collect();
let gitrepo = GitRepo::new(format!("{}/{}/{}.git", &gitust.repo_root_path, &repo.owner.name, &repo.name).as_str())?;
// let repogit = match git2::Repository::open(format!("{}/{}/{}.git", &gitust.repo_root_path, &repo.owner.name, &repo.name)) { // let repogit = match git2::Repository::open(format!("{}/{}/{}.git", &gitust.repo_root_path, &repo.owner.name, &repo.name)) {
// Ok(repo) => repo, // Ok(repo) => repo,
// Err(e) => panic!("failed to open: {}", e), // Err(e) => panic!("failed to open: {}", e),