fix fetchOnPull behavior for Sync

This commit is contained in:
Asif Hasan
2020-06-03 18:23:37 -05:00
parent fc797d2430
commit df3af97279
2 changed files with 14 additions and 5 deletions

View File

@@ -1225,9 +1225,16 @@ export class Repository implements Disposable {
const tags = config.get<boolean>('pullTags');
const supportCancellation = config.get<boolean>('supportCancellation');
const fn = fetchOnPull
? async (cancellationToken?: CancellationToken) => await this.repository.pull(rebase, undefined, undefined, { tags, cancellationToken })
: async (cancellationToken?: CancellationToken) => await this.repository.pull(rebase, remoteName, pullBranch, { tags, cancellationToken });
const fn = async (cancellationToken?: CancellationToken) => {
// When fetchOnPull is enabled, fetch all branches when pulling
if (fetchOnPull) {
await this.repository.fetch({ all: true, cancellationToken });
}
await this.repository.pull(rebase, remoteName, pullBranch, { tags, cancellationToken });
};
if (supportCancellation) {
const opts: ProgressOptions = {