githistory: only download non-cached files
When scanning a tree for pointers, don't download files that already exist in the cache
This commit is contained in:
parent
159c5fa2e3
commit
3ab80db213
@ -387,7 +387,11 @@ func (r *Rewriter) scanTree(q *tq.TransferQueue, gf *lfs.GitFilter, treeOID []by
|
||||
return err
|
||||
}
|
||||
|
||||
q.Add(entry.Name, downloadPath, ptr.Oid, ptr.Size)
|
||||
// Only add files to the transfer queue that aren't already cached
|
||||
if _, err := os.Stat(downloadPath); os.IsNotExist(err) {
|
||||
q.Add(entry.Name, downloadPath, ptr.Oid, ptr.Size)
|
||||
}
|
||||
|
||||
case odb.TreeObjectType:
|
||||
// Scan all subtrees
|
||||
err = r.scanTree(q, gf, entry.Oid, fullpath)
|
||||
|
Loading…
Reference in New Issue
Block a user