Skip to main content

Class: GitService

Defined in: ../../skaff-lib/src/core/infra/git-service.ts:28

Constructors

Constructor

new GitService(cacheService, npmService): GitService

Defined in: ../../skaff-lib/src/core/infra/git-service.ts:29

Parameters

cacheService

CacheService

npmService

NpmService

Returns

GitService

Methods

addAllAndRetrieveDiff()

addAllAndRetrieveDiff(repoPath): Promise<Result<string>>

Defined in: ../../skaff-lib/src/core/infra/git-service.ts:373

Parameters

repoPath

string

Returns

Promise<Result<string>>


applyDiffToGitRepo()

applyDiffToGitRepo(repoPath, diffPath): Promise<Result<void>>

Defined in: ../../skaff-lib/src/core/infra/git-service.ts:432

Parameters

repoPath

string

diffPath

string

Returns

Promise<Result<void>>


cloneRepoBranchToCache()

cloneRepoBranchToCache(repoUrl, branch): Promise<Result<string>>

Defined in: ../../skaff-lib/src/core/infra/git-service.ts:158

Parameters

repoUrl

string

branch

string

Returns

Promise<Result<string>>


cloneRevisionToCache()

cloneRevisionToCache(template, revisionHash): Promise<Result<string>>

Defined in: ../../skaff-lib/src/core/infra/git-service.ts:210

Parameters

template

Template

revisionHash

string

Returns

Promise<Result<string>>


commitAll()

commitAll(repoPath, commitMessage): Promise<Result<void>>

Defined in: ../../skaff-lib/src/core/infra/git-service.ts:355

Parameters

repoPath

string

commitMessage

string

Returns

Promise<Result<void>>


createGitRepo()

createGitRepo(repoPath): Promise<Result<void>>

Defined in: ../../skaff-lib/src/core/infra/git-service.ts:403

Parameters

repoPath

string

Returns

Promise<Result<void>>


deleteRepo()

deleteRepo(repoPath): Promise<Result<void>>

Defined in: ../../skaff-lib/src/core/infra/git-service.ts:390

Parameters

repoPath

string

Returns

Promise<Result<void>>


diffDirectories()

diffDirectories(absoluteBaseProjectPath, absoluteNewProjectPath): Promise<Result<string>>

Defined in: ../../skaff-lib/src/core/infra/git-service.ts:479

Parameters

absoluteBaseProjectPath

string

absoluteNewProjectPath

string

Returns

Promise<Result<string>>


getCommitHash()

getCommitHash(repoPath): Promise<Result<string>>

Defined in: ../../skaff-lib/src/core/infra/git-service.ts:248

Parameters

repoPath

string

Returns

Promise<Result<string>>


getCurrentBranch()

getCurrentBranch(repoPath): Promise<Result<string>>

Defined in: ../../skaff-lib/src/core/infra/git-service.ts:280

Parameters

repoPath

string

Returns

Promise<Result<string>>


getRemoteCommitHash()

getRemoteCommitHash(repoUrl, branch): Promise<Result<string>>

Defined in: ../../skaff-lib/src/core/infra/git-service.ts:294

Parameters

repoUrl

string

branch

string

Returns

Promise<Result<string>>


isConflictAfterApply()

isConflictAfterApply(repoPath): Promise<Result<boolean>>

Defined in: ../../skaff-lib/src/core/infra/git-service.ts:463

Parameters

repoPath

string

Returns

Promise<Result<boolean>>


isGitRepo()

isGitRepo(dir): Promise<Result<boolean>>

Defined in: ../../skaff-lib/src/core/infra/git-service.ts:104

Parameters

dir

string

Returns

Promise<Result<boolean>>


isGitRepoClean()

isGitRepoClean(hostRepoPath): Promise<Result<boolean>>

Defined in: ../../skaff-lib/src/core/infra/git-service.ts:418

Parameters

hostRepoPath

string

Returns

Promise<Result<boolean>>


listBranches()

listBranches(repoPath): Promise<Result<string[]>>

Defined in: ../../skaff-lib/src/core/infra/git-service.ts:262

Parameters

repoPath

string

Returns

Promise<Result<string[]>>


loadGitStatus()

loadGitStatus(repoPath): Promise<Result<GitStatus>>

Defined in: ../../skaff-lib/src/core/infra/git-service.ts:316

Parameters

repoPath

string

Returns

Promise<Result<GitStatus>>


parseGitDiff()

parseGitDiff(diffText): ParsedFile[]

Defined in: ../../skaff-lib/src/core/infra/git-service.ts:524

Parameters

diffText

string

Returns

ParsedFile[]


resetAllChanges()

resetAllChanges(repoPath): Promise<Result<void>>

Defined in: ../../skaff-lib/src/core/infra/git-service.ts:449

Parameters

repoPath

string

Returns

Promise<Result<void>>


switchBranch()

switchBranch(repoPath, branchName): Promise<Result<void>>

Defined in: ../../skaff-lib/src/core/infra/git-service.ts:124

Parameters

repoPath

string

branchName

string

Returns

Promise<Result<void>>