pub fn new() -> Result<GitStatus, GitError> {
        let output = match run_git_command(&["status", "--porcelain=v2", "-z", "--branch"]) {
            Err(output) => {
                let stderr: OsString = OsStringExt::from_vec(output.stderr);
                match GitError::from(stderr) {
                    GitError::UnknownError(_) => {
                        panic!("Couldn't list directory");
                    }
                    err => {
                        return Err(err);
                    }
                }
            }
            Ok(output) => output,
        };
        let outstr = output_to_string(&output);
        let info_iter = outstr.split_terminator('\0');
        let head = make_worktree_head(info_iter);
        let result = GitStatus { outstr, head };
        Ok(result)
    }
///Return an [GitStatus] for the current directory
Return an [GitStatus] for the current directory
Return an [ GitStatus ] for the current directory
pub fn new() -> Result<GitStatus, GitError> {
        let output = match run_git_command(&["status", "--porcelain=v2", "-z", "--branch"]) {
            Err(output) => {
                let stderr: OsString = OsStringExt::from_vec(output.stderr);
                match GitError::from(stderr) {
                    GitError::UnknownError(_) => {
                        panic!("Couldn't list directory");
                    }
                    err => {
                        return Err(err);
                    }
                }
            }
            Ok(output) => output,
        };
        let outstr = output_to_string(&output);
        let info_iter = outstr.split_terminator('\0');
        let head = make_worktree_head(info_iter);
        let result = GitStatus { outstr, head };
        Ok(result)
    }
pub fn new ( ) -> Result < GitStatus , GitError > { let output = match run_git_command ( & [ " " , " " , " " , " " ] ) { Err ( output ) => { let stderr : OsString = OsStringExt :: from_vec ( output . stderr ) ; match GitError :: from ( stderr ) { GitError :: UnknownError ( _ ) => { panic ! ( " " ) ; } err => { return Err ( err ) ; } } } Ok ( output ) => output , } ; let outstr = output_to_string ( & output ) ; let info_iter = outstr . split_terminator ( '\0' ) ; let head = make_worktree_head ( info_iter ) ; let result = GitStatus { outstr , head } ; Ok ( result ) }
Return an [GitStatus] for the current directory
Return an [ GitStatus ] for the current directory