summaryrefslogtreecommitdiff
path: root/tests/refs/reflog/reflog.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2013-11-23 14:13:01 +0100
committerCarlos Martín Nieto <cmn@dwim.me>2013-12-09 15:55:11 +0100
commit8d5ec9106afbca346a8def84ef20de0a7ba2240a (patch)
tree83dea84e33442fa8e4c58321a246b08b52c5fc0e /tests/refs/reflog/reflog.c
parent6f13a30565fc3891c0df161945097b316945fca7 (diff)
downloadlibgit2-8d5ec9106afbca346a8def84ef20de0a7ba2240a.tar.gz
refs: expose a way to ensure a ref has a log
Sometimes (e.g. stash) we want to make sure that a log will be written, even if it's not in one of the standard locations. Let's make that easier.
Diffstat (limited to 'tests/refs/reflog/reflog.c')
-rw-r--r--tests/refs/reflog/reflog.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/tests/refs/reflog/reflog.c b/tests/refs/reflog/reflog.c
index 6c9375dc7..9f414f21d 100644
--- a/tests/refs/reflog/reflog.c
+++ b/tests/refs/reflog/reflog.c
@@ -212,12 +212,9 @@ void test_refs_reflog_reflog__write_when_explicitly_active(void)
{
git_reference *ref;
git_oid id;
- git_buf path = GIT_BUF_INIT;
git_oid_fromstr(&id, current_master_tip);
- cl_git_pass(git_buf_join(&path, '/', git_repository_path(g_repo), "logs/refs/tags/foo"));
- cl_git_pass(git_futils_mkpath2file(git_buf_cstr(&path), 0777));
- cl_git_mkfile(git_buf_cstr(&path), "");
+ git_reference_ensure_log(g_repo, "refs/tags/foo");
cl_git_pass(git_reference_create(&ref, g_repo, "refs/tags/foo", &id, 1));
git_reference_free(ref);