summaryrefslogtreecommitdiff
path: root/submodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'submodule.c')
-rw-r--r--submodule.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/submodule.c b/submodule.c
index b12600f..63e7094 100644
--- a/submodule.c
+++ b/submodule.c
@@ -503,7 +503,7 @@ static void show_submodule_header(struct diff_options *o, const char *path,
if (add_submodule_odb(path)) {
if (!message)
- message = "(not initialized)";
+ message = "(commits not present)";
goto output_header;
}
@@ -1685,7 +1685,7 @@ static int find_first_merges(struct object_array *result, const char *path,
add_object_array(merges.objects[i].item, NULL, result);
}
- free(merges.objects);
+ object_array_clear(&merges);
return result->nr;
}
@@ -1790,7 +1790,7 @@ int merge_submodule(struct object_id *result, const char *path,
print_commit((struct commit *) merges.objects[i].item);
}
- free(merges.objects);
+ object_array_clear(&merges);
return 0;
}
@@ -1997,6 +1997,10 @@ const char *get_superproject_working_tree(void)
return ret;
}
+/*
+ * Put the gitdir for a submodule (given relative to the main
+ * repository worktree) into `buf`, or return -1 on error.
+ */
int submodule_to_gitdir(struct strbuf *buf, const char *submodule)
{
const struct submodule *sub;