withfig/autocomplete

bug:Git branches suggestions still appear after being deleted

anelrh26 opened this issue · 3 comments

Checks

  • I have searched github.com/withfig/fig/issues and there are no duplicates of my issue
  • I have run fig doctor in the affected terminal session
  • I have run fig restart and replicated the issue again

Operating system

macOS 13.3.1 (22E772610a)

Expected behaviour

If a branch is deleted with git branch -D the branch name shouldn't appear in the suggestions when git checkout is typed

Actual behaviour

After deleting local branches with git branch -D, the branch names still appear in the suggestions when git checkout is typed

Steps to reproduce

  • delete a branch git branch -D <branch>
  • type git checkout.

Result
Fig suggestions sill shows the deleted branch

Environment

fig-details:
  - 2.16.0
hardware-info:
  - model:
  - model-id:
  - chip-id: Apple M1 Pro
  - cores: 10
  - mem: 16.00 GB
os-info:
  - macOS 13.3.1 (22E772610a)
environment:
  - shell: /bin/zsh
  - terminal: iterm
  - cwd: /Users/myUser/Personal/personal-project
  - exe-path: /usr/local/bin/fig
  - install-method: unknown
  - env-vars:
    - FIGTERM_SESSION_ID: ad47a211-fe62-485b-8e90-fa24fe589ab3
    - FIG_SET_PARENT_CHECK: 1
    - FIG_TERM: 2.16.0
    - PATH: /usr/local/opt/postgresql@13/bin:/Users/myUser/.asdf/shims:/usr/local/opt/asdf/libexec/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Users/myUser/.fig/bin:/Users/user/.local/bin
    - SHELL: /bin/zsh
    - TERM: xterm-256color
    - __CFBundleIdentifier: com.googlecode.iterm2
    - FIG_PID: 10452
    - FIG_SET_PARENT: ad47a211-fe62-485b-8e90-fa24fe589ab3

We cache the branch suggestions, this might be a better issue for https://github.com/withfig/autocomplete as the caching logic is stored in that repo.

i'll give this issue a try

after trying to reproduce this bug, here's what i've got:

  1. it doesn't happen with local branches
  2. if I push to the upstream and delete it directly there, it'll still suggest till you git fetch

shouldn't this be the expected behaviour?
cc. @grant0417