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>
This commit is contained in:
brian m. carlson
2016-06-24 23:09:23 +00:00
committed by Junio C Hamano
parent c368dde924
commit a0d12c4433
13 changed files with 147 additions and 128 deletions

View File

@ -432,7 +432,8 @@ static void wt_status_collect_changed_cb(struct diff_queue_struct *q,
d->worktree_status = p->status;
d->dirty_submodule = p->two->dirty_submodule;
if (S_ISGITLINK(p->two->mode))
d->new_submodule_commits = !!hashcmp(p->one->sha1, p->two->sha1);
d->new_submodule_commits = !!oidcmp(&p->one->oid,
&p->two->oid);
}
}