File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 2727#import " GTReference.h"
2828#import " GTEnumerator.h"
2929#import " GTRepository.h"
30+ #import " GTConfiguration.h"
3031#import " GTCommit.h"
3132#import " GTRemote.h"
3233#import " NSError+Git.h"
@@ -175,6 +176,19 @@ - (GTBranch *)trackingBranchWithError:(NSError **)error success:(BOOL *)success
175176 return self;
176177 }
177178
179+ // Refresh configuration first so that libgit2 gets any updated tracking
180+ // refs in the repository's config.
181+ GTConfiguration *configuration = [self .repository configurationWithError: error];
182+ if (configuration == nil ) {
183+ if (success != NULL ) *success = NO ;
184+ return nil ;
185+ }
186+
187+ if (![configuration refresh: error]) {
188+ if (success != NULL ) *success = NO ;
189+ return nil ;
190+ }
191+
178192 git_reference *trackingRef = NULL ;
179193 int gitError = git_branch_upstream (&trackingRef, self.reference .git_reference );
180194
You can’t perform that action at this time.
0 commit comments