Fix linting and formatting issues

This commit is contained in:
Milad Irannejad 2023-03-01 17:50:51 -05:00
parent dc3f9aa6d6
commit 287da9b78e
No known key found for this signature in database
GPG Key ID: 83D922682700B3AC
3 changed files with 20 additions and 7 deletions

View File

@ -136,7 +136,12 @@ class GitAuthHelper {
await this.git.tryConfigUnset(this.insteadOfKey, ConfigScope.System)
if (!this.settings.sshKey) {
for (const insteadOfValue of this.insteadOfValues) {
await this.git.config(this.insteadOfKey, insteadOfValue, ConfigScope.System, true)
await this.git.config(
this.insteadOfKey,
insteadOfValue,
ConfigScope.System,
true
)
}
}
} catch (err) {
@ -294,7 +299,7 @@ class GitAuthHelper {
await this.git.config(
this.tokenConfigKey,
this.tokenPlaceholderConfigValue,
configScope,
configScope
)
// Replace the placeholder

View File

@ -13,9 +13,9 @@ import {GitVersion} from './git-version'
export const MinimumGitVersion = new GitVersion('2.18')
export enum ConfigScope {
Local = "local",
Global = "global",
System = "system",
Local = 'local',
Global = 'global',
System = 'system'
}
export interface IGitCommandManager {
@ -181,7 +181,10 @@ class GitCommandManager {
configScope?: ConfigScope,
add?: boolean
): Promise<void> {
const args: string[] = ['config', configScope ? `--${configScope}` : '--local']
const args: string[] = [
'config',
configScope ? `--${configScope}` : '--local'
]
if (add) {
args.push('--add')
}

View File

@ -50,7 +50,12 @@ export async function getSource(settings: IGitSourceSettings): Promise<void> {
)
await git
.config('safe.directory', settings.repositoryPath, ConfigScope.System, true)
.config(
'safe.directory',
settings.repositoryPath,
ConfigScope.System,
true
)
.catch(error => {
core.info(
`Failed to initialize safe directory with error: ${error}`