diff options
Diffstat (limited to 'builtin/merge-tree.c')
-rw-r--r-- | builtin/merge-tree.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/builtin/merge-tree.c b/builtin/merge-tree.c index f12da292cf..bf01e05808 100644 --- a/builtin/merge-tree.c +++ b/builtin/merge-tree.c @@ -2,7 +2,7 @@ #include "tree-walk.h" #include "xdiff-interface.h" #include "blob.h" -#include "exec_cmd.h" +#include "exec-cmd.h" #include "merge-blobs.h" static const char merge_tree_usage[] = "git merge-tree <base-tree> <branch1> <branch2>"; @@ -60,7 +60,7 @@ static void *result(struct merge_list *entry, unsigned long *size) const char *path = entry->path; if (!entry->stage) - return read_sha1_file(entry->blob->object.oid.hash, &type, size); + return read_object_file(&entry->blob->object.oid, &type, size); base = NULL; if (entry->stage == 1) { base = entry->blob; @@ -82,7 +82,8 @@ static void *origin(struct merge_list *entry, unsigned long *size) enum object_type type; while (entry) { if (entry->stage == 2) - return read_sha1_file(entry->blob->object.oid.hash, &type, size); + return read_object_file(&entry->blob->object.oid, + &type, size); entry = entry->link; } return NULL; @@ -213,11 +214,11 @@ static void unresolved_directory(const struct traverse_info *info, newbase = traverse_path(info, p); -#define ENTRY_SHA1(e) (((e)->mode && S_ISDIR((e)->mode)) ? (e)->oid->hash : NULL) - buf0 = fill_tree_descriptor(t+0, ENTRY_SHA1(n + 0)); - buf1 = fill_tree_descriptor(t+1, ENTRY_SHA1(n + 1)); - buf2 = fill_tree_descriptor(t+2, ENTRY_SHA1(n + 2)); -#undef ENTRY_SHA1 +#define ENTRY_OID(e) (((e)->mode && S_ISDIR((e)->mode)) ? (e)->oid : NULL) + buf0 = fill_tree_descriptor(t + 0, ENTRY_OID(n + 0)); + buf1 = fill_tree_descriptor(t + 1, ENTRY_OID(n + 1)); + buf2 = fill_tree_descriptor(t + 2, ENTRY_OID(n + 2)); +#undef ENTRY_OID merge_trees(t, newbase); @@ -352,7 +353,7 @@ static void *get_tree_descriptor(struct tree_desc *desc, const char *rev) if (get_oid(rev, &oid)) die("unknown rev %s", rev); - buf = fill_tree_descriptor(desc, oid.hash); + buf = fill_tree_descriptor(desc, &oid); if (!buf) die("%s is not a tree", rev); return buf; |