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:
authorCarlos Martín Nieto <cmn@dwim.me>2015-01-07 15:23:05 +0300
committerCarlos Martín Nieto <cmn@dwim.me>2015-03-03 16:40:50 +0300
commit659cf2029f322ea876d663d85783b48945227e8f (patch)
tree435e9185c38d96656e21db83fc736b5294499b10 /tests/checkout
parent99b68a2aecfaa24f252f265d61b230b8e2576dd2 (diff)
Remove the signature from ref-modifying functions
The signature for the reflog is not something which changes dynamically. Almost all uses will be NULL, since we want for the repository's default identity to be used, making it noise. In order to allow for changing the identity, we instead provide git_repository_set_ident() and git_repository_ident() which allow a user to override the choice of signature.
Diffstat (limited to 'tests/checkout')
-rw-r--r--tests/checkout/crlf.c2
-rw-r--r--tests/checkout/tree.c36
-rw-r--r--tests/checkout/typechange.c4
3 files changed, 21 insertions, 21 deletions
diff --git a/tests/checkout/crlf.c b/tests/checkout/crlf.c
index ecbcc8a90..9d098a786 100644
--- a/tests/checkout/crlf.c
+++ b/tests/checkout/crlf.c
@@ -113,7 +113,7 @@ void test_checkout_crlf__detect_crlf_autocrlf_true_utf8(void)
cl_repo_set_bool(g_repo, "core.autocrlf", true);
- git_repository_set_head(g_repo, "refs/heads/utf8", NULL, NULL);
+ git_repository_set_head(g_repo, "refs/heads/utf8", NULL);
git_checkout_head(g_repo, &opts);
if (GIT_EOL_NATIVE == GIT_EOL_LF)
diff --git a/tests/checkout/tree.c b/tests/checkout/tree.c
index 7ba9c250f..982eaf628 100644
--- a/tests/checkout/tree.c
+++ b/tests/checkout/tree.c
@@ -63,7 +63,7 @@ void test_checkout_tree__can_checkout_and_remove_directory(void)
cl_git_pass(git_revparse_single(&g_object, g_repo, "subtrees"));
cl_git_pass(git_checkout_tree(g_repo, g_object, &g_opts));
- cl_git_pass(git_repository_set_head(g_repo, "refs/heads/subtrees", NULL, NULL));
+ cl_git_pass(git_repository_set_head(g_repo, "refs/heads/subtrees", NULL));
cl_assert_equal_i(true, git_path_isdir("./testrepo/ab/"));
cl_assert_equal_i(true, git_path_isfile("./testrepo/ab/de/2.txt"));
@@ -78,7 +78,7 @@ void test_checkout_tree__can_checkout_and_remove_directory(void)
cl_git_pass(git_revparse_single(&g_object, g_repo, "master"));
cl_git_pass(git_checkout_tree(g_repo, g_object, &g_opts));
- cl_git_pass(git_repository_set_head(g_repo, "refs/heads/master", NULL, NULL));
+ cl_git_pass(git_repository_set_head(g_repo, "refs/heads/master", NULL));
/* This directory should no longer exist */
cl_assert_equal_i(false, git_path_isdir("./testrepo/ab/"));
@@ -163,7 +163,7 @@ void test_checkout_tree__can_switch_branches(void)
cl_git_pass(git_object_lookup(&obj, g_repo, &oid, GIT_OBJ_ANY));
cl_git_pass(git_checkout_tree(g_repo, obj, &opts));
- cl_git_pass(git_repository_set_head(g_repo, "refs/heads/dir", NULL, NULL));
+ cl_git_pass(git_repository_set_head(g_repo, "refs/heads/dir", NULL));
cl_assert(git_path_isfile("testrepo/README"));
cl_assert(git_path_isfile("testrepo/branch_file.txt"));
@@ -183,7 +183,7 @@ void test_checkout_tree__can_switch_branches(void)
cl_git_pass(git_object_lookup(&obj, g_repo, &oid, GIT_OBJ_ANY));
cl_git_pass(git_checkout_tree(g_repo, obj, &opts));
- cl_git_pass(git_repository_set_head(g_repo, "refs/heads/subtrees", NULL, NULL));
+ cl_git_pass(git_repository_set_head(g_repo, "refs/heads/subtrees", NULL));
cl_assert(git_path_isfile("testrepo/README"));
cl_assert(git_path_isfile("testrepo/branch_file.txt"));
@@ -253,7 +253,7 @@ static int checkout_tree_with_blob_ignored_in_workdir(int strategy, bool isdir)
cl_git_pass(git_object_lookup(&obj, g_repo, &oid, GIT_OBJ_ANY));
cl_git_pass(git_checkout_tree(g_repo, obj, &opts));
- cl_git_pass(git_repository_set_head(g_repo, "refs/heads/dir", NULL, NULL));
+ cl_git_pass(git_repository_set_head(g_repo, "refs/heads/dir", NULL));
cl_assert(git_path_isfile("testrepo/README"));
cl_assert(git_path_isfile("testrepo/branch_file.txt"));
@@ -313,7 +313,7 @@ void test_checkout_tree__can_overwrite_ignored_by_default(void)
{
cl_git_pass(checkout_tree_with_blob_ignored_in_workdir(GIT_CHECKOUT_SAFE, false));
- cl_git_pass(git_repository_set_head(g_repo, "refs/heads/subtrees", NULL, NULL));
+ cl_git_pass(git_repository_set_head(g_repo, "refs/heads/subtrees", NULL));
cl_assert(git_path_isfile("testrepo/ab/4.txt"));
@@ -334,7 +334,7 @@ void test_checkout_tree__can_overwrite_ignored_folder_by_default(void)
{
cl_git_pass(checkout_tree_with_blob_ignored_in_workdir(GIT_CHECKOUT_SAFE, true));
- cl_git_pass(git_repository_set_head(g_repo, "refs/heads/subtrees", NULL, NULL));
+ cl_git_pass(git_repository_set_head(g_repo, "refs/heads/subtrees", NULL));
cl_assert(git_path_isfile("testrepo/ab/4.txt"));
@@ -367,7 +367,7 @@ void test_checkout_tree__can_update_only(void)
cl_git_pass(git_object_lookup(&obj, g_repo, &oid, GIT_OBJ_ANY));
cl_git_pass(git_checkout_tree(g_repo, obj, &opts));
- cl_git_pass(git_repository_set_head(g_repo, "refs/heads/dir", NULL, NULL));
+ cl_git_pass(git_repository_set_head(g_repo, "refs/heads/dir", NULL));
assert_on_branch(g_repo, "dir");
@@ -396,7 +396,7 @@ void test_checkout_tree__can_checkout_with_pattern(void)
cl_git_pass(git_checkout_tree(g_repo, g_object, &g_opts));
cl_git_pass(
- git_repository_set_head_detached(g_repo, git_object_id(g_object), NULL, NULL));
+ git_repository_set_head_detached(g_repo, git_object_id(g_object), NULL));
git_object_free(g_object);
g_object = NULL;
@@ -435,7 +435,7 @@ void test_checkout_tree__can_disable_pattern_match(void)
cl_git_pass(git_checkout_tree(g_repo, g_object, &g_opts));
cl_git_pass(
- git_repository_set_head_detached(g_repo, git_object_id(g_object), NULL, NULL));
+ git_repository_set_head_detached(g_repo, git_object_id(g_object), NULL));
git_object_free(g_object);
g_object = NULL;
@@ -481,11 +481,11 @@ void assert_conflict(
/* Create a branch pointing at the parent */
cl_git_pass(git_revparse_single(&g_object, g_repo, parent_sha));
cl_git_pass(git_branch_create(&branch, g_repo,
- "potential_conflict", (git_commit *)g_object, 0, NULL, NULL));
+ "potential_conflict", (git_commit *)g_object, 0, NULL));
/* Make HEAD point to this branch */
cl_git_pass(git_reference_symbolic_create(
- &head, g_repo, "HEAD", git_reference_name(branch), 1, NULL, NULL));
+ &head, g_repo, "HEAD", git_reference_name(branch), 1, NULL));
git_reference_free(head);
git_reference_free(branch);
@@ -572,7 +572,7 @@ void test_checkout_tree__donot_update_deleted_file_by_default(void)
cl_git_pass(git_oid_fromstr(&old_id, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644"));
cl_git_pass(git_commit_lookup(&old_commit, g_repo, &old_id));
- cl_git_pass(git_reset(g_repo, (git_object *)old_commit, GIT_RESET_HARD, NULL, NULL, NULL));
+ cl_git_pass(git_reset(g_repo, (git_object *)old_commit, GIT_RESET_HARD, NULL, NULL));
cl_git_pass(p_unlink("testrepo/branch_file.txt"));
cl_git_pass(git_index_remove_bypath(index ,"branch_file.txt"));
@@ -677,7 +677,7 @@ void test_checkout_tree__can_checkout_with_last_workdir_item_missing(void)
cl_git_pass(git_commit_lookup(&commit, g_repo, &commit_id));
cl_git_pass(git_checkout_tree(g_repo, (git_object *)commit, &opts));
- cl_git_pass(git_repository_set_head(g_repo, "refs/heads/master", NULL, NULL));
+ cl_git_pass(git_repository_set_head(g_repo, "refs/heads/master", NULL));
cl_git_pass(p_mkdir("./testrepo/this-is-dir", 0777));
cl_git_mkfile("./testrepo/this-is-dir/contained_file", "content\n");
@@ -1049,7 +1049,7 @@ void test_checkout_tree__case_changing_rename(void)
cl_git_pass(git_commit_lookup(&dir_commit, g_repo, &dir_commit_id));
cl_git_pass(git_checkout_tree(g_repo, (git_object *)dir_commit, &opts));
- cl_git_pass(git_repository_set_head(g_repo, "refs/heads/dir", NULL, NULL));
+ cl_git_pass(git_repository_set_head(g_repo, "refs/heads/dir", NULL));
cl_assert(git_path_isfile("testrepo/README"));
case_sensitive = !git_path_isfile("testrepo/readme");
@@ -1086,7 +1086,7 @@ void test_checkout_tree__case_changing_rename(void)
cl_git_pass(git_commit_lookup(&master_commit, g_repo, &master_id));
cl_git_pass(git_checkout_tree(g_repo, (git_object *)master_commit, &opts));
- cl_git_pass(git_repository_set_head(g_repo, "refs/heads/master", NULL, NULL));
+ cl_git_pass(git_repository_set_head(g_repo, "refs/heads/master", NULL));
assert_on_branch(g_repo, "master");
@@ -1201,7 +1201,7 @@ void test_checkout_tree__can_not_update_index(void)
cl_git_pass(git_reference_name_to_id(&oid, g_repo, "HEAD"));
cl_git_pass(git_object_lookup(&head, g_repo, &oid, GIT_OBJ_ANY));
- cl_git_pass(git_reset(g_repo, head, GIT_RESET_HARD, &g_opts, NULL, NULL));
+ cl_git_pass(git_reset(g_repo, head, GIT_RESET_HARD, &g_opts, NULL));
cl_assert_equal_i(false, git_path_isdir("./testrepo/ab/"));
@@ -1238,7 +1238,7 @@ void test_checkout_tree__can_update_but_not_write_index(void)
cl_git_pass(git_reference_name_to_id(&oid, g_repo, "HEAD"));
cl_git_pass(git_object_lookup(&head, g_repo, &oid, GIT_OBJ_ANY));
- cl_git_pass(git_reset(g_repo, head, GIT_RESET_HARD, &g_opts, NULL, NULL));
+ cl_git_pass(git_reset(g_repo, head, GIT_RESET_HARD, &g_opts, NULL));
cl_assert_equal_i(false, git_path_isdir("./testrepo/ab/"));
diff --git a/tests/checkout/typechange.c b/tests/checkout/typechange.c
index c32330950..330341846 100644
--- a/tests/checkout/typechange.c
+++ b/tests/checkout/typechange.c
@@ -122,7 +122,7 @@ void test_checkout_typechange__checkout_typechanges_safe(void)
cl_git_pass(git_checkout_tree(g_repo, obj, &opts));
cl_git_pass(
- git_repository_set_head_detached(g_repo, git_object_id(obj), NULL, NULL));
+ git_repository_set_head_detached(g_repo, git_object_id(obj), NULL));
assert_workdir_matches_tree(g_repo, git_object_id(obj), NULL, true);
@@ -231,7 +231,7 @@ void test_checkout_typechange__checkout_with_conflicts(void)
cl_assert(!git_path_exists("typechanges/untracked"));
cl_git_pass(
- git_repository_set_head_detached(g_repo, git_object_id(obj), NULL, NULL));
+ git_repository_set_head_detached(g_repo, git_object_id(obj), NULL));
assert_workdir_matches_tree(g_repo, git_object_id(obj), NULL, true);