Skip to content

Commit

Permalink
more fixes I guess
Browse files Browse the repository at this point in the history
  • Loading branch information
PearCoding committed Jun 19, 2024
1 parent 629cd1f commit 36c58ff
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions scripts/setup/utils.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,20 @@ function HandleGIT {
}
else {
Set-Location $Directory
& $GIT_BIN pull origin

# Check if it is a named ref and can be pulled
$ref = (& $GIT_BIN show-ref refs/remotes/origin/$Branch)
if (!([string]::IsNullOrEmpty($ref))) {
& $GIT_BIN checkout --quiet $Branch
& $GIT_BIN pull origin
} else {
& $GIT_BIN fetch --unshallow --quiet
& $GIT_BIN checkout --quiet $Branch
if ([string]::IsNullOrEmpty($ref)) {
$is_shallow = (& $GIT_BIN rev-parse --is-shallow-repository)
if ($is_shallow -eq "true") {
& $GIT_BIN fetch --unshallow --quiet
}
else {
& $GIT_BIN fetch --quiet
}
}
& $GIT_BIN checkout --quiet $Branch
}
}

Expand Down

0 comments on commit 36c58ff

Please sign in to comment.