diff options
Diffstat (limited to 'merge-tree.c')
-rw-r--r-- | merge-tree.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/merge-tree.c b/merge-tree.c index 02fc10f7e6..f01e7c81ae 100644 --- a/merge-tree.c +++ b/merge-tree.c @@ -2,8 +2,9 @@ #include "tree-walk.h" #include "xdiff-interface.h" #include "blob.h" +#include "exec_cmd.h" -static const char merge_tree_usage[] = "git-merge-tree <base-tree> <branch1> <branch2>"; +static const char merge_tree_usage[] = "git merge-tree <base-tree> <branch1> <branch2>"; static int resolve_directories = 1; struct merge_list { @@ -158,9 +159,8 @@ static int same_entry(struct name_entry *a, struct name_entry *b) static struct merge_list *create_entry(unsigned stage, unsigned mode, const unsigned char *sha1, const char *path) { - struct merge_list *res = xmalloc(sizeof(*res)); + struct merge_list *res = xcalloc(1, sizeof(*res)); - memset(res, 0, sizeof(*res)); res->stage = stage; res->path = path; res->mode = mode; @@ -345,6 +345,8 @@ int main(int argc, char **argv) if (argc != 4) usage(merge_tree_usage); + git_extract_argv0_path(argv[0]); + setup_git_directory(); buf1 = get_tree_descriptor(t+0, argv[1]); |