aboutsummaryrefslogtreecommitdiff
path: root/builtin/fast-export.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2016-06-24 23:09:23 +0000
committerJunio C Hamano <gitster@pobox.com>2016-06-28 11:39:02 -0700
commita0d12c4433e25e87b67df78b45635df8a098fb23 (patch)
tree4fccd5651863d2ae9aeeaeabdab57a1c7159609b /builtin/fast-export.c
parentc368dde9245fa3d50b7e01e1ff4f9e5c12c718da (diff)
downloadgit-a0d12c4433e25e87b67df78b45635df8a098fb23.tar.gz
git-a0d12c4433e25e87b67df78b45635df8a098fb23.tar.xz
diff: convert struct diff_filespec to struct object_id
Convert struct diff_filespec's sha1 member to use a struct object_id called "oid" instead. The following Coccinelle semantic patch was used to implement this, followed by the transformations in object_id.cocci: @@ struct diff_filespec o; @@ - o.sha1 + o.oid.hash @@ struct diff_filespec *p; @@ - p->sha1 + p->oid.hash Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/fast-export.c')
-rw-r--r--builtin/fast-export.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/builtin/fast-export.c b/builtin/fast-export.c
index 8164b581a..c0652a7ed 100644
--- a/builtin/fast-export.c
+++ b/builtin/fast-export.c
@@ -368,7 +368,7 @@ static void show_filemodify(struct diff_queue_struct *q,
print_path(spec->path);
putchar('\n');
- if (!hashcmp(ospec->sha1, spec->sha1) &&
+ if (!oidcmp(&ospec->oid, &spec->oid) &&
ospec->mode == spec->mode)
break;
/* fallthrough */
@@ -383,10 +383,10 @@ static void show_filemodify(struct diff_queue_struct *q,
if (no_data || S_ISGITLINK(spec->mode))
printf("M %06o %s ", spec->mode,
sha1_to_hex(anonymize ?
- anonymize_sha1(spec->sha1) :
- spec->sha1));
+ anonymize_sha1(spec->oid.hash) :
+ spec->oid.hash));
else {
- struct object *object = lookup_object(spec->sha1);
+ struct object *object = lookup_object(spec->oid.hash);
printf("M %06o :%d ", spec->mode,
get_object_mark(object));
}
@@ -572,7 +572,7 @@ static void handle_commit(struct commit *commit, struct rev_info *rev)
/* Export the referenced blobs, and remember the marks. */
for (i = 0; i < diff_queued_diff.nr; i++)
if (!S_ISGITLINK(diff_queued_diff.queue[i]->two->mode))
- export_blob(diff_queued_diff.queue[i]->two->sha1);
+ export_blob(diff_queued_diff.queue[i]->two->oid.hash);
refname = commit->util;
if (anonymize) {