diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2016-06-24 23:09:23 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-06-28 11:39:02 -0700 |
commit | a0d12c4433e25e87b67df78b45635df8a098fb23 (patch) | |
tree | 4fccd5651863d2ae9aeeaeabdab57a1c7159609b /combine-diff.c | |
parent | c368dde9245fa3d50b7e01e1ff4f9e5c12c718da (diff) | |
download | git-a0d12c4433e25e87b67df78b45635df8a098fb23.tar.gz |
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 'combine-diff.c')
-rw-r--r-- | combine-diff.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/combine-diff.c b/combine-diff.c index 8f2313d502..3537209cd4 100644 --- a/combine-diff.c +++ b/combine-diff.c @@ -44,9 +44,9 @@ static struct combine_diff_path *intersect_paths(struct combine_diff_path *curr, memset(p->parent, 0, sizeof(p->parent[0]) * num_parent); - hashcpy(p->oid.hash, q->queue[i]->two->sha1); + oidcpy(&p->oid, &q->queue[i]->two->oid); p->mode = q->queue[i]->two->mode; - hashcpy(p->parent[n].oid.hash, q->queue[i]->one->sha1); + oidcpy(&p->parent[n].oid, &q->queue[i]->one->oid); p->parent[n].mode = q->queue[i]->one->mode; p->parent[n].status = q->queue[i]->status; *tail = p; @@ -77,7 +77,7 @@ static struct combine_diff_path *intersect_paths(struct combine_diff_path *curr, continue; } - hashcpy(p->parent[n].oid.hash, q->queue[i]->one->sha1); + oidcpy(&p->parent[n].oid, &q->queue[i]->one->oid); p->parent[n].mode = q->queue[i]->one->mode; p->parent[n].status = q->queue[i]->status; @@ -1268,7 +1268,7 @@ static struct diff_filepair *combined_pair(struct combine_diff_path *p, for (i = 0; i < num_parent; i++) { pair->one[i].path = p->path; pair->one[i].mode = p->parent[i].mode; - hashcpy(pair->one[i].sha1, p->parent[i].oid.hash); + oidcpy(&pair->one[i].oid, &p->parent[i].oid); pair->one[i].sha1_valid = !is_null_oid(&p->parent[i].oid); pair->one[i].has_more_entries = 1; } @@ -1276,7 +1276,7 @@ static struct diff_filepair *combined_pair(struct combine_diff_path *p, pair->two->path = p->path; pair->two->mode = p->mode; - hashcpy(pair->two->sha1, p->oid.hash); + oidcpy(&pair->two->oid, &p->oid); pair->two->sha1_valid = !is_null_oid(&p->oid); return pair; } |