gps 7.3.3

Official CLI & library for Git Patch Stack
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use super::super::private;
use super::super::private::git;

#[derive(Debug)]
pub enum CheckoutError {
    OpenRepositoryFailed(git::CreateCwdRepositoryError),
    CheckoutOperationFailed(private::checkout::CheckoutError),
}

pub fn checkout(patch_index: usize) -> Result<(), CheckoutError> {
    let repo = git::create_cwd_repo().map_err(CheckoutError::OpenRepositoryFailed)?;
    private::checkout::checkout(&repo, patch_index)
        .map_err(CheckoutError::CheckoutOperationFailed)?;
    Ok(())
}