Skip to content

Commit d00dbe4

Browse files
committed
Always pull all tracking branches from the remote
'git pull remote branch' will not update the remote's tracking branches, only the selected local branch. It may not be readily apparent that this happened. So remove the cases where GitX would pull just a single branch and always pull all the tracking branches. The current checked out branch will still be updated as normal.
1 parent e388434 commit d00dbe4

File tree

2 files changed

+2
-20
lines changed

2 files changed

+2
-20
lines changed

PBGitRepository.m

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -625,24 +625,7 @@ - (void) beginPullFromRemote:(PBGitRef *)remoteRef forRef:(PBGitRef *)ref
625625
NSString *remoteName = [remoteRef remoteName];
626626
[arguments addObject:remoteName];
627627

628-
NSString *branchName = nil;
629-
NSString *refSpec = nil;
630-
if ([ref isRemoteBranch]) {
631-
branchName = [ref shortName];
632-
refSpec = [ref remoteBranchName];
633-
}
634-
else if ([ref isRemote] || !ref) {
635-
branchName = @"all tracking branches";
636-
}
637-
else {
638-
branchName = [ref shortName];
639-
refSpec = [NSString stringWithFormat:@"%@:%@", branchName, branchName];
640-
}
641-
if (refSpec)
642-
[arguments addObject:refSpec];
643-
644-
NSString *headRefName = [[[self headRef] ref] shortName];
645-
NSString *description = [NSString stringWithFormat:@"Pulling %@ from %@ and updating %@", branchName, remoteName, headRefName];
628+
NSString *description = [NSString stringWithFormat:@"Pulling all tracking branches from %@", remoteName];
646629
NSString *title = @"Pulling from remote";
647630
[PBRemoteProgressSheet beginRemoteProgressSheetForArguments:arguments title:title description:description inRepository:self];
648631
}

PBRefMenuItem.m

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,7 @@ + (NSArray *) defaultMenuItemsForRef:(PBGitRef *)ref inRepository:(PBGitReposito
9090
[items addObject:[PBRefMenuItem itemWithTitle:fetchTitle action:@selector(fetchRemote:) enabled:hasRemote]];
9191

9292
// pull
93-
NSString *pullRemoteName = [ref isRemoteBranch] ? [ref shortName] : remoteName;
94-
NSString *pullTitle = hasRemote ? [NSString stringWithFormat:@"Pull %@ and update %@", pullRemoteName, headRefName] : @"Pull";
93+
NSString *pullTitle = hasRemote ? [NSString stringWithFormat:@"Pull %@ and update %@", remoteName, headRefName] : @"Pull";
9594
[items addObject:[PBRefMenuItem itemWithTitle:pullTitle action:@selector(pullRemote:) enabled:hasRemote]];
9695

9796
// push

0 commit comments

Comments
 (0)