Skip to content

Git integration does not correctly support includeIf directive  #40354

@motowilliams

Description

@motowilliams
  • VSCode Version: 1.19.0
  • OS Version:Windows10 (version 1709) OS Build 16299.125

Steps to Reproduce:

  1. Update user git configuration to have a includeIf block
[includeIf "gitdir:~/some/path/to/personal/"]
	path = .gitconfig-personal
[includeIf "gitdir:~/some/path/to/work/"]
	path = .gitconfig-work
  1. Create a sample git repo in either your person or work directories
  2. Make a change to a file in your sample repo
  3. Attempt to use VSCode git features to add file to index and commit the file to the local repo.
  4. You will get an error where the log show the following
Looking for git in: C:\Program Files\Git\cmd\git.exe
Using git 2.15.1.windows.2 from C:\Program Files\Git\cmd\git.exe
git rev-parse --show-toplevel
git config --get commit.template
git status -z -u
git symbolic-ref --short HEAD
git rev-parse master
git rev-parse --symbolic-full-name --abbrev-ref master@{u}
fatal: no upstream configured for branch 'master'

[...]

git for-each-ref --format %(refname) %(objectname)
git remote --verbose
git ls-tree -l HEAD -- c:\Users\eric\code\personal\test-redirect\test-httpsredirect.ps1
git show 8ddceeffd5268e6e86e0a0c4eb0562b1b7a5cdd8
git show HEAD:test-httpsredirect.ps1
git add -A -- c:\Users\eric\code\personal\test-redirect\test-httpsredirect.ps1
git status -z -u
git symbolic-ref --short HEAD
git rev-parse master
git rev-parse --symbolic-full-name --abbrev-ref master@{u}
fatal: no upstream configured for branch 'master'

git for-each-ref --format %(refname) %(objectname)
git remote --verbose
git show :test-httpsredirect.ps1
git commit --quiet --allow-empty-message --file -

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'eric@DESKTOP-7O2SA82.(none)')

git config --get-all user.name
git status -z -u
git show :test-httpsredirect.ps1
git symbolic-ref --short HEAD
git rev-parse master
git rev-parse --symbolic-full-name --abbrev-ref master@{u}
fatal: no upstream configured for branch 'master'

git for-each-ref --format %(refname) %(objectname)
git remote --verbose

Reproduces without extensions: Yes

This is NOT a Please tell me who you are issue as indicated by #36368. This feature works as expected with the git cli and well as Visual Studio Team Explorer where it was fixed in issue Team Explorer does not recognize git includeIf directive

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable buggitGIT issueshelp wantedIssues identified as good community contribution opportunities

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions