Commit d284b3de631edeaa651bf3ee2c5963cb970016c4

nulltoken 2012-07-16T12:12:53

reflog: rename git_reflog_write() to git_reflog_append()

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);