fluidattacks-core 0.1.5

Fluid Attacks Core Library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use std::path::Path;

use crate::git::cli;

/// Runs `git reset --hard`, removes symlinks, and returns whether it succeeded.
pub async fn reset_repo(repo_path: &str) -> bool {
    if cli::set_safe_directory().await.is_err() {
        return false;
    }
    if cli::reset_hard(repo_path).await.is_err() {
        return false;
    }
    if super::fs::remove_symlinks(Path::new(repo_path)).is_err() {
        return false;
    }
    true
}