Commit 8e398e4c by Arthur Schreiber

Treat an empty list of refspecs the same as a NULL value.

parent 46a2b8e8
...@@ -308,7 +308,7 @@ GIT_EXTERN(int) git_remote_ls(const git_remote_head ***out, size_t *size, git_r ...@@ -308,7 +308,7 @@ GIT_EXTERN(int) git_remote_ls(const git_remote_head ***out, size_t *size, git_r
* *
* @param remote the remote * @param remote the remote
* @param refspecs the refspecs to use for this negotiation and * @param refspecs the refspecs to use for this negotiation and
* download. Use NULL to use the base refspecs * download. Use NULL or an empty array to use the base refspecs
* @return 0 or an error code * @return 0 or an error code
*/ */
GIT_EXTERN(int) git_remote_download(git_remote *remote, const git_strarray *refspecs); GIT_EXTERN(int) git_remote_download(git_remote *remote, const git_strarray *refspecs);
...@@ -376,8 +376,8 @@ GIT_EXTERN(int) git_remote_update_tips( ...@@ -376,8 +376,8 @@ GIT_EXTERN(int) git_remote_update_tips(
* disconnect and update the remote-tracking branches. * disconnect and update the remote-tracking branches.
* *
* @param remote the remote to fetch from * @param remote the remote to fetch from
* @param refspecs the refspecs to use for this fetch. Pass NULL to * @param refspecs the refspecs to use for this fetch. Pass NULL or an
* use the base refspecs. * empty array to use the base refspecs.
* @param signature The identity to use when updating reflogs * @param signature The identity to use when updating reflogs
* @param reflog_message The message to insert into the reflogs. If NULL, the * @param reflog_message The message to insert into the reflogs. If NULL, the
* default is "fetch" * default is "fetch"
......
...@@ -834,7 +834,7 @@ int git_remote_download(git_remote *remote, const git_strarray *refspecs) ...@@ -834,7 +834,7 @@ int git_remote_download(git_remote *remote, const git_strarray *refspecs)
goto on_error; goto on_error;
remote->passed_refspecs = 0; remote->passed_refspecs = 0;
if (!refspecs) { if (!refspecs || !refspecs->count) {
to_active = &remote->refspecs; to_active = &remote->refspecs;
} else { } else {
for (i = 0; i < refspecs->count; i++) { for (i = 0; i < refspecs->count; i++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment