Skip to content

Commit 759a7a2

Browse files
Replace git rev-parse with git branch --list for branchExists check in Repository class to improve clarity
1 parent 99521db commit 759a7a2

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

dist/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34766,7 +34766,7 @@ class Repository {
3476634766
}
3476734767
}
3476834768
async branchExists() {
34769-
return await (0, filesystem_1.exec)(`git rev-parse --verify ${this.branchName()}`)
34769+
return await (0, filesystem_1.exec)(`git branch --list "${this.branchName()}"`)
3477034770
.then(() => true)
3477134771
.catch(error => {
3477234772
throw new Error(error.message);

src/utils/repository.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export class Repository
3030

3131
async branchExists()
3232
{
33-
return await exec(`git rev-parse --verify ${ this.branchName() }`)
33+
return await exec(`git branch --list "${ this.branchName() }"`)
3434
.then(() => true)
3535
.catch(error => {
3636
throw new Error(error.message)

0 commit comments

Comments
 (0)