pub fn git_create_backup() -> Result<(), Error> {
    let output = Command::new("git").arg("stash").arg("create").output()?;

    let stash_hash: String = String::from_utf8(output.stdout)?;

    let output = Command::new("git")
        .arg("stash")
        .arg("push") // store stash
        .arg("--quiet") // dont show output
        .arg("--message 'lint-staged auto backup'") // use provided message
        .arg(stash_hash) // pass stash hash in reflog
        .output()?;

    Ok(())
}
// NOTE: Create a stashed backup of the working directory
// 1. create an unlinked "floating" stash
// 2. store the floating stash under stash with recognizable name
Create a stashed backup of the working directory
1. create an unlinked "floating" stash
2. store the floating stash under stash with recognizable name
Create a stashed backup of the working directory 1 . create an unlinked " floating " stash 2 . store the floating stash under stash with recognizable name
pub fn git_create_backup() -> Result<(), Error> {
    let output = Command::new("git").arg("stash").arg("create").output()?;
    let stash_hash: String = String::from_utf8(output.stdout)?;
    let output = Command::new("git")
        .arg("stash")
        .arg("push") // store stash
        .arg("--quiet") // dont show output
        .arg("--message 'lint-staged auto backup'") // use provided message
        .arg(stash_hash) // pass stash hash in reflog
        .output()?;
    Ok(())
}
pub fn git_create_backup ( ) -> Result < ( ) , Error > { let output = Command :: new ( " " ) . arg ( " " ) . arg ( " " ) . output ( ) ? ; let stash_hash : String = String :: from_utf8 ( output . stdout ) ? ; let output = Command :: new ( " " ) . arg ( " " ) . arg ( " " ) // store stash . arg ( " " ) // dont show output . arg ( " " ) // use provided message . arg ( stash_hash ) // pass stash hash in reflog . output ( ) ? ; Ok ( ( ) ) }
NOTE: Create a stashed backup of the working directory
1. create an unlinked "floating" stash
2. store the floating stash under stash with recognizable name
NOTE : Create a stashed backup of the working directory 1 . create an unlinked " floating " stash 2 . store the floating stash under stash with recognizable name