Skip to content

Commit 8115fe5

Browse files
authored
Merge pull request #722 from dahlbyk/rkeithhill/do-not-create-home-env-var
Fix #718 do not create HOME env var
2 parents 2ad9463 + 869fff9 commit 8115fe5

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

src/posh-git.psm1

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
param([switch]$ForcePoshGitPrompt)
1+
param([bool]$ForcePoshGitPrompt)
22

33
. $PSScriptRoot\CheckRequirements.ps1 > $null
44

@@ -13,9 +13,6 @@ param([switch]$ForcePoshGitPrompt)
1313
. $PSScriptRoot\GitTabExpansion.ps1
1414
. $PSScriptRoot\TortoiseGit.ps1
1515

16-
if (!$Env:HOME) { $Env:HOME = "$Env:HOMEDRIVE$Env:HOMEPATH" }
17-
if (!$Env:HOME) { $Env:HOME = "$Env:USERPROFILE" }
18-
1916
$IsAdmin = Test-Administrator
2017

2118
# Get the default prompt definition.

test/DefaultPrompt.Tests.ps1

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Describe 'Default Prompt Tests - NO ANSI' {
1414

1515
Context 'Prompt with no Git summary' {
1616
It 'Returns the expected prompt string' {
17-
Set-Location $env:HOME -ErrorAction Stop
17+
Set-Location $HOME -ErrorAction Stop
1818
$res = [string](&$prompt *>&1)
1919
$res | Should BeExactly "$(Get-PromptConnectionInfo)$(GetHomePath)> "
2020
}
@@ -152,7 +152,7 @@ Describe 'Default Prompt Tests - ANSI' {
152152

153153
Context 'Prompt with no Git summary' {
154154
It 'Returns the expected prompt string' {
155-
Set-Location $env:HOME -ErrorAction Stop
155+
Set-Location $HOME -ErrorAction Stop
156156
$res = &$prompt
157157
$res | Should BeExactly "$(Get-PromptConnectionInfo)$(GetHomePath)> "
158158
}

0 commit comments

Comments
 (0)