justjanne / powerline-go

A beautiful and useful low-latency prompt for your shell, written in go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

global .config/git/ignore not working in git-bash (windows)

vgropp opened this issue · comments

Describe the bug
Using a global gitignores in .config/git/ignore, or in ~/.gitconfig excludesfile=... does not work.

To Reproduce
Steps to reproduce the behavior:

  1. create a global gitignore with foobar in it
  2. create foobar in workspace
  3. git status --proclain does not show the file, but powerline-go shows a change

Expected behavior
powerline-go git status and git status --porcelain should match

Environment (please complete the following information):

  • OS: windows
  • Architecture: intel
  • Shell: git-bash

Additional context
I could narrow it down to setting the env to the git cmd in

command.Env = gitProcessEnv
, when removing this line it works as expected.

Whats the reason to use this stripped down environment for the git cmd?

"HOME" is not set in windows, its "USERPROFILE",

func homePath() string {
env := "HOME"
if runtime.GOOS == "windows" {
env = "USERPROFILE"
}
return os.Getenv(env)
}
handles this issue