Commit db092c1955ff5079d8ca475bbe1d6b0da782b38e

Ben Straub 2014-01-30T16:10:18

Allow tests to run without user config

diff --git a/tests/refs/branches/create.c b/tests/refs/branches/create.c
index 06dcca5..abe5f59 100644
--- a/tests/refs/branches/create.c
+++ b/tests/refs/branches/create.c
@@ -100,6 +100,12 @@ void test_refs_branches_create__default_reflog_message(void)
 	git_reflog *log;
 	const git_reflog_entry *entry;
 	git_signature *sig;
+	git_config *cfg;
+
+	cl_git_pass(git_repository_config(&cfg, repo));
+	cl_git_pass(git_config_set_string(cfg, "user.name", "Foo Bar"));
+	cl_git_pass(git_config_set_string(cfg, "user.email", "foo@example.com"));
+	git_config_free(cfg);
 
 	cl_git_pass(git_signature_default(&sig, repo));
 
diff --git a/tests/refs/branches/move.c b/tests/refs/branches/move.c
index 3d2c815..6c6dbbe 100644
--- a/tests/refs/branches/move.c
+++ b/tests/refs/branches/move.c
@@ -218,6 +218,12 @@ void test_refs_branches_move__default_reflog_message(void)
 	git_reflog *log;
 	const git_reflog_entry *entry;
 	git_signature *sig;
+	git_config *cfg;
+
+	cl_git_pass(git_repository_config(&cfg, repo));
+	cl_git_pass(git_config_set_string(cfg, "user.name", "Foo Bar"));
+	cl_git_pass(git_config_set_string(cfg, "user.email", "foo@example.com"));
+	git_config_free(cfg);
 
 	cl_git_pass(git_signature_default(&sig, repo));