diff options
author | René Scharfe <l.s.r@web.de> | 2017-08-12 10:32:59 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-08-14 12:38:54 -0700 |
commit | 5c377d3d593d324346bbaa965cbff8870795b420 (patch) | |
tree | b2a517d5ec88c9b5c2618b80b0f45a74fdaf2638 /builtin/merge-tree.c | |
parent | The first batch of topics after the 2.14 cycle (diff) | |
download | tgif-5c377d3d593d324346bbaa965cbff8870795b420.tar.xz |
tree-walk: convert fill_tree_descriptor() to object_id
All callers of fill_tree_descriptor() have been converted to object_id
already, so convert that function as well. As a nice side-effect we get
rid of NULL checks in tree-diff.c, as fill_tree_descriptor() already
does them for us.
Helped-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Reviewed-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/merge-tree.c')
-rw-r--r-- | builtin/merge-tree.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/builtin/merge-tree.c b/builtin/merge-tree.c index f12da292cf..d01ddecf66 100644 --- a/builtin/merge-tree.c +++ b/builtin/merge-tree.c @@ -213,11 +213,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 +352,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; |