mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-30 00:04:03 +00:00
remote: get rid of git_remote_negotiate
There is no good reason to expose the negotiation as a different step to downloading the packfile. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
This commit is contained in:
parent
40a40e8e9d
commit
95057b8503
@ -106,21 +106,14 @@ GIT_EXTERN(int) git_remote_connect(struct git_remote *remote, int direction);
|
|||||||
*/
|
*/
|
||||||
GIT_EXTERN(int) git_remote_ls(git_remote *remote, git_headarray *refs);
|
GIT_EXTERN(int) git_remote_ls(git_remote *remote, git_headarray *refs);
|
||||||
|
|
||||||
/**
|
|
||||||
* Negotiate what data needs to be exchanged to synchroize the remtoe
|
|
||||||
* and local references
|
|
||||||
*
|
|
||||||
* @param remote the remote you want to negotiate with
|
|
||||||
*/
|
|
||||||
GIT_EXTERN(int) git_remote_negotiate(git_remote *remote);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Download the packfile
|
* Download the packfile
|
||||||
*
|
*
|
||||||
* The packfile is downloaded with a temporary filename, as it's final
|
* Negotiate what objects should be downloaded and download the
|
||||||
* name is not known yet. If there was no packfile needed (all the
|
* packfile with those objects. The packfile is downloaded with a
|
||||||
* objects were available locally), filename will be NULL and the
|
* temporary filename, as it's final name is not known yet. If there
|
||||||
* function will return success.
|
* was no packfile needed (all the objects were available locally),
|
||||||
|
* filename will be NULL and the function will return success.
|
||||||
*
|
*
|
||||||
* @param remote the remote to download from
|
* @param remote the remote to download from
|
||||||
* @param filename where to store the temproray filename
|
* @param filename where to store the temproray filename
|
||||||
|
10
src/remote.c
10
src/remote.c
@ -206,13 +206,13 @@ int git_remote_ls(git_remote *remote, git_headarray *refs)
|
|||||||
return remote->transport->ls(remote->transport, refs);
|
return remote->transport->ls(remote->transport, refs);
|
||||||
}
|
}
|
||||||
|
|
||||||
int git_remote_negotiate(git_remote *remote)
|
|
||||||
{
|
|
||||||
return git_fetch_negotiate(remote);
|
|
||||||
}
|
|
||||||
|
|
||||||
int git_remote_download(char **filename, git_remote *remote)
|
int git_remote_download(char **filename, git_remote *remote)
|
||||||
{
|
{
|
||||||
|
int error;
|
||||||
|
|
||||||
|
if ((error = git_fetch_negotiate(remote)) < 0)
|
||||||
|
return git__rethrow(error, "Error negotiating");
|
||||||
|
|
||||||
return git_fetch_download_pack(filename, remote);
|
return git_fetch_download_pack(filename, remote);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user