diff options
author | Junio C Hamano <gitster@pobox.com> | 2015-05-05 21:00:23 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-05-05 21:00:23 -0700 |
commit | a916cb5fb4824322d7e99b1b0efad4e6d7850e78 (patch) | |
tree | d9ccc322b7b02d3af296ef313df8dc046ca3fc7d /diff-lib.c | |
parent | 3d4a3ffe64162b45ae7c991fc60623ecb4678cfd (diff) | |
parent | d07d4ab401173a10173f2747cf5e0f074b6d2b39 (diff) | |
download | git-a916cb5fb4824322d7e99b1b0efad4e6d7850e78.tar.gz |
Merge branch 'bc/object-id'
Identify parts of the code that knows that we use SHA-1 hash to
name our objects too much, and use (1) symbolic constants instead
of hardcoded 20 as byte count and/or (2) use struct object_id
instead of unsigned char [20] for object names.
* bc/object-id:
apply: convert threeway_stage to object_id
patch-id: convert to use struct object_id
commit: convert parts to struct object_id
diff: convert struct combine_diff_path to object_id
bulk-checkin.c: convert to use struct object_id
zip: use GIT_SHA1_HEXSZ for trailers
archive.c: convert to use struct object_id
bisect.c: convert leaf functions to use struct object_id
define utility functions for object IDs
define a structure for object IDs
Diffstat (limited to 'diff-lib.c')
-rw-r--r-- | diff-lib.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/diff-lib.c b/diff-lib.c index a85c4971ac..241a8435eb 100644 --- a/diff-lib.c +++ b/diff-lib.c @@ -125,7 +125,7 @@ int run_diff_files(struct rev_info *revs, unsigned int option) dpath->next = NULL; memcpy(dpath->path, ce->name, path_len); dpath->path[path_len] = '\0'; - hashclr(dpath->sha1); + oidclr(&dpath->oid); memset(&(dpath->parent[0]), 0, sizeof(struct combine_diff_parent)*5); @@ -155,7 +155,7 @@ int run_diff_files(struct rev_info *revs, unsigned int option) if (2 <= stage) { int mode = nce->ce_mode; num_compare_stages++; - hashcpy(dpath->parent[stage-2].sha1, nce->sha1); + hashcpy(dpath->parent[stage-2].oid.hash, nce->sha1); dpath->parent[stage-2].mode = ce_mode_from_stat(nce, mode); dpath->parent[stage-2].status = DIFF_STATUS_MODIFIED; @@ -339,14 +339,14 @@ static int show_modified(struct rev_info *revs, memcpy(p->path, new->name, pathlen); p->path[pathlen] = 0; p->mode = mode; - hashclr(p->sha1); + oidclr(&p->oid); memset(p->parent, 0, 2 * sizeof(struct combine_diff_parent)); p->parent[0].status = DIFF_STATUS_MODIFIED; p->parent[0].mode = new->ce_mode; - hashcpy(p->parent[0].sha1, new->sha1); + hashcpy(p->parent[0].oid.hash, new->sha1); p->parent[1].status = DIFF_STATUS_MODIFIED; p->parent[1].mode = old->ce_mode; - hashcpy(p->parent[1].sha1, old->sha1); + hashcpy(p->parent[1].oid.hash, old->sha1); show_combined_diff(p, 2, revs->dense_combined_merges, revs); free(p); return 0; |