File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -193,7 +193,12 @@ - (GTBranch *)trackingBranchWithError:(NSError **)error success:(BOOL *)success
193193}
194194
195195- (BOOL )updateTrackingBranch : (GTBranch *)trackingBranch error : (NSError **)error {
196- int result = git_branch_set_upstream (self.reference .git_reference , trackingBranch.shortName .UTF8String );
196+ int result = GIT_ENOTFOUND;
197+ if (trackingBranch.branchType == GTBranchTypeRemote) {
198+ result = git_branch_set_upstream (self.reference .git_reference , [trackingBranch.name stringByReplacingOccurrencesOfString: [GTBranch remoteNamePrefix ] withString: @" " ].UTF8String );
199+ } else {
200+ result = git_branch_set_upstream (self.reference .git_reference , trackingBranch.shortName .UTF8String );
201+ }
197202 if (result != GIT_OK) {
198203 if (error != NULL ) *error = [NSError git_errorFor: result description: @" Failed to update tracking branch for %@ " , self ];
199204 return NO ;
You can’t perform that action at this time.
0 commit comments