Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2015-11-10 05:22:27 +0300
committerJeff King <peff@peff.net>2015-11-20 16:02:05 +0300
commit7999b2cf772956466baa8925491d6fb1b0963292 (patch)
tree34a3bf75c3cdc621d732107f53181ff28c0550a4 /builtin/fast-export.c
parent3c4270107fec2c1d85b7b1a6f8b0aeebf3193b28 (diff)
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/fast-export.c')
-rw-r--r--builtin/fast-export.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/builtin/fast-export.c b/builtin/fast-export.c
index d23f3beba9..30faf248f7 100644
--- a/builtin/fast-export.c
+++ b/builtin/fast-export.c
@@ -562,11 +562,11 @@ static void handle_commit(struct commit *commit, struct rev_info *rev)
get_object_mark(&commit->parents->item->object) != 0 &&
!full_tree) {
parse_commit_or_die(commit->parents->item);
- diff_tree_sha1(commit->parents->item->tree->object.sha1,
- commit->tree->object.sha1, "", &rev->diffopt);
+ diff_tree_sha1(get_object_hash(commit->parents->item->tree->object),
+ get_object_hash(commit->tree->object), "", &rev->diffopt);
}
else
- diff_root_tree_sha1(commit->tree->object.sha1,
+ diff_root_tree_sha1(get_object_hash(commit->tree->object),
"", &rev->diffopt);
/* Export the referenced blobs, and remember the marks. */
@@ -665,7 +665,7 @@ static void handle_tag(const char *name, struct tag *tag)
return;
}
- buf = read_sha1_file(tag->object.sha1, &type, &size);
+ buf = read_sha1_file(get_object_hash(tag->object), &type, &size);
if (!buf)
die ("Could not read tag %s", sha1_to_hex(tag->object.sha1));
message = memmem(buf, size, "\n\n", 2);
@@ -777,7 +777,7 @@ static struct commit *get_commit(struct rev_cmdline_entry *e, char *full_name)
/* handle nested tags */
while (tag && tag->object.type == OBJ_TAG) {
- parse_object(tag->object.sha1);
+ parse_object(get_object_hash(tag->object));
string_list_append(&extra_refs, full_name)->util = tag;
tag = (struct tag *)tag->tagged;
}
@@ -828,7 +828,7 @@ static void get_tags_and_duplicates(struct rev_cmdline_info *info)
case OBJ_COMMIT:
break;
case OBJ_BLOB:
- export_blob(commit->object.sha1);
+ export_blob(get_object_hash(commit->object));
continue;
default: /* OBJ_TAG (nested tags) is already handled */
warning("Tag points to object of unexpected type %s, skipping.",