Skip to content

Commit da14c5f

Browse files
authored
Merge pull request nodegit#1685 from Mr-Wallet/fix/refresh-references-cache
refresh_references.cc: bust LibGit2 remote list cache by reading config
2 parents d687f8b + 138bccb commit da14c5f

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

generate/templates/manual/repository/refresh_references.cc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,17 @@ void GitRepository::RefreshReferencesWorker::Execute()
415415
git_odb *odb;
416416

417417
baton->error_code = git_repository_odb(&odb, repo);
418+
if (baton->error_code != GIT_OK) {
419+
if (giterr_last() != NULL) {
420+
baton->error = git_error_dup(giterr_last());
421+
}
422+
delete refreshData;
423+
baton->out = NULL;
424+
return;
425+
}
426+
427+
git_config *config;
428+
baton->error_code = git_repository_config_snapshot(&config, repo);
418429
if (baton->error_code != GIT_OK) {
419430
if (giterr_last() != NULL) {
420431
baton->error = git_error_dup(giterr_last());
@@ -424,6 +435,8 @@ void GitRepository::RefreshReferencesWorker::Execute()
424435
baton->out = NULL;
425436
return;
426437
}
438+
git_config_free(config);
439+
427440

428441
// START Refresh HEAD
429442
git_reference *headRef = NULL;

0 commit comments

Comments
 (0)