On Wed, Sep 2, 2015 at 5:42 PM, Stefan Beller <[email protected]> wrote:
> This reimplements the helper function `module_clone` in shell
> in C as `clone`. This functionality is needed for converting
> `git submodule update` later on, which we want to add threading
> to.
>
> Signed-off-by: Stefan Beller <[email protected]>
> ---
> +static int module_clone(int argc, const char **argv, const char *prefix)
> +{
> + /* Write a .git file in the submodule to redirect to the
> superproject. */
> + if (safe_create_leading_directories_const(path) < 0)
> + die(_("could not create directory '%s'"), path);
> +
> + if (path && *path)
> + strbuf_addf(&sb, "%s/.git", path);
> + else
> + strbuf_addf(&sb, ".git");
Minor: strbuf_addstr(...);
> + if (safe_create_leading_directories_const(sb.buf) < 0)
> + die(_("could not create leading directories of '%s'"),
> sb.buf);
> + submodule_dot_git = fopen(sb.buf, "w");
> + if (!submodule_dot_git)
> + die_errno(_("cannot open file '%s'"), sb.buf);
> +}
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html