From 90cdf44ffb7c78cb9d36709f8a07a216e06bd919 Mon Sep 17 00:00:00 2001 From: Yichao Yu Date: Sat, 29 Apr 2017 13:00:07 -0400 Subject: [PATCH 1/2] Allow NULL refspec in git_remote_push Since this is allowed in `git_remote_upload` --- src/remote.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/remote.c b/src/remote.c index d3132f75c..4cbc45eda 100644 --- a/src/remote.c +++ b/src/remote.c @@ -2412,7 +2412,7 @@ int git_remote_push(git_remote *remote, const git_strarray *refspecs, const git_ proxy = &opts->proxy_opts; } - assert(remote && refspecs); + assert(remote); if ((error = git_remote_connect(remote, GIT_DIRECTION_PUSH, cbs, proxy, custom_headers)) < 0) return error; From 45071cec117bc3f4348aa808dc58f18850f4ad1d Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Mon, 1 May 2017 15:23:27 +0100 Subject: [PATCH 2/2] git_remote_push: document that NULL refspecs allowed --- include/git2/remote.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/git2/remote.h b/include/git2/remote.h index 244794e6a..e9e4e5b65 100644 --- a/include/git2/remote.h +++ b/include/git2/remote.h @@ -715,8 +715,8 @@ GIT_EXTERN(int) git_remote_prune(git_remote *remote, const git_remote_callbacks * Peform all the steps from a push. * * @param remote the remote to push to - * @param refspecs the refspecs to use for pushing. If none are - * passed, the configured refspecs will be used + * @param refspecs the refspecs to use for pushing. If NULL or an empty + * array, the configured refspecs will be used * @param opts options to use for this push */ GIT_EXTERN(int) git_remote_push(git_remote *remote,