mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 08:37:22 +00:00
Make git identity configurable in settings
This commit is contained in:
13 files changed
+270
-108
No files matched your search
@@ -53,29 +53,6 @@ export class GitCommitCommand implements GitSubcommand {
|
||||
return createErrorResult('nothing to commit, working tree clean');
|
||||
}
|
||||
|
||||
// Get author info
|
||||
const author = {
|
||||
name: 'shakespeare.diy',
|
||||
email: '[email protected]',
|
||||
};
|
||||
|
||||
try {
|
||||
const configName = await this.git.getConfig({
|
||||
|
||||
dir: this.pwd,
|
||||
path: 'user.name',
|
||||
});
|
||||
const configEmail = await this.git.getConfig({
|
||||
|
||||
dir: this.pwd,
|
||||
path: 'user.email',
|
||||
});
|
||||
if (configName) author.name = configName;
|
||||
if (configEmail) author.email = configEmail;
|
||||
} catch {
|
||||
// Use defaults
|
||||
}
|
||||
|
||||
let commitMessage = message;
|
||||
if (options.amend) {
|
||||
// Get the last commit message if amending
|
||||
@@ -111,14 +88,10 @@ export class GitCommitCommand implements GitSubcommand {
|
||||
const commitOptions: {
|
||||
dir: string;
|
||||
message: string;
|
||||
author: { name: string; email: string };
|
||||
committer: { name: string; email: string };
|
||||
parent?: string[];
|
||||
} = {
|
||||
dir: this.pwd,
|
||||
message: commitMessage || 'Empty commit',
|
||||
author,
|
||||
committer: author,
|
||||
};
|
||||
|
||||
if (options.amend) {
|
||||
|
||||
Reference in new issue
Block a user