Skip to content

> ### What version of the IDE extension are you using? #17

Description

What version of the IDE extension are you using?

v26.616.30709

What subscription do you have?

Plus

Which IDE are you using?

VS Code

What platform is your computer?

Linux 7.0.12-arch1-1 x86_64 unknown

What issue are you seeing?

All of a sudden, git status showed every file in my repo as deleted in my index (not in my working tree), and showed a whole bunch of files I didn't recognize as added (to the index, not the working tree). I chose a unique looking path segment for one of them—catalyst-by-zoho—and ran find ~ -type d -name catalyst-by-zoho. That revealed it was under ~/.codex/.tmp/plugins. I'm assuming this path must be used by the Codex extension during updates, and in the updater, there must be bug when setting GIT_INDEX_FILE that uses the current repo path instead of the updater's temp path.

Luckily, this is relatively harmless. I fixed it by truncating my index file with : > .git/index and repopulating it from my (luckily uncorrupt) head commit with git read-tree @. But this is kinda scary, because a slightly different mistake could have wiped my whole repo!

A lot of people who might find themselves in this situation might have a hard time figuring out how to fix it. Most git operations that consult the index when it's in this state will fail due to the presence of unknown objects. For instance, the "obvious" fix would have been git reset --mixed, but that failed with "fatal: unable to read 03906ea96e7708504c5986a28f385754a34ccd7f".

What steps can reproduce the bug?

No idea. I hadn't even used the extension in the past week. I'm assuming the auto-updater did this.

What is the expected behavior?

Don't currupt my repo!

Additional information

No response

Originally posted by Huỳnh Thương (@Huynhthuongg) in microsoft/vscode#321986 (comment)

Metadata

Metadata

Labels

bugSomething isn't workingcodexdocumentationImprovements or additions to documentationenhancementNew feature or requestgood first issueGood for newcomers

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions