libgit2/libgit2 — pull request #658 by schu (2012-05-01 20:57:23+00:00)
Title: remote: don't free transport on disconnect

Currently, git_remote_disconnect not only closes the connection but also
frees the underlying transport object, making it impossible to write
code like

// fetch stuff
git_remote_download()

// close connection
git_remote_disconnect()

// call user provided callback for each ref
git_remote_update_tips(remote, callback)

because remote->refs points to references owned by the transport object.
This means, we have an idling connection while running the callback for
each reference.

Instead, free the transport later with git_remote_free() or on explicit
call of git_remote_free_transport().

cc @carlosmn: Pretty much what we have talked about. Ack?