diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2015-11-10 02:22:27 +0000 |
---|---|---|
committer | Jeff King <peff@peff.net> | 2015-11-20 08:02:05 -0500 |
commit | 7999b2cf772956466baa8925491d6fb1b0963292 (patch) | |
tree | 34a3bf75c3cdc621d732107f53181ff28c0550a4 /builtin/diff-tree.c | |
parent | 3c4270107fec2c1d85b7b1a6f8b0aeebf3193b28 (diff) | |
download | git-7999b2cf772956466baa8925491d6fb1b0963292.tar.gz |
Add several uses of get_object_hash.
Convert most instances where the sha1 member of struct object is
dereferenced to use get_object_hash. Most instances that are passed to
functions that have versions taking struct object_id, such as
get_sha1_hex/get_oid_hex, or instances that can be trivially converted
to use struct object_id instead, are not converted.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Jeff King <peff@peff.net>
Diffstat (limited to 'builtin/diff-tree.c')
-rw-r--r-- | builtin/diff-tree.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin/diff-tree.c b/builtin/diff-tree.c index 12b683d021..cf7e9604b3 100644 --- a/builtin/diff-tree.c +++ b/builtin/diff-tree.c @@ -51,7 +51,7 @@ static int stdin_diff_trees(struct tree *tree1, char *line, int len) return -1; printf("%s %s\n", sha1_to_hex(tree1->object.sha1), sha1_to_hex(tree2->object.sha1)); - diff_tree_sha1(tree1->object.sha1, tree2->object.sha1, + diff_tree_sha1(get_object_hash(tree1->object), get_object_hash(tree2->object), "", &log_tree_opt.diffopt); log_tree_diff_flush(&log_tree_opt); return 0; @@ -139,7 +139,7 @@ int cmd_diff_tree(int argc, const char **argv, const char *prefix) break; case 1: tree1 = opt->pending.objects[0].item; - diff_tree_commit_sha1(tree1->sha1); + diff_tree_commit_sha1(get_object_hash(*tree1)); break; case 2: tree1 = opt->pending.objects[0].item; @@ -149,8 +149,8 @@ int cmd_diff_tree(int argc, const char **argv, const char *prefix) tree2 = tree1; tree1 = tmp; } - diff_tree_sha1(tree1->sha1, - tree2->sha1, + diff_tree_sha1(get_object_hash(*tree1), + get_object_hash(*tree2), "", &opt->diffopt); log_tree_diff_flush(opt); break; |