Skip to content
Snippets Groups Projects
Commit 9f914ed2 authored by pierrick_cbl's avatar pierrick_cbl
Browse files

feat: user's git now has preconfigured username/email

set git username/email with a 'system' scope
NB: 'global' scope would  not be enough since the user running deadlock-recorder is 'root' and the terminal in vscode uses theia user
parent 2e72135a
Branches
Tags
1 merge request!5feat: users can have their own Git repo that will be persisted
...@@ -13,7 +13,7 @@ export default class GitMission { ...@@ -13,7 +13,7 @@ export default class GitMission {
private git: SimpleGit; private git: SimpleGit;
constructor(private userConfig: UserConfig) { constructor(private userConfig: UserConfig) {
const options: SimpleGitOptions = { const options: Partial<SimpleGitOptions> = {
baseDir: PROJECT_SRC_PATH, baseDir: PROJECT_SRC_PATH,
binary: 'git', binary: 'git',
maxConcurrentProcesses: 2, maxConcurrentProcesses: 2,
...@@ -56,8 +56,8 @@ export default class GitMission { ...@@ -56,8 +56,8 @@ export default class GitMission {
await this.git.init(); await this.git.init();
await this.git.addRemote(DEFAULT_REMOTE, remotePath); await this.git.addRemote(DEFAULT_REMOTE, remotePath);
await this.git.addConfig('user.email', this.userConfig.getCurrentUserDetails().email); await this.git.addConfig('user.email', this.userConfig.getCurrentUserDetails().email, false, "system");
await this.git.addConfig('user.name', `${this.userConfig.getCurrentUserDetails().lastName} ${this.userConfig.getCurrentUserDetails().firstName}`); await this.git.addConfig('user.name', `${this.userConfig.getCurrentUserDetails().lastName} ${this.userConfig.getCurrentUserDetails().firstName}`, false, "system");
return Promise.resolve(this); return Promise.resolve(this);
} catch (e) { } catch (e) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment