Improve performance
This commit is contained in:
parent
eae19dab1f
commit
4b09cd1f87
3 changed files with 24 additions and 49 deletions
scripts/Common/Software/git
|
@ -28,20 +28,7 @@ $null = New-Module {
|
|||
$configArgs = @("--system");
|
||||
}
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Gets the specified git configuration.
|
||||
|
||||
.PARAMETER Name
|
||||
THe name of the configuration to get.
|
||||
#>
|
||||
function Get-GitConfig {
|
||||
param(
|
||||
[string] $Name
|
||||
)
|
||||
|
||||
Get-Config "$root.git.$Name";
|
||||
}
|
||||
$config = Get-Config "$root.git";
|
||||
|
||||
<#
|
||||
.SYNOPSIS
|
||||
|
@ -52,7 +39,7 @@ $null = New-Module {
|
|||
}
|
||||
|
||||
if ((-not $IsWindows) -or $User) {
|
||||
$branch = Get-GitConfig "defaultBranch";
|
||||
$branch = $config.defaultBranch;
|
||||
|
||||
if ($branch) {
|
||||
Set-GitConfig "init.defaultBranch" $branch;
|
||||
|
@ -76,8 +63,8 @@ $null = New-Module {
|
|||
. {
|
||||
$dir = New-TemporaryDirectory;
|
||||
$key = "flow";
|
||||
$mainBranch = Get-GitConfig "$key.mainBranch";
|
||||
$devBranch = Get-GitConfig "$key.devBranch";
|
||||
$mainBranch = $config."$key".mainBranch;
|
||||
$devBranch = $config."$key".devBranch;
|
||||
|
||||
& {
|
||||
git -C "$dir" init;
|
||||
|
@ -103,7 +90,7 @@ $null = New-Module {
|
|||
};
|
||||
|
||||
# Aliases
|
||||
[PSCustomObject] $aliases = Get-GitConfig "aliases";
|
||||
[PSCustomObject] $aliases = $config.aliases;
|
||||
|
||||
if ($aliases) {
|
||||
foreach ($alias in ($aliases | Get-Member -MemberType Properties)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue