chore: address clippy lint
This commit is contained in:
parent
7675a2c782
commit
69b3ef7d59
1 changed files with 15 additions and 7 deletions
18
src/page.rs
18
src/page.rs
|
@ -28,14 +28,22 @@ pub struct Page {
|
|||
|
||||
impl Page {
|
||||
pub fn create_repo(&self) -> Repository {
|
||||
let repo = Repository::open(&self.path);
|
||||
|
||||
let repo = if repo.is_err() {
|
||||
let repo = match Repository::open(&self.path) {
|
||||
Ok(repo) => repo,
|
||||
Err(e) => {
|
||||
log::error!("Opening repo {} caused error {}", &self.path, e);
|
||||
info!("Cloning repository {} at {}", self.repo, self.path);
|
||||
Repository::clone(&self.repo, &self.path).unwrap()
|
||||
} else {
|
||||
repo.unwrap()
|
||||
}
|
||||
};
|
||||
//let repo = Repository::open(&self.path);
|
||||
|
||||
//let repo = if repo.is_err() {
|
||||
// info!("Cloning repository {} at {}", self.repo, self.path);
|
||||
// Repository::clone(&self.repo, &self.path).unwrap()
|
||||
//} else {
|
||||
// repo.unwrap()
|
||||
//};
|
||||
// let branch = repo.find_branch(&self.branch, BranchType::Local).unwrap();
|
||||
|
||||
//repo.branches(BranchType::Local).unwrap().find(|b| b.unwrap().na
|
||||
|
|
Loading…
Add table
Reference in a new issue