[PATCH 13/16] test-config: setup git directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The t1308 test script uses our test-config helper to read
repository-level config, but never actually sets up the
repository. This works because git_config() blindly reads
".git/config" even if we have not configured a repository.

This means that test-config won't work from a subdirectory,
though since it's just a helper for the test scripts, that's
not a big deal.

More important is that the behavior of git_config() is going
to change, and we want to make sure that t1308 continues to
work. We can just use setup_git_directory(), and not the
gentle form; there's no point in being flexible, as it's
just a helper for the tests.

Signed-off-by: Jeff King <peff@xxxxxxxx>
---
 t/helper/test-config.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/t/helper/test-config.c b/t/helper/test-config.c
index 3c6d08c..83a4f2a 100644
--- a/t/helper/test-config.c
+++ b/t/helper/test-config.c
@@ -72,6 +72,9 @@ int cmd_main(int argc, const char **argv)
 	const char *v;
 	const struct string_list *strptr;
 	struct config_set cs;
+
+	setup_git_directory();
+
 	git_configset_init(&cs);
 
 	if (argc < 2) {
-- 
2.10.0.230.g6f8d04b




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]