aboutsummaryrefslogtreecommitdiff
path: root/unpack-trees.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2016-09-05 20:07:52 +0000
committerJunio C Hamano <gitster@pobox.com>2016-09-07 12:59:42 -0700
commit99d1a9861ae88595e7386c453b6b38573a8a570c (patch)
tree670664666d85bb83d7d80b83904c25adb5b7029a /unpack-trees.c
parent6ebdac1bab966b720d776aa43ca188fe378b1f4b (diff)
downloadgit-99d1a9861ae88595e7386c453b6b38573a8a570c.tar.gz
git-99d1a9861ae88595e7386c453b6b38573a8a570c.tar.xz
cache: convert struct cache_entry to use struct object_id
Convert struct cache_entry to use struct object_id by applying the following semantic patch and the object_id transforms from contrib, plus the actual change to the struct: @@ struct cache_entry E1; @@ - E1.sha1 + E1.oid.hash @@ struct cache_entry *E1; @@ - E1->sha1 + E1->oid.hash Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'unpack-trees.c')
-rw-r--r--unpack-trees.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/unpack-trees.c b/unpack-trees.c
index 11c37fbc5..9238308f1 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -625,7 +625,7 @@ static struct cache_entry *create_ce_entry(const struct traverse_info *info, con
ce->ce_mode = create_ce_mode(n->mode);
ce->ce_flags = create_ce_flags(stage);
ce->ce_namelen = len;
- hashcpy(ce->sha1, n->oid->hash);
+ oidcpy(&ce->oid, n->oid);
make_traverse_path(ce->name, info, n);
return ce;
@@ -1287,7 +1287,7 @@ static int same(const struct cache_entry *a, const struct cache_entry *b)
if ((a->ce_flags | b->ce_flags) & CE_CONFLICTED)
return 0;
return a->ce_mode == b->ce_mode &&
- !hashcmp(a->sha1, b->sha1);
+ !oidcmp(&a->oid, &b->oid);
}
@@ -1393,7 +1393,7 @@ static int verify_clean_subdirectory(const struct cache_entry *ce,
/* If we are not going to update the submodule, then
* we don't care.
*/
- if (!hashcmp(sha1, ce->sha1))
+ if (!hashcmp(sha1, ce->oid.hash))
return 0;
return verify_clean_submodule(ce, error_type, o);
}
@@ -1665,7 +1665,7 @@ static void show_stage_entry(FILE *o,
fprintf(o, "%s%06o %s %d\t%s\n",
label,
ce->ce_mode,
- sha1_to_hex(ce->sha1),
+ oid_to_hex(&ce->oid),
ce_stage(ce),
ce->name);
}