From: Jacob Keller <jacob.kel...@gmail.com>

This series implements ability to pass the credential.* configuration
variables from the command line directly into the submodule. The other
patches in this series are small fixups noticed along the way.

--> Interdiff between v5 and v6 <--

diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c
index 43943eef81b4..3d37c3f1822d 100644
--- a/builtin/submodule--helper.c
+++ b/builtin/submodule--helper.c
@@ -140,18 +140,18 @@ static int submodule_config_ok(const char *var)
 
 static int sanitize_submodule_config(const char *var, const char *value, void 
*data)
 {
-       struct strbuf quoted = STRBUF_INIT;
        struct strbuf *out = data;
 
        if (submodule_config_ok(var)) {
                if (out->len)
                        strbuf_addch(out, ' ');
 
-               sq_quotef(out, "%s=%s", var, value);
+               if (value)
+                       sq_quotef(out, "%s=%s", var, value);
+               else
+                       sq_quote_buf(out, var);
        }
 
-       strbuf_release(&quoted);
-
        return 0;
 }
 
@@ -235,16 +235,17 @@ static int module_clone(int argc, const char **argv, 
const char *prefix)
 
        const char *const git_submodule_helper_usage[] = {
                N_("git submodule--helper clone [--prefix=<path>] [--quiet] "
-                  "[--reference <repository>] [--name <name>] [--url <url>]"
-                  "[--depth <depth>] [--path <path>]"),
+                  "[--reference <repository>] [--name <name>] [--depth 
<depth>] "
+                  "--url <url> --path <path>"),
                NULL
        };
 
        argc = parse_options(argc, argv, prefix, module_clone_options,
                             git_submodule_helper_usage, 0);
 
-       if (argc)
-               usage(*git_submodule_helper_usage);
+       if (argc || !url || !path)
+               usage_with_options(git_submodule_helper_usage,
+                                  module_clone_options);
 
        strbuf_addf(&sb, "%s/modules/%s", get_git_dir(), name);
        sm_gitdir = strbuf_detach(&sb, NULL);

Jacob Keller (6):
  submodule: don't pass empty string arguments to submodule--helper
    clone
  submodule: check argc count for git submodule--helper clone
  submodule: fix submodule--helper clone usage
  submodule: fix segmentation fault in submodule--helper clone
  quote: implement sq_quotef()
  git: submodule honor -c credential.* from command line

Michael J Gruber (1):
  t/lib-httpd: load mod_unixd

 builtin/submodule--helper.c  | 76 ++++++++++++++++++++++++++++++++++++++++++--
 git-submodule.sh             | 40 ++++++++++++++---------
 quote.c                      | 13 ++++++++
 quote.h                      |  3 ++
 t/lib-httpd/apache.conf      |  3 ++
 t/t5550-http-fetch-dumb.sh   | 17 ++++++++++
 t/t7412-submodule--helper.sh | 26 +++++++++++++++
 7 files changed, 160 insertions(+), 18 deletions(-)
 create mode 100755 t/t7412-submodule--helper.sh

-- 
2.7.1.429.g45cd78e

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to