]> git.ipfire.org Git - thirdparty/git.git/blobdiff - submodule.c
t5318: avoid unnecessary command substitutions
[thirdparty/git.git] / submodule.c
index 939d6870ecd7cfbc62f9fa3fb867e5c7362ed9bd..6688dd5d45949597d7d5761c9b88ea9fcceabf2d 100644 (file)
@@ -517,8 +517,8 @@ static void show_submodule_header(struct diff_options *o, const char *path,
         * Attempt to lookup the commit references, and determine if this is
         * a fast forward or fast backwards update.
         */
-       *left = lookup_commit_reference(one);
-       *right = lookup_commit_reference(two);
+       *left = lookup_commit_reference(the_repository, one);
+       *right = lookup_commit_reference(the_repository, two);
 
        /*
         * Warn about missing commits in the submodule project, but only if
@@ -740,12 +740,14 @@ static void collect_changed_submodules_cb(struct diff_queue_struct *q,
                else {
                        name = default_name_or_path(p->two->path);
                        /* make sure name does not collide with existing one */
-                       submodule = submodule_from_name(the_repository, commit_oid, name);
+                       if (name)
+                               submodule = submodule_from_name(the_repository,
+                                                               commit_oid, name);
                        if (submodule) {
                                warning("Submodule in commit %s at path: "
                                        "'%s' collides with a submodule named "
                                        "the same. Skipping it.",
-                                       oid_to_hex(commit_oid), name);
+                                       oid_to_hex(commit_oid), p->two->path);
                                name = NULL;
                        }
                }