scm shim: handle edge case
scm shim: handle edge case

Since #4748 `HOMEBREW_GIT` is set by the `brew.sh`, whose value is default to be `git`.
As a result, it completely bypasses the logic of the shims/scm/git.

This fixes the issue by checking whether `HOMEBREW_GIT` and
`HOMEBREW_SVN` are set to be `git` and `svn` respectively.

Fixes #4825.

DomT4/brew,konqui/brew,reitermarkus/brew,Homebrew/brew,MikeMcQuaid/brew,JCount/brew,claui/brew,maxim-belkin/brew,claui/brew,MikeMcQuaid/brew,mahori/brew,vitorgalvao/brew,Linuxbrew/brew,nandub/brew,DomT4/brew,MikeMcQuaid/brew,Linuxbrew/brew,EricFromCanada/brew,JCount/brew,vitorgalvao/brew,Linuxbrew/brew,sjackman/homebrew,DomT4/brew,konqui/brew,sjackman/homebrew,reitermarkus/brew,nandub/brew,nandub/brew,reitermarkus/brew,JCount/brew,sjackman/homebrew,sjackman/homebrew,reitermarkus/brew,Homebrew/brew,claui/brew,konqui/brew,JCount/brew,konqui/brew,EricFromCanada/brew,mahori/brew,DomT4/brew,mahori/brew,maxim-belkin/brew,Linuxbrew/brew,claui/brew,EricFromCanada/brew,vitorgalvao/brew,EricFromCanada/brew,mahori/brew,Homebrew/brew,MikeMcQuaid/brew,maxim-belkin/brew,vitorgalvao/brew,nandub/brew,Homebrew/brew