Skip to content

Commit

Permalink
style(git): format code for consistency and readability
Browse files Browse the repository at this point in the history
  • Loading branch information
alanjaouen committed Dec 27, 2024
1 parent a4ffd3e commit d2a4993
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/core/git/Git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default class Git {
return this._git.revparse(['HEAD']);
}

async getBaseBranchCommit(baseBranch:string): Promise<string> {
async getBaseBranchCommit(baseBranch: string): Promise<string> {
return this._git.revparse([baseBranch]);
}

Expand Down Expand Up @@ -149,7 +149,7 @@ export default class Git {
filter: (src) => {
const relativePath = path.relative(process.cwd(), src);
return !relativePath || !gitignore.ignores(relativePath);
}
},
});

//Initiate git on new repo on using the abstracted object
Expand Down Expand Up @@ -198,14 +198,12 @@ export default class Git {
}

async addSafeConfig(repoDir: string) {
try
{
//add workaround for safe directory (https://github.com/actions/runner/issues/2033)
await this._git.addConfig('safe.directory', repoDir, false, 'global');
}catch(error)
{
try {
//add workaround for safe directory (https://github.com/actions/runner/issues/2033)
await this._git.addConfig('safe.directory', repoDir, false, 'global');
} catch (error) {
//ignore error
SFPLogger.log(`Unable to set safe.directory`,LoggerLevel.TRACE)
SFPLogger.log(`Unable to set safe.directory`, LoggerLevel.TRACE);
}
}

Expand Down

0 comments on commit d2a4993

Please sign in to comment.