diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-08-24 19:20:02 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-08-24 19:20:02 +0200 |
commit | 11bd95604ab6ebc8c2edf7db4dccb33c7659890b (patch) | |
tree | 1b5fc5153d000bbe96274db537891d4ad7c94d40 /builtin | |
parent | Merge branch 'lg/merge-signoff' (diff) | |
parent | tree-walk: convert fill_tree_descriptor() to object_id (diff) | |
download | git-11bd95604ab6ebc8c2edf7db4dccb33c7659890b.tar.xz git-11bd95604ab6ebc8c2edf7db4dccb33c7659890b.zip |
Merge branch 'rs/object-id'
Conversion from uchar[20] to struct object_id continues.
* rs/object-id:
tree-walk: convert fill_tree_descriptor() to object_id
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/merge-tree.c | 12 | ||||
-rw-r--r-- | builtin/reset.c | 4 |
2 files changed, 8 insertions, 8 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; diff --git a/builtin/reset.c b/builtin/reset.c index 046403ed68..4a02d74073 100644 --- a/builtin/reset.c +++ b/builtin/reset.c @@ -75,13 +75,13 @@ static int reset_index(const struct object_id *oid, int reset_type, int quiet) struct object_id head_oid; if (get_oid("HEAD", &head_oid)) return error(_("You do not have a valid HEAD.")); - if (!fill_tree_descriptor(desc, head_oid.hash)) + if (!fill_tree_descriptor(desc, &head_oid)) return error(_("Failed to find tree of HEAD.")); nr++; opts.fn = twoway_merge; } - if (!fill_tree_descriptor(desc + nr - 1, oid->hash)) + if (!fill_tree_descriptor(desc + nr - 1, oid)) return error(_("Failed to find tree of %s."), oid_to_hex(oid)); if (unpack_trees(nr, desc, &opts)) return -1; |