diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/network/remote/local.c | 6 | ||||
-rw-r--r-- | tests/online/push.c | 17 |
2 files changed, 10 insertions, 13 deletions
diff --git a/tests/network/remote/local.c b/tests/network/remote/local.c index 7e575b7b9..8d6f90c95 100644 --- a/tests/network/remote/local.c +++ b/tests/network/remote/local.c @@ -212,7 +212,7 @@ void test_network_remote_local__push_to_bare_remote(void) /* Try to push */ cl_git_pass(git_push_new(&push, localremote)); - cl_git_pass(git_push_add_refspec(push, "refs/heads/master:")); + cl_git_pass(git_push_add_refspec(push, "refs/heads/master")); cl_git_pass(git_push_finish(push)); cl_assert(git_push_unpack_ok(push)); @@ -258,7 +258,7 @@ void test_network_remote_local__push_to_bare_remote_with_file_url(void) /* Try to push */ cl_git_pass(git_push_new(&push, localremote)); - cl_git_pass(git_push_add_refspec(push, "refs/heads/master:")); + cl_git_pass(git_push_add_refspec(push, "refs/heads/master")); cl_git_pass(git_push_finish(push)); cl_assert(git_push_unpack_ok(push)); @@ -301,7 +301,7 @@ void test_network_remote_local__push_to_non_bare_remote(void) /* Try to push */ cl_git_pass(git_push_new(&push, localremote)); - cl_git_pass(git_push_add_refspec(push, "refs/heads/master:")); + cl_git_pass(git_push_add_refspec(push, "refs/heads/master")); cl_git_fail_with(git_push_finish(push), GIT_EBAREREPO); cl_assert_equal_i(0, git_push_unpack_ok(push)); 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) |