summaryrefslogtreecommitdiff
path: root/tests/online
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2014-11-17 17:03:55 -0500
committerEdward Thomson <ethomson@edwardthomson.com>2014-11-17 17:03:55 -0500
commit7f1b73b7c893ec84cb04870f30199b41519f1c4e (patch)
treef2647118dfdcc0ded85d0a5969ad6834dbecfc2d /tests/online
parenta4221ccb099a11c020797ee199af01caa3cdd017 (diff)
parentaad638f3a1e4d98296c2ec9c4ed08f217a652c5c (diff)
downloadlibgit2-7f1b73b7c893ec84cb04870f30199b41519f1c4e.tar.gz
Merge pull request #2693 from libgit2/cmn/push-refspec-refactor
push: use the common refspec parser
Diffstat (limited to 'tests/online')
-rw-r--r--tests/online/push.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/tests/online/push.c b/tests/online/push.c
index b09c7ad1f..1d4f9bc60 100644
--- a/tests/online/push.c
+++ b/tests/online/push.c
@@ -631,11 +631,11 @@ void test_online_push__multi(void)
void test_online_push__implicit_tgt(void)
{
- const char *specs1[] = { "refs/heads/b1:" };
+ const char *specs1[] = { "refs/heads/b1" };
push_status exp_stats1[] = { { "refs/heads/b1", 1 } };
expected_ref exp_refs1[] = { { "refs/heads/b1", &_oid_b1 } };
- const char *specs2[] = { "refs/heads/b2:" };
+ const char *specs2[] = { "refs/heads/b2" };
push_status exp_stats2[] = { { "refs/heads/b2", 1 } };
expected_ref exp_refs2[] = {
{ "refs/heads/b1", &_oid_b1 },
@@ -838,22 +838,19 @@ void test_online_push__bad_refspecs(void)
void test_online_push__expressions(void)
{
+ git_push *push;
+
/* TODO: Expressions in refspecs doesn't actually work yet */
const char *specs_left_expr[] = { "refs/heads/b2~1:refs/heads/b2" };
- /* expect not NULL to indicate failure (core git replies "funny refname",
- * other servers may be less pithy. */
- const char *specs_right_expr[] = { "refs/heads/b2:refs/heads/b2~1" };
- push_status exp_stats_right_expr[] = { { "refs/heads/b2~1", 0 } };
+ cl_git_pass(git_push_new(&push, _remote));
+ cl_git_fail(git_push_add_refspec(push, "refs/heads/b2:refs/heads/b2~1"));
+ git_push_free(push);
/* TODO: Find a more precise way of checking errors than a exit code of -1. */
do_push(specs_left_expr, ARRAY_SIZE(specs_left_expr),
NULL, 0,
NULL, 0, -1, 0, 0);
-
- do_push(specs_right_expr, ARRAY_SIZE(specs_right_expr),
- exp_stats_right_expr, ARRAY_SIZE(exp_stats_right_expr),
- NULL, 0, 0, 1, 1);
}
void test_online_push__notes(void)