Skip to content

Commit 6b6ebbf

Browse files
author
마누엘
committed
git-extra: add git-prompt check to bash.bashrc
If `bash` is called without the `--login` function, the `git-prompt.sh` in the `profile.d` directory will not get sourced. Lets fix this behavior by explicitly checking if this bash instance was called without the `--login` argument and if so call the `git-prompt.sh`. This fixes git-for-windows/git#290 Signed-off-by: 마누엘 <[email protected]>
1 parent 0b3037c commit 6b6ebbf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

git-extra/git-extra.install.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ GITCONFIG
2525
! grep -q '^PS1=' /etc/bash.bashrc ||
2626
sed -i 's/^PS1=/#&/' /etc/bash.bashrc
2727

28+
grep -q '^# Fixup git-bash in non login env' /etc/bash.bashrc ||
29+
printf "\n# Fixup git-bash in non login env\nshopt -q login_shell || . /etc/profile.d/git-prompt.sh\n" >> /etc/bash.bashrc
30+
2831
grep -q git-for-windows etc/pacman.conf ||
2932
sed -i -e '/^\[mingw32\]/i[git-for-windows]\nServer = https://dl.bintray.com/$repo/pacman/$arch\nSigLevel = Optional\n' etc/pacman.conf
3033

0 commit comments

Comments
 (0)