Skip to content

Commit

Permalink
Add message about using git init -b master if -TargetRepo is not …
Browse files Browse the repository at this point in the history
…a git repo
  • Loading branch information
leojonathanoh committed Nov 27, 2023
1 parent 61400f5 commit 3befd72
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Generate-GitBranches.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,13 @@ try {
try {
$sourceRepo = { cd $PSScriptRoot; git rev-parse --show-toplevel; cd - } | Execute-Command -WhatIf:$false # Execute this even if -WhatIf is passed
}catch {
throw "$PSScriptRoot is not a git repo"
throw "$PSScriptRoot is not a git repo. Create a repo using: git init -b master"
}
$sourceRef = { git rev-parse --abbrev-ref HEAD } | Execute-Command
try {
$TargetRepo = { cd $TargetRepo; git rev-parse --show-toplevel; cd - } | Execute-Command -WhatIf:$false # Execute this even if -WhatIf is passed
}catch {
throw "$TargetRepo is not a git repo"
throw "$TargetRepo is not a git repo. Create a repo using: git init -b master"
}
$isSameRepo = if ($TargetRepo -eq $sourceRepo) { $true } else { $false }

Expand Down

0 comments on commit 3befd72

Please sign in to comment.