Commit b84f75c3 by Vicent Marti

reflog: Rename `entry_drop` to `drop`

parent 43b67d49
...@@ -109,7 +109,7 @@ GIT_EXTERN(const git_reflog_entry *) git_reflog_entry_byindex(git_reflog *reflog ...@@ -109,7 +109,7 @@ GIT_EXTERN(const git_reflog_entry *) git_reflog_entry_byindex(git_reflog *reflog
* *
* @return 0 on success or an error code. * @return 0 on success or an error code.
*/ */
GIT_EXTERN(int) git_reflog_entry_drop( GIT_EXTERN(int) git_reflog_drop(
git_reflog *reflog, git_reflog *reflog,
unsigned int idx, unsigned int idx,
int rewrite_previous_entry); int rewrite_previous_entry);
......
...@@ -439,7 +439,7 @@ char * git_reflog_entry_msg(const git_reflog_entry *entry) ...@@ -439,7 +439,7 @@ char * git_reflog_entry_msg(const git_reflog_entry *entry)
return entry->msg; return entry->msg;
} }
int git_reflog_entry_drop( int git_reflog_drop(
git_reflog *reflog, git_reflog *reflog,
unsigned int idx, unsigned int idx,
int rewrite_previous_entry) int rewrite_previous_entry)
......
...@@ -28,7 +28,7 @@ void test_refs_reflog_drop__cleanup(void) ...@@ -28,7 +28,7 @@ void test_refs_reflog_drop__cleanup(void)
void test_refs_reflog_drop__dropping_a_non_exisiting_entry_from_the_log_returns_ENOTFOUND(void) void test_refs_reflog_drop__dropping_a_non_exisiting_entry_from_the_log_returns_ENOTFOUND(void)
{ {
cl_assert_equal_i(GIT_ENOTFOUND, git_reflog_entry_drop(g_reflog, entrycount, 0)); cl_assert_equal_i(GIT_ENOTFOUND, git_reflog_drop(g_reflog, entrycount, 0));
cl_assert_equal_i(entrycount, git_reflog_entrycount(g_reflog)); cl_assert_equal_i(entrycount, git_reflog_entrycount(g_reflog));
} }
...@@ -37,7 +37,7 @@ void test_refs_reflog_drop__can_drop_an_entry(void) ...@@ -37,7 +37,7 @@ void test_refs_reflog_drop__can_drop_an_entry(void)
{ {
cl_assert(entrycount > 4); cl_assert(entrycount > 4);
cl_git_pass(git_reflog_entry_drop(g_reflog, 2, 0)); cl_git_pass(git_reflog_drop(g_reflog, 2, 0));
cl_assert_equal_i(entrycount - 1, git_reflog_entrycount(g_reflog)); cl_assert_equal_i(entrycount - 1, git_reflog_entrycount(g_reflog));
} }
...@@ -53,7 +53,7 @@ void test_refs_reflog_drop__can_drop_an_entry_and_rewrite_the_log_history(void) ...@@ -53,7 +53,7 @@ void test_refs_reflog_drop__can_drop_an_entry_and_rewrite_the_log_history(void)
before_next = git_reflog_entry_byindex(g_reflog, 1); before_next = git_reflog_entry_byindex(g_reflog, 1);
git_oid_cpy(&before_next_old_oid, &before_next->oid_old); git_oid_cpy(&before_next_old_oid, &before_next->oid_old);
cl_git_pass(git_reflog_entry_drop(g_reflog, 2, 1)); cl_git_pass(git_reflog_drop(g_reflog, 2, 1));
cl_assert_equal_i(entrycount - 1, git_reflog_entrycount(g_reflog)); cl_assert_equal_i(entrycount - 1, git_reflog_entrycount(g_reflog));
after_next = git_reflog_entry_byindex(g_reflog, 1); after_next = git_reflog_entry_byindex(g_reflog, 1);
...@@ -67,7 +67,7 @@ void test_refs_reflog_drop__can_drop_the_first_entry(void) ...@@ -67,7 +67,7 @@ void test_refs_reflog_drop__can_drop_the_first_entry(void)
{ {
cl_assert(entrycount > 2); cl_assert(entrycount > 2);
cl_git_pass(git_reflog_entry_drop(g_reflog, 0, 0)); cl_git_pass(git_reflog_drop(g_reflog, 0, 0));
cl_assert_equal_i(entrycount - 1, git_reflog_entrycount(g_reflog)); cl_assert_equal_i(entrycount - 1, git_reflog_entrycount(g_reflog));
} }
...@@ -77,7 +77,7 @@ void test_refs_reflog_drop__can_drop_the_last_entry(void) ...@@ -77,7 +77,7 @@ void test_refs_reflog_drop__can_drop_the_last_entry(void)
cl_assert(entrycount > 2); cl_assert(entrycount > 2);
cl_git_pass(git_reflog_entry_drop(g_reflog, entrycount - 1, 0)); cl_git_pass(git_reflog_drop(g_reflog, entrycount - 1, 0));
cl_assert_equal_i(entrycount - 1, git_reflog_entrycount(g_reflog)); cl_assert_equal_i(entrycount - 1, git_reflog_entrycount(g_reflog));
entry = git_reflog_entry_byindex(g_reflog, entrycount - 2); entry = git_reflog_entry_byindex(g_reflog, entrycount - 2);
...@@ -90,7 +90,7 @@ void test_refs_reflog_drop__can_drop_the_last_entry_and_rewrite_the_log_history( ...@@ -90,7 +90,7 @@ void test_refs_reflog_drop__can_drop_the_last_entry_and_rewrite_the_log_history(
cl_assert(entrycount > 2); cl_assert(entrycount > 2);
cl_git_pass(git_reflog_entry_drop(g_reflog, entrycount - 1, 1)); cl_git_pass(git_reflog_drop(g_reflog, entrycount - 1, 1));
cl_assert_equal_i(entrycount - 1, git_reflog_entrycount(g_reflog)); cl_assert_equal_i(entrycount - 1, git_reflog_entrycount(g_reflog));
entry = git_reflog_entry_byindex(g_reflog, entrycount - 2); entry = git_reflog_entry_byindex(g_reflog, entrycount - 2);
...@@ -102,10 +102,10 @@ void test_refs_reflog_drop__can_drop_all_the_entries(void) ...@@ -102,10 +102,10 @@ void test_refs_reflog_drop__can_drop_all_the_entries(void)
cl_assert(--entrycount > 0); cl_assert(--entrycount > 0);
do { do {
cl_git_pass(git_reflog_entry_drop(g_reflog, --entrycount, 1)); cl_git_pass(git_reflog_drop(g_reflog, --entrycount, 1));
} while (entrycount > 0); } while (entrycount > 0);
cl_git_pass(git_reflog_entry_drop(g_reflog, 0, 1)); cl_git_pass(git_reflog_drop(g_reflog, 0, 1));
cl_assert_equal_i(0, git_reflog_entrycount(g_reflog)); cl_assert_equal_i(0, git_reflog_entrycount(g_reflog));
} }
...@@ -117,7 +117,7 @@ void test_refs_reflog_drop__can_persist_deletion_on_disk(void) ...@@ -117,7 +117,7 @@ void test_refs_reflog_drop__can_persist_deletion_on_disk(void)
cl_assert(entrycount > 2); cl_assert(entrycount > 2);
cl_git_pass(git_reference_lookup(&ref, g_repo, g_reflog->ref_name)); cl_git_pass(git_reference_lookup(&ref, g_repo, g_reflog->ref_name));
cl_git_pass(git_reflog_entry_drop(g_reflog, entrycount - 1, 1)); cl_git_pass(git_reflog_drop(g_reflog, entrycount - 1, 1));
cl_assert_equal_i(entrycount - 1, git_reflog_entrycount(g_reflog)); cl_assert_equal_i(entrycount - 1, git_reflog_entrycount(g_reflog));
cl_git_pass(git_reflog_write(g_reflog)); cl_git_pass(git_reflog_write(g_reflog));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment