code refactor & sync bugfixes
This commit is contained in:
parent
2bcb47076a
commit
9edcc9841b
20 changed files with 820 additions and 812 deletions
|
|
@ -414,11 +414,16 @@ function createPusher(api) {
|
|||
if (!plan.data || !plan.data.ok) throw new Error((plan.data && plan.data.error) || `http-${plan.status}`)
|
||||
const upload = new Set(plan.data.upload || [])
|
||||
const same = new Set(plan.data.same || [])
|
||||
// per category every manifest entry counts: created/overwritten vs
|
||||
// already identical (the plan reports both)
|
||||
bucket.copied += entries.length - same.size
|
||||
bucket.skipped += same.size
|
||||
summary.skipped += same.size
|
||||
// per category the FILES count: created/overwritten vs already
|
||||
// identical (the plan reports both; dirs and links are re-ensured
|
||||
// for free and are not files that moved)
|
||||
const fileEntries = entries.filter(e => e.type === 'file')
|
||||
const filePaths = new Set(fileEntries.map(e => e.path))
|
||||
let sameFiles = 0
|
||||
for (const p of same) if (filePaths.has(p)) sameFiles++
|
||||
bucket.copied += fileEntries.length - sameFiles
|
||||
bucket.skipped += sameFiles
|
||||
summary.skipped += sameFiles
|
||||
const pending = []
|
||||
for (const entry of entries) {
|
||||
if (entry.type !== 'file') continue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue