Skip to content

Commit

Permalink
Check that master has an initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
leojonathanoh committed Nov 22, 2023
1 parent 303d99b commit 1d01164
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Generate-GitBranches.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ try {
$isSameRepo = if ($TargetRepo -eq $sourceRepo) { $true } else { $false }

Push-Location $TargetRepo
if ($PSCmdlet.ShouldProcess("Check that 'master' branch has commits")) {
$log = { git log master -1 } | Execute-Command -ErrorAction SilentlyContinue
if (!$log) {
throw "No commits on 'master'. Please create the master branch first: git commit -m 'Init' --allow-empty"
}
}
foreach ($g in $games) {
$branch = "$( $g['game_platform'] )-$( $g['game_engine'] )-$( $g['game'] )"

Expand Down

0 comments on commit 1d01164

Please sign in to comment.