Skip to content

Commit

Permalink
feat: add method to check if local branch is ahead of remote branch
Browse files Browse the repository at this point in the history
  • Loading branch information
mahyarmirrashed committed Jul 3, 2023
1 parent 82c9723 commit c51d8a7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/services/gitService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface GitService {
gitUnstageAll(): Promise<void>;

isGitInitialized(): Promise<boolean>;
isLocalAhead(): Promise<boolean>;
isPathCurrentlyTracked(path: string): Promise<boolean>;
isPathPreviouslyTracked(path: string): Promise<boolean>;
isRemoteConfigured(): Promise<boolean>;
Expand Down Expand Up @@ -76,6 +77,12 @@ export class SimpleGitService implements GitService {
return gitInitialized;
}

async isLocalAhead(): Promise<boolean> {
const status = await this.gitProvider.status();

return status.ahead > 0;
}

async isPathCurrentlyTracked(path: string): Promise<boolean> {
const status = await this.gitProvider.status();

Expand Down

0 comments on commit c51d8a7

Please sign in to comment.