Skip to content

Commit

Permalink
Fixes #3277 Unable to pull branch when local branch name differs
Browse files Browse the repository at this point in the history
  • Loading branch information
axosoft-ramint committed May 16, 2024
1 parent a219d10 commit 4cbc432
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/env/node/git/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1024,7 +1024,7 @@ export class Git {

async pull(
repoPath: string,
options: { branch?: string; remote?: string; rebase?: boolean; tags?: boolean },
options: { branch?: string; remote?: string; upstream?: string; rebase?: boolean; tags?: boolean },
): Promise<void> {
const params = ['pull'];

Expand All @@ -1038,7 +1038,7 @@ export class Git {

if (options.remote && options.branch) {
params.push(options.remote);
params.push(options.branch);
params.push(options.upstream ? `${options.upstream}:${options.branch}` : options.branch);
}

try {
Expand Down
4 changes: 2 additions & 2 deletions src/env/node/git/localGitProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1461,11 +1461,10 @@ export class LocalGitProvider implements GitProvider, Disposable {
if (options.publish != null) {
branchName = options.reference.name;
remoteName = options.publish.remote;
upstreamName = getBranchTrackingWithoutRemote(options.reference);
} else {
[branchName, remoteName] = getBranchNameAndRemote(options.reference);
upstreamName = undefined;
}
upstreamName = getBranchTrackingWithoutRemote(options.reference);
} else {
const branch = await this.getBranch(repoPath);
if (branch == null) return;
Expand Down Expand Up @@ -1558,6 +1557,7 @@ export class LocalGitProvider implements GitProvider, Disposable {
await this.git.pull(repoPath, {
branch: branchName,
remote: remoteName,
upstream: getBranchTrackingWithoutRemote(branch),
rebase: options?.rebase,
tags: options?.tags,
});
Expand Down

0 comments on commit 4cbc432

Please sign in to comment.