I've tried to dig where this GetFileInformationByHandle error is coming from this newFileStatFromGetFileInformationByHandle function. I did put a debugger in there was able to notice only one weird thing:
As you can see from the screenshot above chink folder is empty even though it seems all other files got populated. 🤔
Here is the stacktrace of the error just in case.
os.newFileStatFromGetFileInformationByHandle at types_windows.go:48
os.stat at stat_windows.go:119
os.lstatNolog at stat_windows.go:133
os.Lstat at stat.go:22
gopkg.in/src-d/go-billy.v4/osfs.(*OS).Lstat at os.go:115
gopkg.in/src-d/go-billy.v4/helper/polyfill.(*Polyfill).Lstat at polyfill.go:79
gopkg.in/src-d/go-billy.v4/helper/chroot.(*ChrootHelper).Lstat at chroot.go:160
gopkg.in/src-d/go-git%2ev4.(*Worktree).addIndexFromFile at worktree.go:596
gopkg.in/src-d/go-git%2ev4.(*Worktree).checkoutChangeRegularFile at worktree.go:510
gopkg.in/src-d/go-git%2ev4.(*Worktree).checkoutChange at worktree.go:401
gopkg.in/src-d/go-git%2ev4.(*Worktree).resetWorktree at worktree.go:365
gopkg.in/src-d/go-git%2ev4.(*Worktree).Reset at worktree.go:295
gopkg.in/src-d/go-git%2ev4.(*Repository).clone at repository.go:767
gopkg.in/src-d/go-git%2ev4.PlainCloneContext at repository.go:360
gopkg.in/src-d/go-git%2ev4.PlainClone at repository.go:336
github.com/fkorotkov/go-git-clone-windows-issue.clone at main.go:48
github.com/fkorotkov/go-git-clone-windows-issue.TestClone at main_test.go:9
testing.tRunner at testing.go:909
runtime.goexit at asm_amd64.s:1357
- Async stack trace
testing.(*T).Run at testing.go:960
At the moment I'm kind of in a dead end so will appreciate any help with the issue.
I'm hitting a particular issue when cloning a particular SHA of one of the repositories. This bug is reproducible only on Windows.
Here is a project to reproduce: https://github.com/fkorotkov/go-git-clone-windows-issue
Simply run
go test ./...
to get the following:I've tried to dig where this
GetFileInformationByHandle
error is coming from thisnewFileStatFromGetFileInformationByHandle
function. I did put a debugger in there was able to notice only one weird thing:As you can see from the screenshot above
chink
folder is empty even though it seems all other files got populated. 🤔Here is the stacktrace of the error just in case.
At the moment I'm kind of in a dead end so will appreciate any help with the issue.