File tree 1 file changed +10
-0
lines changed
1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,16 @@ - (void) beginCreateBranchSheetAtRefish:(id <PBGitRefish>)ref inRepository:(PBGi
51
51
[self .errorMessageField setStringValue: @" " ];
52
52
self.shouldCheckoutBranch = [PBGitDefaults shouldCheckoutBranch ];
53
53
54
+ // when creating a local branch tracking a remote branch preset the branch name to the name of the remote branch
55
+ if ([self .startRefish refishType ] == kGitXRemoteBranchType ) {
56
+ NSMutableArray *components = [[[self .startRefish shortName ] componentsSeparatedByString: @" /" ] mutableCopy ];
57
+ if ([components count ] > 1 ) {
58
+ [components removeObjectAtIndex: 0 ];
59
+ NSString *branchName = [components componentsJoinedByString: @" /" ];
60
+ [self .branchNameField setStringValue: branchName];
61
+ }
62
+ }
63
+
54
64
[NSApp beginSheet: [self window ] modalForWindow: [self .repository.windowController window ] modalDelegate: self didEndSelector: nil contextInfo: NULL ];
55
65
}
56
66
You can’t perform that action at this time.
0 commit comments