From 44e858386cb13fc249fc029319659e6c6ae503b5 Mon Sep 17 00:00:00 2001 From: Duncan Smart Date: Fri, 10 Nov 2017 16:05:29 +0000 Subject: [PATCH] Directory names that contain [brackets] cause GitPrompt to fail Using `Get-Item -LiteralPath` means that "[brackets]" don't get interpreted as wildcards. --- src/GitUtils.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/GitUtils.ps1 b/src/GitUtils.ps1 index 3824a6d95..fb27a39e6 100644 --- a/src/GitUtils.ps1 +++ b/src/GitUtils.ps1 @@ -24,7 +24,7 @@ function Get-GitDirectory { $Env:GIT_DIR -replace '\\|/', [System.IO.Path]::DirectorySeparatorChar } else { - $currentDir = Get-Item $pathInfo -Force + $currentDir = Get-Item -LiteralPath $pathInfo -Force while ($currentDir) { $gitDirPath = Join-Path $currentDir.FullName .git if (Test-Path -LiteralPath $gitDirPath -PathType Container) {