mirror of
https://github.com/actions/checkout.git
synced 2026-01-20 07:38:53 +08:00
Change git config scope from global to system
This commit is contained in:
parent
ac59398561
commit
dc3f9aa6d6
4 changed files with 34 additions and 25 deletions
|
|
@ -9,6 +9,7 @@ import * as path from 'path'
|
|||
import * as refHelper from './ref-helper'
|
||||
import * as stateHelper from './state-helper'
|
||||
import * as urlHelper from './url-helper'
|
||||
import {ConfigScope} from './git-command-manager'
|
||||
import {IGitCommandManager} from './git-command-manager'
|
||||
import {IGitSourceSettings} from './git-source-settings'
|
||||
|
||||
|
|
@ -49,7 +50,7 @@ export async function getSource(settings: IGitSourceSettings): Promise<void> {
|
|||
)
|
||||
|
||||
await git
|
||||
.config('safe.directory', settings.repositoryPath, true, true)
|
||||
.config('safe.directory', settings.repositoryPath, ConfigScope.System, true)
|
||||
.catch(error => {
|
||||
core.info(
|
||||
`Failed to initialize safe directory with error: ${error}`
|
||||
|
|
@ -278,7 +279,7 @@ export async function cleanup(repositoryPath: string): Promise<void> {
|
|||
)
|
||||
|
||||
await git
|
||||
.config('safe.directory', repositoryPath, true, true)
|
||||
.config('safe.directory', repositoryPath, ConfigScope.System, true)
|
||||
.catch(error => {
|
||||
core.info(`Failed to initialize safe directory with error: ${error}`)
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue