Skip to content

Commit 9cab706

Browse files
committed
Move the helper to a separate file
1 parent 4dcc38f commit 9cab706

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
function ConvertTo-PushBranchList([Parameter(Mandatory)][Hashtable] $branches) {
2+
$result = $branches.Keys | Sort-Object | Foreach-Object {
3+
"$($branches[$_]):refs/heads/$($_)"
4+
}
5+
return $result
6+
}
7+
8+
# Not to be re-exported; used for testing
9+
Export-ModuleMember -Function ConvertTo-PushBranchList

utils/actions/finalize/Register-FinalizeActionSetBranches.mocks.psm1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Import-Module -Scope Local "$PSScriptRoot/../../input.mocks.psm1"
33
Import-Module -Scope Local "$PSScriptRoot/../../query-state.mocks.psm1"
44
Import-Module -Scope Local "$PSScriptRoot/../../query-state.psm1"
55
Import-Module -Scope Local "$PSScriptRoot/Register-FinalizeActionSetBranches.psm1"
6+
Import-Module -Scope Local "$PSScriptRoot/Register-FinalizeActionSetBranches.helpers.psm1"
67

78
function Invoke-MockGit([string] $gitCli, [object] $MockWith) {
89
return Invoke-MockGitModule -ModuleName 'Register-FinalizeActionSetBranches' @PSBoundParameters

utils/actions/finalize/Register-FinalizeActionSetBranches.psm1

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,7 @@ Import-Module -Scope Local "$PSScriptRoot/../../framework.psm1"
33
Import-Module -Scope Local "$PSScriptRoot/../../input.psm1"
44
Import-Module -Scope Local "$PSScriptRoot/../../query-state.psm1"
55
Import-Module -Scope Local "$PSScriptRoot/../../git.psm1"
6-
7-
function ConvertTo-PushBranchList([Parameter(Mandatory)][Hashtable] $branches) {
8-
$result = $branches.Keys | Sort-Object | Foreach-Object {
9-
"$($branches[$_]):refs/heads/$($_)"
10-
}
11-
return $result
12-
}
13-
14-
# Not to be re-exported; used for testing
15-
Export-ModuleMember -Function ConvertTo-PushBranchList
6+
Import-Module -Scope Local "$PSScriptRoot/Register-FinalizeActionSetBranches.helpers.psm1"
167

178
function Invoke-SetBranchesFinalizeAction {
189
param(

0 commit comments

Comments
 (0)