diff options
author | Vicent Marti <tanoku@gmail.com> | 2014-08-18 12:41:06 +0200 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2014-08-18 12:41:06 +0200 |
commit | 4ca0b566ca811550b4db31045e580b4970e5b8e3 (patch) | |
tree | e34ed66136f5a6cdf496b4d8c8a52fcb9c17702e /tests/online | |
parent | 59403f1ff55346c64bfaa0744ea7f3375da71725 (diff) | |
download | libgit2-4ca0b566ca811550b4db31045e580b4970e5b8e3.tar.gz |
oid: Export `git_oid_tostr_s` instead of `_allocfmt`vmg/tostr_s
The old `allocfmt` is of no use to callers, as they are not able to free
the returned buffer. Export a new API that returns a static string that
doesn't need to be freed.
Diffstat (limited to 'tests/online')
-rw-r--r-- | tests/online/push_util.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/tests/online/push_util.c b/tests/online/push_util.c index 038c144db..68e71eacc 100644 --- a/tests/online/push_util.c +++ b/tests/online/push_util.c @@ -110,9 +110,8 @@ failed: git_buf_puts(&msg, "Expected and actual refs differ:\nEXPECTED:\n"); for(i = 0; i < expected_refs_len; i++) { - cl_assert(oid_str = git_oid_allocfmt(expected_refs[i].oid)); + oid_str = git_oid_tostr_s(expected_refs[i].oid); cl_git_pass(git_buf_printf(&msg, "%s = %s\n", expected_refs[i].name, oid_str)); - git__free(oid_str); } git_buf_puts(&msg, "\nACTUAL:\n"); @@ -121,9 +120,8 @@ failed: if (master_present && !strcmp(actual->name, "refs/heads/master")) continue; - cl_assert(oid_str = git_oid_allocfmt(&actual->oid)); + oid_str = git_oid_tostr_s(&actual->oid); cl_git_pass(git_buf_printf(&msg, "%s = %s\n", actual->name, oid_str)); - git__free(oid_str); } cl_fail(git_buf_cstr(&msg)); |