Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

plumbing: fix err when adding a deleted directory; fixes #1485 #1479

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
Loading
from

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.

worktree_status.go Outdated Show resolved Hide resolved
worktree_status_test.go Outdated Show resolved Hide resolved
worktree_status_test.go Outdated Show resolved Hide resolved
worktree_status_test.go Outdated Show resolved Hide resolved
worktree_status_test.go Outdated Show resolved Hide resolved
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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.