Permalink
Browse files

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.
  • Loading branch information...
brotherbard committed Sep 19, 2010
1 parent e388434 commit d00dbe42b3c03d69164426e36418c9dba5552ae0
Showing with 2 additions and 20 deletions.
  1. +1 −18 PBGitRepository.m
  2. +1 −2 PBRefMenuItem.m
View
@@ -625,24 +625,7 @@ - (void) beginPullFromRemote:(PBGitRef *)remoteRef forRef:(PBGitRef *)ref
NSString *remoteName = [remoteRef remoteName];
[arguments addObject:remoteName];
- NSString *branchName = nil;
- NSString *refSpec = nil;
- if ([ref isRemoteBranch]) {
- branchName = [ref shortName];
- refSpec = [ref remoteBranchName];
- }
- else if ([ref isRemote] || !ref) {
- branchName = @"all tracking branches";
- }
- else {
- branchName = [ref shortName];
- refSpec = [NSString stringWithFormat:@"%@:%@", branchName, branchName];
- }
- if (refSpec)
- [arguments addObject:refSpec];
-
- NSString *headRefName = [[[self headRef] ref] shortName];
- NSString *description = [NSString stringWithFormat:@"Pulling %@ from %@ and updating %@", branchName, remoteName, headRefName];
+ NSString *description = [NSString stringWithFormat:@"Pulling all tracking branches from %@", remoteName];
NSString *title = @"Pulling from remote";
[PBRemoteProgressSheet beginRemoteProgressSheetForArguments:arguments title:title description:description inRepository:self];
}
View
@@ -90,8 +90,7 @@ + (NSArray *) defaultMenuItemsForRef:(PBGitRef *)ref inRepository:(PBGitReposito
[items addObject:[PBRefMenuItem itemWithTitle:fetchTitle action:@selector(fetchRemote:) enabled:hasRemote]];
// pull
- NSString *pullRemoteName = [ref isRemoteBranch] ? [ref shortName] : remoteName;
- NSString *pullTitle = hasRemote ? [NSString stringWithFormat:@"Pull %@ and update %@", pullRemoteName, headRefName] : @"Pull";
+ NSString *pullTitle = hasRemote ? [NSString stringWithFormat:@"Pull %@ and update %@", remoteName, headRefName] : @"Pull";
[items addObject:[PBRefMenuItem itemWithTitle:pullTitle action:@selector(pullRemote:) enabled:hasRemote]];
// push

0 comments on commit d00dbe4

Please sign in to comment.