Web lists-archives.com

[RFC 09/10] FIXME: submodule: pass custom gitmodules file to 'test-tool submodule-config'




Add a new option to 't/helper/test-submodule-config.c' to set a custom
path for the gitmodules file.

In particular this is needed to make 't/t7411-submodule-config.sh' pass.

The option is actually put in use by the script that patches the test
suite.
---
 t/helper/test-submodule-config.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/t/helper/test-submodule-config.c b/t/helper/test-submodule-config.c
index 5c6e4b010..30b4ea3da 100644
--- a/t/helper/test-submodule-config.c
+++ b/t/helper/test-submodule-config.c
@@ -25,6 +25,13 @@ int cmd__submodule_config(int argc, const char **argv)
 			output_url = 1;
 		if (!strcmp(arg[0], "--name"))
 			lookup_name = 1;
+		if (!strcmp(arg[0], "--submodules_file")) {
+			arg++;
+			my_argc--;
+			submodules_file = expand_user_path(arg[0], 0);
+			if (!submodules_file)
+				die(_("failed to expand user dir in: '%s'"), arg[0]);
+		}
 		arg++;
 		my_argc--;
 	}
-- 
2.17.0