Skip to content

Commit

Permalink
fix: correct pull changes count
Browse files Browse the repository at this point in the history
close #198
  • Loading branch information
Vinzent03 committed Mar 2, 2022
1 parent 9c2b063 commit 6aead15
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/simpleGit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export class SimpleGit extends GitManager {
await this.git.subModule(["update", "--remote", "--merge", "--recursive"], (err) => this.onError(err));

const branchInfo = await this.branchInfo();
const localCommit = await this.git.revparse([branchInfo.current], (err) => this.onError(err));
const localCommit = await this.git.revparse([branchInfo.tracking], (err) => this.onError(err));

await this.git.fetch((err) => this.onError(err));
const upstreamCommit = await this.git.revparse([branchInfo.tracking], (err) => this.onError(err));
Expand Down Expand Up @@ -178,6 +178,7 @@ export class SimpleGit extends GitManager {
this.plugin.displayError(`Sync failed (${this.plugin.settings.syncMethod}): ${err.message}`);
}
}
console.log(localCommit);

const filesChanged = await this.git.diff([`${localCommit}..${upstreamCommit}`, '--name-only']);
return filesChanged.split(/\r\n|\r|\n/).filter((value) => value.length > 0).length;
Expand Down

0 comments on commit 6aead15

Please sign in to comment.