summaryrefslogtreecommitdiff
path: root/tests-clar/repo
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-09-05 15:06:42 -0700
committerRussell Belfer <rb@github.com>2013-09-17 09:31:46 -0700
commit155fa2342d838bdb2aa873c95a42e091351bb69a (patch)
tree4441514a2ad0b4cb2c0e088e03864b9d9f7acbe6 /tests-clar/repo
parent13f36ffb9e1c4fb70b44a477d716873fecfc0407 (diff)
downloadlibgit2-155fa2342d838bdb2aa873c95a42e091351bb69a.tar.gz
Add clar helper to create new commit from index
There were a lot of places in the test code base that were creating a commit from the index on the current branch. This just adds a helper to handle that case pretty easily. There was only one test where this change ended up tweaking the test data, so pretty easy and mostly just a cleanup.
Diffstat (limited to 'tests-clar/repo')
-rw-r--r--tests-clar/repo/init.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests-clar/repo/init.c b/tests-clar/repo/init.c
index e3fc112b3..caa211e75 100644
--- a/tests-clar/repo/init.c
+++ b/tests-clar/repo/init.c
@@ -565,6 +565,11 @@ void test_repo_init__init_with_initial_commit(void)
cl_git_pass(git_index_add_bypath(index, "file.txt"));
cl_git_pass(git_index_write(index));
+ /* Intentionally not using cl_repo_commit_from_index here so this code
+ * can be used as an example of how an initial commit is typically
+ * made to a repository...
+ */
+
/* Make sure we're ready to use git_signature_default :-) */
{
git_config *cfg, *local;