Skip to main content

fluidattacks_core/git/
ops.rs

1use std::path::Path;
2
3use crate::git::cli;
4
5/// Runs `git reset --hard`, removes symlinks, and returns whether it succeeded.
6pub async fn reset_repo(repo_path: &str) -> bool {
7    if cli::set_safe_directory().await.is_err() {
8        return false;
9    }
10    if cli::reset_hard(repo_path).await.is_err() {
11        return false;
12    }
13    if crate::fs::remove_symlinks(Path::new(repo_path)).is_err() {
14        return false;
15    }
16    true
17}