git-porcelain-status.js
function gitPorcelainStatus() {
  return git('status --porcelain -b', stdout => {
    const status = gitUtil.extractStatus(stdout);
    let parsedStatus = Object.values(status.index).concat(Object.values(status.workingTree));

    // Flattened
    parsedStatus = parsedStatus.reduce((a, b) => a.concat(b), []);

    return {
      status,
      currentBranch: status.branch.split('...')[0],
      clean: parsedStatus.length === 0
    };
  });
}
function gitPorcelainStatus() {
  return git('status --porcelain -b', stdout => {
    const status = gitUtil.extractStatus(stdout);
    let parsedStatus = Object.values(status.index).concat(Object.values(status.workingTree));

    // Flattened
    parsedStatus = parsedStatus.reduce((a, b) => a.concat(b), []);

    return {
      status,
      currentBranch: status.branch.split('...')[0],
      clean: parsedStatus.length === 0
    };
  });
}
function gitPorcelainStatus ( ) { return git ( 'status --porcelain -b' , stdout => { const status = gitUtil . extractStatus ( stdout ) ; let parsedStatus = Object . values ( status . index ) . concat ( Object . values ( status . workingTree ) ) ; // Flattened parsedStatus = parsedStatus . reduce ( ( a , b ) => a . concat ( b ) , [ ] ) ; return { status , currentBranch : status . branch . split ( '...' ) [ 0 ] , clean : parsedStatus . length === 0 } ; } ) ; }
Verify the status of the repository.
@return {object}     Current branch and the status of hte repository.
Verify the status of the repository .