remote: only keep a weak pointer in update_tips

The reference is only needed inside the function. We mistakenly
increased the reference counter causing the ODB not to get freed and
leaking descriptors.
This commit is contained in:
Carlos Martín Nieto 2012-10-07 11:19:19 +02:00
parent 22935b06d1
commit acd1700630

View File

@ -467,7 +467,7 @@ int git_remote_update_tips(git_remote *remote)
if (refs->length == 0) if (refs->length == 0)
return 0; return 0;
if (git_repository_odb(&odb, remote->repo) < 0) if (git_repository_odb__weakptr(&odb, remote->repo) < 0)
return -1; return -1;
if (git_refspec__parse(&tagspec, GIT_REFSPEC_TAGS, true) < 0) if (git_refspec__parse(&tagspec, GIT_REFSPEC_TAGS, true) < 0)