Skip to content

Commit

Permalink
Always checkout to 'master'
Browse files Browse the repository at this point in the history
  • Loading branch information
leojonathanoh committed Sep 27, 2023
1 parent 9bcda8e commit 7998b78
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions Generate-GitBranches.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -129,14 +129,15 @@ try {
foreach ($g in $games) {
$branch = "$( $g['game_platform'] )-$( $g['game_engine'] )-$( $g['game'] )"

if ($isSameRepo) {
{ git checkout -f master } | Execute-Command
if ($Pull) {
{ git pull origin master } | Execute-Command
}
}else {
{ git rev-parse --verify master } | Execute-Command -ErrorAction SilentlyContinue
if ($LASTEXITCODE) { throw "No 'master' branch in the target repo: $TargetRepo. Create it using: git commit --allow-empty -m 'Init'" }
try {
{ git rev-parse --verify master } | Execute-Command
}catch {
throw "No 'master' branch in the target repo: $TargetRepo. Create it using: git commit --allow-empty -m 'Init'"
}

{ git checkout -f master } | Execute-Command
if ($Pull) {
{ git pull origin master } | Execute-Command
}
$existingBranch = { git rev-parse --verify $branch 2>$null } | Execute-Command -ErrorAction SilentlyContinue
if ($existingBranch) {
Expand Down

0 comments on commit 7998b78

Please sign in to comment.