aboutsummaryrefslogtreecommitdiff
path: root/builtin/blame.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2015-11-10 02:22:27 +0000
committerJeff King <peff@peff.net>2015-11-20 08:02:05 -0500
commit7999b2cf772956466baa8925491d6fb1b0963292 (patch)
tree34a3bf75c3cdc621d732107f53181ff28c0550a4 /builtin/blame.c
parent3c4270107fec2c1d85b7b1a6f8b0aeebf3193b28 (diff)
downloadgit-7999b2cf772956466baa8925491d6fb1b0963292.tar.gz
git-7999b2cf772956466baa8925491d6fb1b0963292.tar.xz
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/blame.c')
-rw-r--r--builtin/blame.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/builtin/blame.c b/builtin/blame.c
index 83612f5b6..c6ea9774b 100644
--- a/builtin/blame.c
+++ b/builtin/blame.c
@@ -506,7 +506,7 @@ static int fill_blob_sha1_and_mode(struct origin *origin)
{
if (!is_null_sha1(origin->blob_sha1))
return 0;
- if (get_tree_entry(origin->commit->object.sha1,
+ if (get_tree_entry(get_object_hash(origin->commit->object),
origin->path,
origin->blob_sha1, &origin->mode))
goto error_out;
@@ -558,10 +558,10 @@ static struct origin *find_origin(struct scoreboard *sb,
diff_setup_done(&diff_opts);
if (is_null_sha1(origin->commit->object.sha1))
- do_diff_cache(parent->tree->object.sha1, &diff_opts);
+ do_diff_cache(get_object_hash(parent->tree->object), &diff_opts);
else
- diff_tree_sha1(parent->tree->object.sha1,
- origin->commit->tree->object.sha1,
+ diff_tree_sha1(get_object_hash(parent->tree->object),
+ get_object_hash(origin->commit->tree->object),
"", &diff_opts);
diffcore_std(&diff_opts);
@@ -628,10 +628,10 @@ static struct origin *find_rename(struct scoreboard *sb,
diff_setup_done(&diff_opts);
if (is_null_sha1(origin->commit->object.sha1))
- do_diff_cache(parent->tree->object.sha1, &diff_opts);
+ do_diff_cache(get_object_hash(parent->tree->object), &diff_opts);
else
- diff_tree_sha1(parent->tree->object.sha1,
- origin->commit->tree->object.sha1,
+ diff_tree_sha1(get_object_hash(parent->tree->object),
+ get_object_hash(origin->commit->tree->object),
"", &diff_opts);
diffcore_std(&diff_opts);
@@ -1276,10 +1276,10 @@ static void find_copy_in_parent(struct scoreboard *sb,
DIFF_OPT_SET(&diff_opts, FIND_COPIES_HARDER);
if (is_null_sha1(target->commit->object.sha1))
- do_diff_cache(parent->tree->object.sha1, &diff_opts);
+ do_diff_cache(get_object_hash(parent->tree->object), &diff_opts);
else
- diff_tree_sha1(parent->tree->object.sha1,
- target->commit->tree->object.sha1,
+ diff_tree_sha1(get_object_hash(parent->tree->object),
+ get_object_hash(target->commit->tree->object),
"", &diff_opts);
if (!DIFF_OPT_TST(&diff_opts, FIND_COPIES_HARDER))
@@ -2077,7 +2077,7 @@ static int read_ancestry(const char *graft_file)
static int update_auto_abbrev(int auto_abbrev, struct origin *suspect)
{
- const char *uniq = find_unique_abbrev(suspect->commit->object.sha1,
+ const char *uniq = find_unique_abbrev(get_object_hash(suspect->commit->object),
auto_abbrev);
int len = strlen(uniq);
if (auto_abbrev < len)
@@ -2216,7 +2216,7 @@ static void verify_working_tree_path(struct commit *work_tree, const char *path)
struct commit_list *parents;
for (parents = work_tree->parents; parents; parents = parents->next) {
- const unsigned char *commit_sha1 = parents->item->object.sha1;
+ const unsigned char *commit_sha1 = get_object_hash(parents->item->object);
unsigned char blob_sha1[20];
unsigned mode;