src/utils/blob.js
function fetch(repoState, driver, sha) {
    if (isFetched(repoState, sha)) {
        // No op if already fetched
        return Q(repoState);
    }

    const cache = repoState.getCache();
    // Fetch the blob
    return driver.fetchBlob(sha)
    // Then store it in the cache
    .then((blob) => {
        const newCache = CacheUtils.addBlob(cache, sha, blob);
        return repoState.set('cache', newCache);
    });
}
function fetch(repoState, driver, sha) {
    if (isFetched(repoState, sha)) {
        // No op if already fetched
        return Q(repoState);
    }

    const cache = repoState.getCache();
    // Fetch the blob
    return driver.fetchBlob(sha)
    // Then store it in the cache
    .then((blob) => {
        const newCache = CacheUtils.addBlob(cache, sha, blob);
        return repoState.set('cache', newCache);
    });
}
function fetch ( repoState , driver , sha ) { if ( isFetched ( repoState , sha ) ) { // No op if already fetched return Q ( repoState ) ; } const cache = repoState . getCache ( ) ; // Fetch the blob return driver . fetchBlob ( sha ) // Then store it in the cache . then ( ( blob ) => { const newCache = CacheUtils . addBlob ( cache , sha , blob ) ; return repoState . set ( 'cache' , newCache ) ; } ) ; }
Fetch a blob from SHA.
@param {RepositoryState} repoState
@param {Driver} driver
@param {SHA} sha
@return {Promise<RepositoryState>}
Fetch a blob from SHA .