summaryrefslogtreecommitdiff
path: root/src/push.c
diff options
context:
space:
mode:
authorabepern <abepern@gmail.com>2013-02-19 06:22:58 -0800
committerPhilip Kelley <phkelley@hotmail.com>2013-03-11 17:32:33 -0400
commit20858f6ea631008c334cbf5bb5f976291765c173 (patch)
tree671771b8fb6a9bb768b5b904e90ed5e4c020c42c /src/push.c
parentd768f9add943e0ca220c81d7ffa29fc3215cd119 (diff)
downloadlibgit2-20858f6ea631008c334cbf5bb5f976291765c173.tar.gz
Implemented push on the local transport
Diffstat (limited to 'src/push.c')
-rw-r--r--src/push.c31
1 files changed, 17 insertions, 14 deletions
diff --git a/src/push.c b/src/push.c
index 628df7ac4..37f641812 100644
--- a/src/push.c
+++ b/src/push.c
@@ -83,18 +83,6 @@ static void free_refspec(push_spec *spec)
git__free(spec);
}
-static void free_status(push_status *status)
-{
- if (status == NULL)
- return;
-
- if (status->msg)
- git__free(status->msg);
-
- git__free(status->ref);
- git__free(status);
-}
-
static int check_rref(char *ref)
{
if (git__prefixcmp(ref, "refs/")) {
@@ -225,8 +213,11 @@ int git_push_update_tips(git_push *push)
error = git_reference_lookup(&remote_ref, push->remote->repo, git_buf_cstr(&remote_ref_name));
if (!error) {
- if ((error = git_reference_delete(remote_ref)) < 0)
+ if ((error = git_reference_delete(remote_ref)) < 0) {
+ git_reference_free(remote_ref);
goto on_error;
+ }
+ git_reference_free(remote_ref);
} else if (error == GIT_ENOTFOUND)
giterr_clear();
else
@@ -526,6 +517,18 @@ int git_push_status_foreach(git_push *push,
return 0;
}
+void git_push_status_free(push_status *status)
+{
+ if (status == NULL)
+ return;
+
+ if (status->msg)
+ git__free(status->msg);
+
+ git__free(status->ref);
+ git__free(status);
+}
+
void git_push_free(git_push *push)
{
push_spec *spec;
@@ -541,7 +544,7 @@ void git_push_free(git_push *push)
git_vector_free(&push->specs);
git_vector_foreach(&push->status, i, status) {
- free_status(status);
+ git_push_status_free(status);
}
git_vector_free(&push->status);