Skip to content

acmeportal


acmeportal / utils/gitService / GitService

Class: GitService

Defined in: utils/gitService.ts:7

Service for Git repository operations

Constructors

Constructor

new GitService(commandExecutor, workspaceService): GitService

Defined in: utils/gitService.ts:8

Parameters

commandExecutor

CommandExecutor

workspaceService

WorkspaceService

Returns

GitService

Methods

isGitInstalled()

isGitInstalled(): Promise\<boolean>

Defined in: utils/gitService.ts:17

Check if Git is installed on the system

Returns

Promise\<boolean>

True if Git is installed, false otherwise


checkGitInstalled()

checkGitInstalled(): Promise\<boolean>

Defined in: utils/gitService.ts:30

Check if Git is installed and show an error message if not

Returns

Promise\<boolean>

True if Git is installed, false otherwise


getCurrentBranch()

getCurrentBranch(): Promise\<undefined | string>

Defined in: utils/gitService.ts:42

Get the current branch name of the workspace

Returns

Promise\<undefined | string>

The current branch name or 'main' as default


hasUncommittedChanges()

hasUncommittedChanges(): Promise\<boolean>

Defined in: utils/gitService.ts:64

Check if there are uncommitted changes in the workspace

Returns

Promise\<boolean>

True if there are uncommitted changes, false otherwise


getCurrentCommitHash()

getCurrentCommitHash(): Promise\<undefined | string>

Defined in: utils/gitService.ts:89

Get the current commit hash of the workspace

Returns

Promise\<undefined | string>

The current commit hash or undefined on error


getLocalBranches()

getLocalBranches(): Promise\<undefined | string[]>

Defined in: utils/gitService.ts:112

Get list of local branches

Returns

Promise\<undefined | string[]>

Array of branch names or undefined on error


getBranchCommitHash()

getBranchCommitHash(branchName): Promise\<undefined | string>

Defined in: utils/gitService.ts:136

Get commit hash of a specific branch

Parameters

branchName

string

Name of the branch

Returns

Promise\<undefined | string>

The commit hash of the branch or undefined on error


getRepositoryUrl()

getRepositoryUrl(): Promise\<undefined | string>

Defined in: utils/gitService.ts:159

Get the GitHub repository URL for the current workspace

Returns

Promise\<undefined | string>

The GitHub repository URL or undefined on error