Skip to content

Conversation

zjs1012
Copy link

@zjs1012 zjs1012 commented Mar 31, 2025

When adding a deleted directory, an "entry not found" error is reported.
This modification can avoid errors and correctly add the files in the directory to the temporary storage.

@zjs1012 zjs1012 closed this Apr 1, 2025
@zjs1012 zjs1012 reopened this Apr 1, 2025
@zjs1012 zjs1012 changed the title plumbing: fix err when adding a deleted directory plumbing: fix err when adding a deleted directory; fixed #1485 Apr 3, 2025
@zjs1012 zjs1012 changed the title plumbing: fix err when adding a deleted directory; fixed #1485 plumbing: fix err when adding a deleted directory; fixes #1485 Apr 3, 2025
Copy link
Member

@pjbgf pjbgf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zjs1012 thanks for looking into this. Here's a few nits, but otherwise LGTM.

if strings.HasPrefix(e.Name, path) {
idx.Entries = append(idx.Entries[:index], idx.Entries[index+1:]...)
count++
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zjs1012 do we need to go through the entire index? Can't we just short-circuit once we find it?

Suggested change
}
break
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants