diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2015-03-07 00:30:40 +0100 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2015-03-16 16:57:30 +0100 |
commit | a5815a2afb7f6a0e86d52467b99d06d9bf01a9fb (patch) | |
tree | 0f341027c5d9772b58095c1315a978a491dd888f /tests/repo | |
parent | 62dd4d71db1408ae03ca7d4d4d2c48f7874a41d9 (diff) | |
download | libgit2-a5815a2afb7f6a0e86d52467b99d06d9bf01a9fb.tar.gz |
Add tests for the annotated versions of ref-modifying functions
This also brings the soft-reset tests back to life. The function name
was missing an underscore, meaning they had not been running.
Diffstat (limited to 'tests/repo')
-rw-r--r-- | tests/repo/head.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/repo/head.c b/tests/repo/head.c index b26d6acc7..31c228777 100644 --- a/tests/repo/head.c +++ b/tests/repo/head.c @@ -2,6 +2,7 @@ #include "refs.h" #include "repo_helpers.h" #include "posix.h" +#include "git2/annotated_commit.h" static const char *g_email = "foo@example.com"; static git_repository *repo; @@ -251,6 +252,7 @@ void test_repo_head__setting_head_updates_reflog(void) { git_object *tag; git_signature *sig; + git_annotated_commit *annotated; cl_git_pass(git_signature_now(&sig, "me", "foo@example.com")); @@ -264,6 +266,12 @@ void test_repo_head__setting_head_updates_reflog(void) test_reflog(repo, 1, NULL, "tags/test^{commit}", "foo@example.com", "checkout: moving from unborn to e90810b8df3e80c413d903f631643c716887138d"); test_reflog(repo, 0, "tags/test^{commit}", "refs/heads/haacked", "foo@example.com", "checkout: moving from e90810b8df3e80c413d903f631643c716887138d to haacked"); + cl_git_pass(git_annotated_commit_from_revspec(&annotated, repo, "haacked~0")); + cl_git_pass(git_repository_set_head_detached_from_annotated(repo, annotated)); + + test_reflog(repo, 0, NULL, "refs/heads/haacked", "foo@example.com", "checkout: moving from haacked to haacked~0"); + + git_annotated_commit_free(annotated); git_object_free(tag); git_signature_free(sig); } |