The origin of the problem is obscure, I’ve also found similar issues reported in the IDF repo [1, 2]. Some mentions of similar problem have been reported in our community as well.
Could you please share here D:/IOT-WORK/Blink/.pio/build/esp32doit-devkit-v1/CMakeFiles/git-data/grabRef.cmake
? My suspicion is that there is a conflict with other Git repository somewhere on the path to your project.