Skip to content
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

git branch -d doesn't seem to delete branch/worktree from git cache #5

Open
lu0 opened this issue Oct 5, 2022 · 1 comment
Open
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@lu0
Copy link
Owner

lu0 commented Oct 5, 2022

Describe the bug
Title

To Reproduce
Steps to reproduce the behavior:

  1. Run git branch -d old_branch or git branch -D old_branch from git root or from the worktree directory.
  2. This doesn't seem to delete the branch and worktree from the git cache, doing git checkout old_branch re-creates the worktree directory with the files of the 'deleted' branch.

Expected behavior
git checkout old_branch should raise an error after such branch has been deleted.

Screenshots
N/A

Desktop (please complete the following information):

  • OS: Linux Mint 20, but tested on Windows 10 and Windows 11, too.
  • Git version: 2.25.1
  • Shell: Bash 5.0.16
  • Repository version: v1.1.0

Additional context
git branch -d/-D old_branch does indeed delete the worktree directory, but it's kept in the cache.

@lu0 lu0 added the bug Something isn't working label Oct 5, 2022
@lu0 lu0 self-assigned this Oct 5, 2022
@lu0
Copy link
Owner Author

lu0 commented Jan 15, 2023

Expected behavior

git checkout old_branch should raise an error after such branch has been deleted.

It does tho?

image

Can't reproduce on a clean, recently-cloned, bare repo. Need to test this thoroughly on another one.

@lu0 lu0 added the question Further information is requested label Jan 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant