     isSymbolicRef = treeSha1.indexOf(tree) != 0
 
     # Find out the file size
-    gitOutput(repo, 'cat-file', ['-s', "#{treeSha1}:#{pathname}"], (size) ->
+    cachingBlobSizeQuery(repo, treeSha1, pathname, (size) ->
       unless size?
         callback(null)
         return

# Spawns Git and returns the process
spawnGit = (repo, subcommand, args = []) ->
  # Run the subcommand pointed at the right repo

      callback(null)
  )

cachingBlobSizeQuery = (repo, treeSha1, pathname, callback) ->
  blobRef = "#{treeSha1}:#{pathname}"

  if blobSizeCache[blobRef]?
    # We have this size cached
    callback(blobSizeCache[blobRef])
  else
    # Ask Git for the blob size
    gitOutput(repo, 'cat-file', ['-s', blobRef], (size) ->
      if size?
        blobSizeCache[blobRef] = size

      callback(size)
    )

query = (repo, tree, pathname, callback) ->
  blobInfo = {}

