Skip to content

Index corrupted after git status with Git 2.40.0 and 2.40.1 #4404

@stanio

Description

@stanio
  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options

git version 2.40.1.windows.1
cpu: x86_64
built from commit: ceee26d5cac05a3437097b43d034c4ad2e99d571
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

Microsoft Windows [Version 10.0.19045.2846]
  • What options did you set as part of the installation? Or did you choose the defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
> type "$env:USERPROFILE\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

Editor Option: VIM
Custom Editor Path:
Default Branch Option:
Path Option: Cmd
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: OpenSSL
CRLF Option: LFOnly
Bash Terminal Option: MinTTY
Git Pull Behavior Option: Merge
Use Credential Manager: Enabled
Performance Tweaks FSCache: Enabled
Enable Symlinks: Enabled
Enable Pseudo Console Support: Enabled
Enable FSMonitor: Disabled
  • Any other interesting things about your environment that might be related to the issue you're seeing?

I don't know what could be the cause but I'm observing this problem only on a particular laptop/Windows setup. I can't reproduce it on two other laptops (Windows 10 and Windows 11). I'm not observing the problem on the former laptop using Git for Windows 2.39.2, also – git reset . using that version appears to correct the previously (2.40.x) corrupted index (so I've reverted to it, for the time being). I'm consistently observing the problem after I upgrade to Git for Windows 2.40.x on that laptop.

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

I'm mainly using Git Bash in Windows Terminal, but I've tried it happens using CMD in Windows Terminal and in the legacy Console, and Git Bash in MinTTY.

~/work
$ git clone https://github.com/stanio/xbrz-java.git xbrz-java.test

~/work
$ cd xbrz-java.test

~/work/xbrz-java.test master ≡
$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

# The corruption has already happened at this stage
~/work/xbrz-java.test master ≡  -6
$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        deleted:    .gitignore
        deleted:    CODE_OF_CONDUCT.md
        deleted:    LICENSE.md
        deleted:    PUBLISHING.md
        deleted:    README.md
        deleted:    pom.xml

~/work/xbrz-java.test master ≡  -6
$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        deleted:    .gitignore
        deleted:    CODE_OF_CONDUCT.md
        deleted:    LICENSE.md
        deleted:    PUBLISHING.md
        deleted:    README.md
        deleted:    pom.xml

~/work/xbrz-java.test master ≡  -6
$ git reset .

~/work/xbrz-java.test master ≡  -6
$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        deleted:    .gitignore
        deleted:    CODE_OF_CONDUCT.md
        deleted:    LICENSE.md
        deleted:    PUBLISHING.md
        deleted:    README.md
        deleted:    pom.xml

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        .gitignore
        CODE_OF_CONDUCT.md
        LICENSE.md
        PUBLISHING.md
        README.md
        docs/
        pom.xml
        src/
        xbrz-awt/
        xbrz-core/
        xbrz-tool/
  • What did you expect to occur after running these commands?
$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
  • What actually happened instead?

(see the commands and their output, which I've given as "steps to reproduce")

  • If the problem was occurring with a specific repository, can you provide the URL to that repository to help us with testing?

Happens with all repositories I have checked out on that laptop. Here's .git snapshots from stanio/xbrz-java:

The original .git/index appears to get smaller (missing info?) and a .git/sharedindex.0000000000000000000000000000000000000000 appears.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions