mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
make GitCommitTool accept git instance
This commit is contained in:
5 files changed
+12
-16
No files matched your search
@@ -57,15 +57,10 @@ export class GitCloneCommand implements GitSubcommand {
|
||||
|
||||
// Clone the repository
|
||||
await this.git.clone({
|
||||
|
||||
http,
|
||||
dir: targetPath,
|
||||
url: repository,
|
||||
singleBranch: options.singleBranch,
|
||||
depth: options.depth,
|
||||
corsProxy: (url.hostname === 'github.com' || url.hostname === 'gitlab.com')
|
||||
? 'https://cors.isomorphic-git.org'
|
||||
: undefined,
|
||||
});
|
||||
|
||||
return createSuccessResult(`Cloning into '${targetDir}'...\ndone.\n`);
|
||||
|
||||
@@ -56,12 +56,12 @@ export class GitCommitCommand implements GitSubcommand {
|
||||
|
||||
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',
|
||||
});
|
||||
@@ -76,7 +76,7 @@ export class GitCommitCommand implements GitSubcommand {
|
||||
// Get the last commit message if amending
|
||||
try {
|
||||
const commits = await this.git.log({
|
||||
|
||||
|
||||
dir: this.pwd,
|
||||
depth: 1,
|
||||
});
|
||||
@@ -95,7 +95,7 @@ export class GitCommitCommand implements GitSubcommand {
|
||||
let currentBranch = 'main';
|
||||
try {
|
||||
currentBranch = await this.git.currentBranch({
|
||||
|
||||
|
||||
dir: this.pwd,
|
||||
}) || 'main';
|
||||
} catch {
|
||||
@@ -103,8 +103,7 @@ export class GitCommitCommand implements GitSubcommand {
|
||||
}
|
||||
|
||||
// Create the commit
|
||||
const commitOptions: {
|
||||
fs: JSRuntimeFS;
|
||||
let commitOptions: {
|
||||
dir: string;
|
||||
message: string;
|
||||
author: { name: string; email: string };
|
||||
@@ -121,7 +120,6 @@ export class GitCommitCommand implements GitSubcommand {
|
||||
// For amend, we need to reset to the parent of the current commit
|
||||
try {
|
||||
const commits = await this.git.log({
|
||||
|
||||
dir: this.pwd,
|
||||
depth: 2,
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user