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 add tries to add already added (renamed/moved) file #173

Closed
eblis opened this issue May 22, 2023 · 2 comments
Closed

Git add tries to add already added (renamed/moved) file #173

eblis opened this issue May 22, 2023 · 2 comments
Labels

Comments

@eblis
Copy link

eblis commented May 22, 2023

I used git mv to move some files to an old folder.
Current git status looks like this:

On branch feature/new-certificates-2023
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        renamed:    certs/va_proc_8.crt -> certs/old/va_proc_8.crt
        renamed:    certs/va_proc_8.pem -> certs/old/va_proc_8.pem
        new file:   certs/va_proc_9.crt

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   certs/something.biz.crt
        modified:   certs/something.biz.key

If I type git add and then tab to see the suggestions i get this:
image
From what I can see it's detecting the renamed file and it suggesting it, but it's suggesting the whole text, so <old file> -> <new file> instead of suggesting just <new file>

@chrisant996
Copy link
Collaborator

Thanks for reporting this. I see two problems, in fact:

  1. It's not handling the git porcelain output correctly for the R action (rename).
  2. It shouldn't be listing staged files in the first place.

I think the second problem is the real problem here; the R action can't even happen unless a file is staged.

@chrisant996
Copy link
Collaborator

Should be fixed now. Thanks again!

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

No branches or pull requests

2 participants