reflog: rename git_reflog_write() to git_reflog_append()
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
diff --git a/include/git2/reflog.h b/include/git2/reflog.h
index 7467e81..1de870b 100644
--- a/include/git2/reflog.h
+++ b/include/git2/reflog.h
@@ -33,7 +33,7 @@ GIT_BEGIN_DECL
GIT_EXTERN(int) git_reflog_read(git_reflog **reflog, git_reference *ref);
/**
- * Write a new reflog for the given reference
+ * Add a new entry to the reflog for the given reference
*
* If there is no reflog file for the given
* reference yet, it will be created.
@@ -48,7 +48,7 @@ GIT_EXTERN(int) git_reflog_read(git_reflog **reflog, git_reference *ref);
* @param msg the reflog message
* @return 0 or an error code
*/
-GIT_EXTERN(int) git_reflog_write(git_reference *ref, const git_oid *oid_old, const git_signature *committer, const char *msg);
+GIT_EXTERN(int) git_reflog_append(git_reference *ref, const git_oid *oid_old, const git_signature *committer, const char *msg);
/**
* Rename the reflog for the given reference
diff --git a/src/reflog.c b/src/reflog.c
index 8e9d973..b2820cd 100644
--- a/src/reflog.c
+++ b/src/reflog.c
@@ -216,7 +216,7 @@ int git_reflog_read(git_reflog **reflog, git_reference *ref)
return error;
}
-int git_reflog_write(git_reference *ref, const git_oid *oid_old,
+int git_reflog_append(git_reference *ref, const git_oid *oid_old,
const git_signature *committer, const char *msg)
{
int error;
diff --git a/tests-clar/refs/reflog/reflog.c b/tests-clar/refs/reflog/reflog.c
index fb69dd2..08b7754 100644
--- a/tests-clar/refs/reflog/reflog.c
+++ b/tests-clar/refs/reflog/reflog.c
@@ -36,7 +36,7 @@ void test_refs_reflog_reflog__cleanup(void)
-void test_refs_reflog_reflog__write_then_read(void)
+void test_refs_reflog_reflog__append_then_read(void)
{
// write a reflog for a given reference and ensure it can be read back
git_repository *repo2;
@@ -55,10 +55,10 @@ void test_refs_reflog_reflog__write_then_read(void)
cl_git_pass(git_signature_now(&committer, "foo", "foo@bar"));
- cl_git_pass(git_reflog_write(ref, NULL, committer, NULL));
- cl_git_fail(git_reflog_write(ref, NULL, committer, "no ancestor NULL for an existing reflog"));
- cl_git_fail(git_reflog_write(ref, NULL, committer, "no\nnewline"));
- cl_git_pass(git_reflog_write(ref, &oid, committer, commit_msg));
+ cl_git_pass(git_reflog_append(ref, NULL, committer, NULL));
+ cl_git_fail(git_reflog_append(ref, NULL, committer, "no ancestor NULL for an existing reflog"));
+ cl_git_fail(git_reflog_append(ref, NULL, committer, "no\nnewline"));
+ cl_git_pass(git_reflog_append(ref, &oid, committer, commit_msg));
/* Reopen a new instance of the repository */
cl_git_pass(git_repository_open(&repo2, "testrepo.git"));
@@ -94,7 +94,7 @@ void test_refs_reflog_reflog__write_then_read(void)
git_reference_free(lookedup_ref);
}
-void test_refs_reflog_reflog__dont_write_bad(void)
+void test_refs_reflog_reflog__dont_append_bad(void)
{
// avoid writing an obviously wrong reflog
git_reference *ref;
@@ -110,12 +110,12 @@ void test_refs_reflog_reflog__dont_write_bad(void)
cl_git_pass(git_signature_now(&committer, "foo", "foo@bar"));
/* Write the reflog for the new branch */
- cl_git_pass(git_reflog_write(ref, NULL, committer, NULL));
+ cl_git_pass(git_reflog_append(ref, NULL, committer, NULL));
/* Try to update the reflog with wrong information:
* It's no new reference, so the ancestor OID cannot
* be NULL. */
- cl_git_fail(git_reflog_write(ref, NULL, committer, NULL));
+ cl_git_fail(git_reflog_append(ref, NULL, committer, NULL));
git_signature_free(committer);