summaryrefslogtreecommitdiff
path: root/tests-clar/online/fetchhead.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests-clar/online/fetchhead.c')
-rw-r--r--tests-clar/online/fetchhead.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests-clar/online/fetchhead.c b/tests-clar/online/fetchhead.c
index a8a5bb918..58717eef8 100644
--- a/tests-clar/online/fetchhead.c
+++ b/tests-clar/online/fetchhead.c
@@ -1,6 +1,6 @@
#include "clar_libgit2.h"
-#include "repository.h"
+#include "fileops.h"
#include "fetchhead.h"
#include "../fetchhead/fetchhead_data.h"
#include "git2/clone.h"
@@ -42,8 +42,10 @@ static void fetchhead_test_fetch(const char *fetchspec, const char *expected_fet
cl_git_pass(git_remote_load(&remote, g_repo, "origin"));
git_remote_set_autotag(remote, GIT_REMOTE_DOWNLOAD_TAGS_AUTO);
- if(fetchspec != NULL)
- git_remote_set_fetchspec(remote, fetchspec);
+ if(fetchspec != NULL) {
+ git_remote_clear_refspecs(remote);
+ git_remote_add_fetch(remote, fetchspec);
+ }
cl_git_pass(git_remote_connect(remote, GIT_DIRECTION_FETCH));
cl_git_pass(git_remote_download(remote, NULL, NULL));