summaryrefslogtreecommitdiff
path: root/tests/libgit2/online/clone.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2022-11-23 22:05:29 +0000
committerEdward Thomson <ethomson@edwardthomson.com>2023-02-12 22:02:00 +0000
commit0006ff63359358bc5e65ea5a2b6ef7ba5eca2e8e (patch)
tree718faf6e1bb532226d155de91897e4f4bf2bb227 /tests/libgit2/online/clone.c
parent7186d7baadfe3e5e129710e07bdd57b1c7c0e862 (diff)
downloadlibgit2-0006ff63359358bc5e65ea5a2b6ef7ba5eca2e8e.tar.gz
clone: support sha256
Diffstat (limited to 'tests/libgit2/online/clone.c')
-rw-r--r--tests/libgit2/online/clone.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/libgit2/online/clone.c b/tests/libgit2/online/clone.c
index 96ff66ae0..70ec4ef1a 100644
--- a/tests/libgit2/online/clone.c
+++ b/tests/libgit2/online/clone.c
@@ -1058,3 +1058,22 @@ void test_online_clone__namespace_with_specified_branch(void)
git_reference_free(head);
}
+
+void test_online_clone__sha256(void)
+{
+#ifndef GIT_EXPERIMENTAL_SHA256
+ cl_skip();
+#else
+ git_clone_options options = GIT_CLONE_OPTIONS_INIT;
+ git_reference *head;
+
+ if (!_remote_url)
+ cl_skip();
+
+ cl_git_pass(git_clone(&g_repo, _remote_url, "./sha256", &options));
+ cl_git_pass(git_reference_lookup(&head, g_repo, GIT_HEAD_FILE));
+ cl_assert_equal_i(GIT_REFERENCE_SYMBOLIC, git_reference_type(head));
+
+ git_reference_free(head);
+#endif
+}