#include "worktree.h"
#include "parse-options.h"
#include "object-store.h"
+#include "commit-reach.h"
static int config_update_recurse_submodules = RECURSE_SUBMODULES_OFF;
static struct string_list changed_submodule_names = STRING_LIST_INIT_DUP;
* 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
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;
}
}
argv_array_push(&args, "--"); /* args[0] program name */
argv_array_push(&args, oid_to_hex(incl_oid));
- argv_array_push(&args, "--not");
- argv_array_push(&args, oid_to_hex(excl_oid));
+ if (!is_null_oid(excl_oid)) {
+ argv_array_push(&args, "--not");
+ argv_array_push(&args, oid_to_hex(excl_oid));
+ }
collect_changed_submodules(&subs, &args);
ret = subs.nr;