Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2014-08-18 14:41:06 +0400
committerVicent Marti <tanoku@gmail.com>2014-08-18 14:41:06 +0400
commit4ca0b566ca811550b4db31045e580b4970e5b8e3 (patch)
treee34ed66136f5a6cdf496b4d8c8a52fcb9c17702e /tests/stash/save.c
parent59403f1ff55346c64bfaa0744ea7f3375da71725 (diff)
oid: Export `git_oid_tostr_s` instead of `_allocfmt`
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/stash/save.c')
-rw-r--r--tests/stash/save.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/tests/stash/save.c b/tests/stash/save.c
index 87c6d7e0f..3b301bfc0 100644
--- a/tests/stash/save.c
+++ b/tests/stash/save.c
@@ -227,18 +227,12 @@ void test_stash_save__can_stash_against_a_detached_head(void)
void test_stash_save__stashing_updates_the_reflog(void)
{
- char *sha;
-
assert_object_oid("refs/stash@{0}", NULL, GIT_OBJ_COMMIT);
cl_git_pass(git_stash_save(&stash_tip_oid, repo, signature, NULL, GIT_STASH_DEFAULT));
- sha = git_oid_allocfmt(&stash_tip_oid);
-
- assert_object_oid("refs/stash@{0}", sha, GIT_OBJ_COMMIT);
+ assert_object_oid("refs/stash@{0}", git_oid_tostr_s(&stash_tip_oid), GIT_OBJ_COMMIT);
assert_object_oid("refs/stash@{1}", NULL, GIT_OBJ_COMMIT);
-
- git__free(sha);
}
void test_stash_save__cannot_stash_when_there_are_no_local_change(void)