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
@@ -89,34 +89,10 @@ export class GitCommitTool implements Tool<GitCommitParams> {
|
||||
// Default to 'main' if we can't get the current branch
|
||||
}
|
||||
|
||||
// Get author info (use default if not configured)
|
||||
const author = {
|
||||
name: 'shakespeare.diy',
|
||||
email: '[email protected]',
|
||||
};
|
||||
|
||||
// Try to get configured author from git config
|
||||
try {
|
||||
const configName = await this.git.getConfig({
|
||||
dir: this.cwd,
|
||||
path: 'user.name',
|
||||
});
|
||||
const configEmail = await this.git.getConfig({
|
||||
dir: this.cwd,
|
||||
path: 'user.email',
|
||||
});
|
||||
if (configName) author.name = configName;
|
||||
if (configEmail) author.email = configEmail;
|
||||
} catch {
|
||||
// Use defaults if config is not set
|
||||
}
|
||||
|
||||
// Commit the changes
|
||||
// Commit the changes (author/committer will be set automatically by Git class)
|
||||
const commitSha = await this.git.commit({
|
||||
dir: this.cwd,
|
||||
message: message.trim(),
|
||||
author,
|
||||
committer: author,
|
||||
});
|
||||
|
||||
// Get short hash (first 7 characters)
|
||||
|
||||
Reference in new issue
Block a user