Skip to content

Commit

Permalink
pshell 7.4 somehow caused git show to stop working. this update resol…
Browse files Browse the repository at this point in the history
…ves the problem (Azure#35033)

Co-authored-by: Scott Beddall (from Dev Box) <[email protected]>
  • Loading branch information
azure-sdk and scbedd authored Apr 2, 2024
1 parent 6a407d4 commit e65220d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions eng/common/scripts/Helpers/git-helpers.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,9 @@ class ConflictedFile {
# powershell ignores the newlines with and without --textconv, which results in a json file without original spacing.
# by forcefully reading into the array line by line, the whitespace is preserved. we're relying on gits autoconverstion of clrf to lf
# to ensure that the line endings are consistent.
Write-Host "git show $($this.LeftSource):$($this.Path)"
$tempContent = git show ("$($this.LeftSource):$($this.Path)")
$toShow = "$($this.LeftSource):$($this.Path)" -replace "\\", "/"
Write-Host "git show $toShow"
$tempContent = git show $toShow
return $tempContent -split "`r?`n"
}
else {
Expand All @@ -76,8 +77,9 @@ class ConflictedFile {

[array] Right(){
if ($this.IsConflicted) {
Write-Host "git show $($this.RightSource):$($this.Path)"
$tempContent = git show ("$($this.RightSource):$($this.Path)")
$toShow = "$($this.RightSource):$($this.Path)" -replace "\\", "/"
Write-Host "git show $toShow"
$tempContent = git show $toShow
return $tempContent -split "`r?`n"
}
else {
Expand Down

0 comments on commit e65220d

Please sign in to comment.