]> git.ipfire.org Git - thirdparty/git.git/blobdiff - submodule.c
reftable/block: open-code call to `uncompress2()`
[thirdparty/git.git] / submodule.c
index 40f13a36857179c39d31891396c892c5b7e54f72..ce2d03252157f6cb5c83ec7d8110ef71d7152830 100644 (file)
@@ -592,7 +592,12 @@ static void show_submodule_header(struct diff_options *o,
             (!is_null_oid(two) && !*right))
                message = "(commits not present)";
 
-       *merge_bases = repo_get_merge_bases(sub, *left, *right);
+       *merge_bases = NULL;
+       if (repo_get_merge_bases(sub, *left, *right, merge_bases) < 0) {
+               message = "(corrupt repository)";
+               goto output_header;
+       }
+
        if (*merge_bases) {
                if ((*merge_bases)->item == *left)
                        fast_forward = 1;
@@ -2041,7 +2046,7 @@ void submodule_unset_core_worktree(const struct submodule *sub)
        submodule_name_to_gitdir(&config_path, the_repository, sub->name);
        strbuf_addstr(&config_path, "/config");
 
-       if (git_config_set_in_file_gently(config_path.buf, "core.worktree", NULL))
+       if (git_config_set_in_file_gently(config_path.buf, "core.worktree", NULL, NULL))
                warning(_("Could not unset core.worktree setting in submodule '%s'"),
                          sub->path);