Skip to content

Commit e65220d

Browse files
azure-sdkscbedd
andauthored
pshell 7.4 somehow caused git show to stop working. this update resolves the problem (#35033)
Co-authored-by: Scott Beddall (from Dev Box) <[email protected]>
1 parent 6a407d4 commit e65220d

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

eng/common/scripts/Helpers/git-helpers.ps1

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ class ConflictedFile {
6565
# powershell ignores the newlines with and without --textconv, which results in a json file without original spacing.
6666
# by forcefully reading into the array line by line, the whitespace is preserved. we're relying on gits autoconverstion of clrf to lf
6767
# to ensure that the line endings are consistent.
68-
Write-Host "git show $($this.LeftSource):$($this.Path)"
69-
$tempContent = git show ("$($this.LeftSource):$($this.Path)")
68+
$toShow = "$($this.LeftSource):$($this.Path)" -replace "\\", "/"
69+
Write-Host "git show $toShow"
70+
$tempContent = git show $toShow
7071
return $tempContent -split "`r?`n"
7172
}
7273
else {
@@ -76,8 +77,9 @@ class ConflictedFile {
7677

7778
[array] Right(){
7879
if ($this.IsConflicted) {
79-
Write-Host "git show $($this.RightSource):$($this.Path)"
80-
$tempContent = git show ("$($this.RightSource):$($this.Path)")
80+
$toShow = "$($this.RightSource):$($this.Path)" -replace "\\", "/"
81+
Write-Host "git show $toShow"
82+
$tempContent = git show $toShow
8183
return $tempContent -split "`r?`n"
8284
}
8385
else {

0 commit comments

Comments
 (0)