Repository: vscode
Issue: Git - Git does not show gutters unless file is opened from changed files tab
Labels: bug,git

Version: 1.42.0 (system setup)
Commit: ae08d5460b5a45169385ff3fd44208f431992451
Date: 2020-02-06T10:51:34.058Z
Electron: 6.1.6
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Windows_NT x64 10.0.18362

Steps to Reproduce:

1. The steps to reproduce are exactly the same as Bug# https://github.com/Microsoft/vscode/issues/41642. However, I haven't tried changing settings in settings.json file. I'm unable to paste GIFs here since that is against my company policy.

Expected result: gutters should be visible when a git tracked files has changes

Actual result: gutters are only visible when the file is opened the way it is depicted in #41642 

Does this issue occur when all extensions are disabled?: Yes (only gitlens was installed)

More info:  The log below is from GitLens, but I feel that the issue is VSCode Git itself. Thus, opening it here. Both gutters and line blames in gitlens start working as soon as I open the file from the changes tab by right clicking on Open File.

GitLens log:

> [2020-02-12 22:43:51:347] [251] GitService.getRepoPath
[2020-02-12 22:43:51:347] [252] GitService.getRepository
[2020-02-12 22:43:51:465] [c:/_repos/some_path] git ls-files -- foo/bar/lib/some_folder/some_file.rb • 116 ms 
[2020-02-12 22:43:51:465] [257] **GitService.isTracked returned false** • 116 ms
[2020-02-12 22:43:51:465] [252] GitService.getRepository returned undefined • 117 ms
[2020-02-12 22:43:51:562] [c:\_repos\some_path\foo\bar\lib\some_folder] git rev-parse --show-toplevel • 96 ms 
[2020-02-12 22:43:51:562] [251] GitService.getRepoPath returned c:/_repos/some_path • 214 ms
[2020-02-12 22:43:51:562] [259] GitService.getRepository
[2020-02-12 22:43:51:562] [259] GitService.getRepository returned c:/_repos/some_path • 0 ms
[2020-02-12 22:43:51:650] [c:/_repos/some_path] git ls-files -- c:\_repos\some_path\foo\bar\lib\some_folder\some_file.rb • 87 ms 
[2020-02-12 22:43:51:650] [25a] GitService.isTracked returned false • 87 ms
[2020-02-12 22:43:57:132] [272] GitService.isTracked returned false • 0 ms
[2020-02-12 22:43:57:909] [286] GitService.isTracked returned false • 0 ms
[2020-02-12 22:44:10:276] [2ae] GitService.getRepoPath
[2020-02-12 22:44:10:276] [2af] GitService.getRepository
<------------------ This is where I right clicked and selected Open File from the changes tab ----------------->
[2020-02-12 22:44:10:404] [c:/_repos/some_path] git ls-files -- foo/bar/lib/some_folder/some_file.rb • 126 ms 
[2020-02-12 22:44:10:404] [2b0] **GitService.isTracked returned true** • 126 ms
[2020-02-12 22:44:10:404] [2af] GitService.getRepository returned c:/_repos/some_path • 128 ms
[2020-02-12 22:44:10:404] [2ae] GitService.getRepoPath returned c:/_repos/some_path • 129 ms
[2020-02-12 22:44:10:405] [2b1] GitService.getRepository
[2020-02-12 22:44:10:405] [2b1] GitService.getRepository returned c:/_repos/some_path • 0 ms
[2020-02-12 22:44:10:504] [c:/_repos/some_path] git ls-files -- c:\_repos\some_path\foo\bar\lib\some_folder\some_file.rb • 98 ms 
[2020-02-12 22:44:10:504] [2b2] GitService.isTracked returned true • 99 ms
[2020-02-12 22:44:10:506] [2b3] GitService.getBlameForFile
[2020-02-12 22:44:10:509] [2b4] GitService.isTracked returned true • 0 ms
[2020-02-12 22:44:10:531] [2b5] GitService.getBlameForLine
[2020-02-12 22:44:10:531] [2b6] GitService.getBlameForFile
[2020-02-12 22:44:10:622] [c:/_repos/some_path] git blame --root --incremental -- foo/bar/lib/some_folder/some_file.rb • 112 ms 
[2020-02-12 22:44:10:623] [2b7] GitService.getCurrentUser
[2020-02-12 22:44:10:623] [2b7] GitService.getCurrentUser completed • 0 ms
[2020-02-12 22:44:10:628] [2b3] GitService.getBlameForFile completed • 122 ms
[2020-02-12 22:44:10:628] [2b6] GitService.getBlameForFile completed • 96 ms
[2020-02-12 22:44:10:628] GitCodeLensProvider.provideCodeLenses: — 54 symbol(s) found
[2020-02-12 22:44:10:632] [2b5] GitService.getBlameForLine completed • 101 ms
[2020-02-12 22:44:14:796] [2c2] GitService.getBlameForLine
[2020-02-12 22:44:14:796] [2c3] GitService.getBlameForFile
[2020-02-12 22:44:14:797] [2c3] GitService.getBlameForFile completed • 0 ms
[2020-02-12 22:44:14:797] [2c2] GitService.getBlameForLine completed • 0 ms

My git config:

> diff.astextplain.textconv=astextplain
> filter.lfs.clean=git-lfs clean -- %f
> filter.lfs.smudge=git-lfs smudge -- %f
> filter.lfs.process=git-lfs filter-process
> filter.lfs.required=true
> http.sslbackend=openssl
> http.sslcainfo=C:/Program Files/Git/mingw64/ssl/certs/ca-bundle.crt
> core.autocrlf=false
> core.fscache=true
> core.symlinks=false
> core.editor="C:\\Program Files\\Microsoft VS Code\\Code.exe" --wait
> credential.helper=manager