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 {
fn from(_: Error) -> Self {
HttpResponseBuilder::new(StatusCode::BAD_GATEWAY).body("").into()
fn from(e: Error) -> Self {
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 repo = Repository {name : reponame, owner};
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 : Vec<(String, String)> = rootname.split("/").map_accum("/git/".to_string() + &ownername + "/" + &reponame + "/" + &commitname, |str_ref, b| {
let path = rootname.split("/").map_accum("/git/".to_string() + &repo.owner.name + "/" + &repo.name + "/" + commit.value(), |str_ref, b| {
let href = b + "/" + str_ref;
((str_ref.to_string(), href.clone()), href)
}).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)) {
// Ok(repo) => repo,
// Err(e) => panic!("failed to open: {}", e),