nl_tokens: Stat details about a file .
pl_tokens: function stat ( repoState , filepath ) { const workingState = repoState . getCurrentState ( ) ; // Lookup potential changes const change = workingState . getChanges ( ) . get ( filepath ) ; // Lookup file entry const treeEntry = workingState . getTreeEntries ( ) . get ( filepath ) ; // Determine SHA of the blob let blobSHA ; if ( change ) { blobSHA = change . getSha ( ) ; } else { blobSHA = treeEntry . getSha ( ) ; } // Get the blob from change or cache let blob ; if ( blobSHA ) { // Get content from cache blob = repoState . getCache ( ) . getBlob ( blobSHA ) ; } else { // No sha, so it must be in changes blob = <mask> . getContent ( ) ; } let fileSize ; if ( blob ) { fileSize = blob . getByteLength ( ) ; } else { // It might have been moved (but not fetched) const originalEntry = workingState . getTreeEntries ( ) . find ( ( entry ) => { return entry . getSha ( ) === blobSHA ; } ) ; fileSize = originalEntry . getBlobSize ( ) ; } return new File ( { type : FILETYPE . FILE , fileSize , path : filepath , content : blob } ) ; }